From owner-svn-src-all@freebsd.org Sun Dec 13 00:41:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8968EA4114B for ; Sun, 13 Dec 2015 00:41:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC54181B for ; Sun, 13 Dec 2015 00:41:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkdp187 with SMTP id p187so91031800qkd.1 for ; Sat, 12 Dec 2015 16:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=cccyQ15Yp+jbPPTctJH8DS5Armc+45mrCE1dVnbxu8c=; b=IQCPkXvOS3cscUj1mr0hsUkJlqu4wPFSLY6Ym4dGQmRcgOr/xun2dJpG4JxGbcWMcj Zvysuhno7jxLLJq12kBXtu2eAh38nHMMIavq5e95ALRFHk4xytw8prx66CfdfxXwx17Y fwfKt0Zl0dxc4DbwUrWwz0tSCuEOKgqcFdPLgx+kw/y8utXWSIRkDRstkBh1ZrMuO/aK ZyPXJcMDtU1rfnVsocq/RtEWgAZxnXVYOHaWZlqAN6Klv7LtiVnaOw7b4pToHJePSuo0 VTwyDM5uNKB8xTcFs0XO4A9AbvUdYNXms0FRZv+0+0s54/5Gm6ktSfq6bKQtMbeBmhWQ QQRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=cccyQ15Yp+jbPPTctJH8DS5Armc+45mrCE1dVnbxu8c=; b=Q+U8S5cP4ffBxYblg13UiMKnxkiJJMfD741trv5L1Uy7Kp7QxKEpk5U2VhSTWM+yze gWuwB8U4oSRwxAj/9EOEERHMKwDWaC3Qhuex1+oU0yF7BDKEh3Up1YnUW3FC3ruECV2H nawrfGTT0ZtXlj18zo+sExuEeFQifUdfRAYVSRyol1vjpuTC/FjCGKpQitDQu8EoP7my KBpwZXYrd1IDU8z4NZqL0/lNbPLHfvbDlFB5GJjuELUUPpeU7vIu1QcE0ulYDWjLtXbX UiLlmv+Ny+4PRvWB+kUvzcUwoJBVXzpJvfTiSBId/7n8AbECcQjIncgeVEwi/cJp/uYY 9p6w== X-Gm-Message-State: ALoCoQlS/V6rHSTnSd+mowO36quWFqnrWlUhPoKC9COR5NNbRQUcU89rzVD5qaLoWU7zsPoLp/0eRFaQng9O95r60HebkMLtRQ== MIME-Version: 1.0 X-Received: by 10.55.207.73 with SMTP id e70mr32915980qkj.77.1449967315352; Sat, 12 Dec 2015 16:41:55 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Sat, 12 Dec 2015 16:41:55 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <4D007463-F8E5-4092-9FA4-0396E0A1444D@shxd.cx> References: <201512070402.tB742V3Z081964@repo.freebsd.org> <4D007463-F8E5-4092-9FA4-0396E0A1444D@shxd.cx> Date: Sat, 12 Dec 2015 17:41:55 -0700 X-Google-Sender-Auth: 91L_Gr31HxPCcabYZq8O1hmWiQ0 Message-ID: Subject: Re: svn commit: r291913 - head/tools/tools/nanobsd From: Warner Losh To: Devin Teske Cc: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= , Warner Losh , src-committers , svn-src-all , svn-src-head , Devin Teske Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 00:41:57 -0000 On Sat, Dec 12, 2015 at 8:27 AM, Devin Teske wrote: > > > On Dec 11, 2015, at 11:55 PM, Olivier Cochard-Labb=C3=A9 > wrote: > > On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: > >> Author: imp >> Date: Mon Dec 7 04:02:31 2015 >> New Revision: 291913 >> URL: https://svnweb.freebsd.org/changeset/base/291913 >> >> Log: >> Generally use shorter, more idiomatic sh expressions in a bunch of >> places. >> >> Modified: >> head/tools/tools/nanobsd/defaults.sh (contents, props changed) >> > > > =E2=80=8BHi, > > I beleive there is a tipo here : > =E2=80=8B > > >> >> Modified: head/tools/tools/nanobsd/defaults.sh >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:19 2015 >> (r291912) >> +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:31 2015 >> (r291913) >> >> ####################################################################### >> @@ -949,21 +949,21 @@ export_var ( ) { # Don't wawnt a subshe >> # Call this function to set defaults _after_ parsing options. >> # dont want a subshell otherwise variable setting is thrown away. >> set_defaults_and_export ( ) { >> - test -n "${NANO_OBJ}" || NANO_OBJ=3D/usr/obj/nanobsd.${NANO_NAME= } >> - test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=3D${NANO_OBJ} >> - test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=3D${NANO_OBJ} >> + : ${NANO_OBJ:=3D/usr/obj/nanobsd.${NANO_NAME}} >> + : ${MAKEOBJDIRPREFIX:=3D${NANO_OBJ}} >> + : ${NANO_DISKIMGDIR=3D:${NANO_OBJ}} >> NANO_WORLDDIR=3D${NANO_OBJ}/_.w >> NANO_MAKE_CONF_BUILD=3D${MAKEOBJDIRPREFIX}/make.conf.build >> NANO_MAKE_CONF_INSTALL=3D${NANO_OBJ}/make.conf.install >> >> > > > =E2=80=8BNotice the line: > : ${NANO_DISKIMGDIR=3D:${NANO_OBJ}} > > > Author meant ":=3D" instead of "=3D:" > Correct. It should be fixed now. Warner From owner-svn-src-all@freebsd.org Sun Dec 13 03:32:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76147A41C9A; Sun, 13 Dec 2015 03:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 436C014C6; Sun, 13 Dec 2015 03:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3WfWk071093; Sun, 13 Dec 2015 03:32:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3Wf6t071092; Sun, 13 Dec 2015 03:32:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130332.tBD3Wf6t071092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03: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: r292136 - stable/10/sys/ofed/drivers/infiniband/hw/mthca 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:32:42 -0000 Author: ngie Date: Sun Dec 13 03:32:41 2015 New Revision: 292136 URL: https://svnweb.freebsd.org/changeset/base/292136 Log: MFC r291753: Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..) They're only used in the __linux__ case Differential Revision: https://reviews.freebsd.org/D4332 Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Sat Dec 12 22:54:12 2015 (r292135) +++ stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Sun Dec 13 03:32:41 2015 (r292136) @@ -43,9 +43,13 @@ int mthca_reset(struct mthca_dev *mdev) int i; int err = 0; u32 *hca_header = NULL; +#ifdef __linux__ u32 *bridge_header = NULL; +#endif struct pci_dev *bridge = NULL; +#ifdef __linux__ int bridge_pcix_cap = 0; +#endif int hca_pcie_cap = 0; int hca_pcix_cap = 0; @@ -195,6 +199,7 @@ int mthca_reset(struct mthca_dev *mdev) } good: +#ifdef __linux__ /* Now restore the PCI headers */ if (bridge) { if (pci_write_config_dword(bridge, bridge_pcix_cap + 0x8, @@ -235,6 +240,7 @@ good: goto out; } } +#endif if (hca_pcix_cap) { if (pci_write_config_dword(mdev->pdev, hca_pcix_cap, @@ -289,8 +295,8 @@ out: #ifdef __linux__ if (bridge) pci_dev_put(bridge); -#endif kfree(bridge_header); +#endif kfree(hca_header); return err; From owner-svn-src-all@freebsd.org Sun Dec 13 03:35:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B366DA41E87; Sun, 13 Dec 2015 03:35:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 834CF174C; Sun, 13 Dec 2015 03:35:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3Zs6g071273; Sun, 13 Dec 2015 03:35:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3ZsS1071272; Sun, 13 Dec 2015 03:35:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130335.tBD3ZsS1071272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292137 - stable/9/sys/ofed/drivers/infiniband/hw/mthca 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:35:55 -0000 Author: ngie Date: Sun Dec 13 03:35:54 2015 New Revision: 292137 URL: https://svnweb.freebsd.org/changeset/base/292137 Log: MFstable/10 r292136: MFC r291753: Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..) They're only used in the __linux__ case Differential Revision: https://reviews.freebsd.org/D4332 Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division Modified: stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Sun Dec 13 03:32:41 2015 (r292136) +++ stable/9/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Sun Dec 13 03:35:54 2015 (r292137) @@ -43,9 +43,13 @@ int mthca_reset(struct mthca_dev *mdev) int i; int err = 0; u32 *hca_header = NULL; +#ifdef __linux__ u32 *bridge_header = NULL; +#endif struct pci_dev *bridge = NULL; +#ifdef __linux__ int bridge_pcix_cap = 0; +#endif int hca_pcie_cap = 0; int hca_pcix_cap = 0; @@ -195,6 +199,7 @@ int mthca_reset(struct mthca_dev *mdev) } good: +#ifdef __linux__ /* Now restore the PCI headers */ if (bridge) { if (pci_write_config_dword(bridge, bridge_pcix_cap + 0x8, @@ -235,6 +240,7 @@ good: goto out; } } +#endif if (hca_pcix_cap) { if (pci_write_config_dword(mdev->pdev, hca_pcix_cap, @@ -289,8 +295,8 @@ out: #ifdef __linux__ if (bridge) pci_dev_put(bridge); -#endif kfree(bridge_header); +#endif kfree(hca_header); return err; From owner-svn-src-all@freebsd.org Sun Dec 13 03:37:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3083FA14078; Sun, 13 Dec 2015 03:37:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F9D18E4; Sun, 13 Dec 2015 03:37:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3bURQ071389; Sun, 13 Dec 2015 03:37:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3bUL8071388; Sun, 13 Dec 2015 03:37:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130337.tBD3bUL8071388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:37: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: r292138 - stable/10/lib/libc/gen 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:37:31 -0000 Author: ngie Date: Sun Dec 13 03:37:29 2015 New Revision: 292138 URL: https://svnweb.freebsd.org/changeset/base/292138 Log: MFC r291979: Unbreak compiling getnetgrent.c with -DDEBUG after r236402 by adding a missing "}" Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/gen/getnetgrent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getnetgrent.c ============================================================================== --- stable/10/lib/libc/gen/getnetgrent.c Sun Dec 13 03:35:54 2015 (r292137) +++ stable/10/lib/libc/gen/getnetgrent.c Sun Dec 13 03:37:29 2015 (r292138) @@ -512,6 +512,7 @@ parse_netgrp(const char *group) ng[NG_DOM] == NULL ? "" : ",", ng[NG_DOM] == NULL ? "" : ng[NG_DOM], lp->l_groupname); + } #endif } else { spos = strsep(&pos, ", \t"); From owner-svn-src-all@freebsd.org Sun Dec 13 03:38:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED645A1415D; Sun, 13 Dec 2015 03:38:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAB4F1A71; Sun, 13 Dec 2015 03:38:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3cJr1071478; Sun, 13 Dec 2015 03:38:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3cJg0071477; Sun, 13 Dec 2015 03:38:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130338.tBD3cJg0071477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:38: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: r292139 - stable/9/lib/libc/gen 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:38:21 -0000 Author: ngie Date: Sun Dec 13 03:38:19 2015 New Revision: 292139 URL: https://svnweb.freebsd.org/changeset/base/292139 Log: MFstable/10 r292138: MFC r291979: Unbreak compiling getnetgrent.c with -DDEBUG after r236402 by adding a missing "}" Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/gen/getnetgrent.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/getnetgrent.c ============================================================================== --- stable/9/lib/libc/gen/getnetgrent.c Sun Dec 13 03:37:29 2015 (r292138) +++ stable/9/lib/libc/gen/getnetgrent.c Sun Dec 13 03:38:19 2015 (r292139) @@ -512,6 +512,7 @@ parse_netgrp(const char *group) ng[NG_DOM] == NULL ? "" : ",", ng[NG_DOM] == NULL ? "" : ng[NG_DOM], lp->l_groupname); + } #endif } else { spos = strsep(&pos, ", \t"); From owner-svn-src-all@freebsd.org Sun Dec 13 03:40:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 465FEA14394; Sun, 13 Dec 2015 03:40:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 108321C3F; Sun, 13 Dec 2015 03:40:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3eiQD071633; Sun, 13 Dec 2015 03:40:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3eiET071631; Sun, 13 Dec 2015 03:40:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130340.tBD3eiET071631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:40:44 +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: r292140 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:40:45 -0000 Author: ngie Date: Sun Dec 13 03:40:43 2015 New Revision: 292140 URL: https://svnweb.freebsd.org/changeset/base/292140 Log: MFC r292004: Fix compilation when -DDEBUG is defined by adding inttypes.h #include for intmax_t Differential Revision: https://reviews.freebsd.org/D4434 Reported by: cppcheck Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/stdio/open_memstream.c stable/10/lib/libc/stdio/open_wmemstream.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/open_memstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 03:38:19 2015 (r292139) +++ stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 03:40:43 2015 (r292140) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include Modified: stable/10/lib/libc/stdio/open_wmemstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 03:38:19 2015 (r292139) +++ stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 03:40:43 2015 (r292140) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include From owner-svn-src-all@freebsd.org Sun Dec 13 03:41:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B80A14445; Sun, 13 Dec 2015 03:41:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94DE81EE5; Sun, 13 Dec 2015 03:41:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3fooP072039; Sun, 13 Dec 2015 03:41:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3foMp072037; Sun, 13 Dec 2015 03:41:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130341.tBD3foMp072037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:41: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: r292141 - stable/9/lib/libc/stdio 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:41:51 -0000 Author: ngie Date: Sun Dec 13 03:41:50 2015 New Revision: 292141 URL: https://svnweb.freebsd.org/changeset/base/292141 Log: MFstable/10 r292140: MFC r292004: Fix compilation when -DDEBUG is defined by adding inttypes.h #include for intmax_t Differential Revision: https://reviews.freebsd.org/D4434 Reported by: cppcheck Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/stdio/open_memstream.c stable/9/lib/libc/stdio/open_wmemstream.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/open_memstream.c ============================================================================== --- stable/9/lib/libc/stdio/open_memstream.c Sun Dec 13 03:40:43 2015 (r292140) +++ stable/9/lib/libc/stdio/open_memstream.c Sun Dec 13 03:41:50 2015 (r292141) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include Modified: stable/9/lib/libc/stdio/open_wmemstream.c ============================================================================== --- stable/9/lib/libc/stdio/open_wmemstream.c Sun Dec 13 03:40:43 2015 (r292140) +++ stable/9/lib/libc/stdio/open_wmemstream.c Sun Dec 13 03:41:50 2015 (r292141) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include From owner-svn-src-all@freebsd.org Sun Dec 13 03:45:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BA7EA1488E; Sun, 13 Dec 2015 03:45:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6ECA112F; Sun, 13 Dec 2015 03:45:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3jwgb074380; Sun, 13 Dec 2015 03:45:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3jvwj074378; Sun, 13 Dec 2015 03:45:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130345.tBD3jvwj074378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:45: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: r292142 - in stable/10/tools/regression/tls: ttls2 ttls4 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:45:59 -0000 Author: ngie Date: Sun Dec 13 03:45:57 2015 New Revision: 292142 URL: https://svnweb.freebsd.org/changeset/base/292142 Log: MFC r291983,r291984: r291983: Fix compilation warnings by adding unistd.h #include and missing return statements Sponsored by: EMC / Isilon Storage Division r291984: Add missing stdlib.h header Apply some minor style(9) fixes Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/tls/ttls2/ttls2.c stable/10/tools/regression/tls/ttls4/ttls4.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/tls/ttls2/ttls2.c ============================================================================== --- stable/10/tools/regression/tls/ttls2/ttls2.c Sun Dec 13 03:41:50 2015 (r292141) +++ stable/10/tools/regression/tls/ttls2/ttls2.c Sun Dec 13 03:45:57 2015 (r292142) @@ -1,7 +1,8 @@ /* $FreeBSD$ */ -#include #include +#include +#include int __thread i; @@ -13,6 +14,7 @@ foo1(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } void * @@ -23,9 +25,11 @@ foo2(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { pthread_t t1, t2; @@ -33,4 +37,6 @@ int main(int argc, char** argv) pthread_create(&t2, 0, foo2, 0); pthread_join(t1, 0); pthread_join(t2, 0); + + return (0); } Modified: stable/10/tools/regression/tls/ttls4/ttls4.c ============================================================================== --- stable/10/tools/regression/tls/ttls4/ttls4.c Sun Dec 13 03:41:50 2015 (r292141) +++ stable/10/tools/regression/tls/ttls4/ttls4.c Sun Dec 13 03:45:57 2015 (r292142) @@ -9,11 +9,13 @@ #include #include +#include #include int __thread n; -void *f1(void *arg) +void +*f1(void *arg) { if (n != 0) { printf("bug, n == %d \n", n); @@ -23,7 +25,8 @@ void *f1(void *arg) return (0); } -int main() +int +main(void) { pthread_t td; int i; From owner-svn-src-all@freebsd.org Sun Dec 13 03:47:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F5A8A14AA8; Sun, 13 Dec 2015 03:47:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C903713B7; Sun, 13 Dec 2015 03:47:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3luUL074503; Sun, 13 Dec 2015 03:47:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3lum4074501; Sun, 13 Dec 2015 03:47:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130347.tBD3lum4074501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292143 - in stable/9/tools/regression/tls: ttls2 ttls4 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:47:58 -0000 Author: ngie Date: Sun Dec 13 03:47:56 2015 New Revision: 292143 URL: https://svnweb.freebsd.org/changeset/base/292143 Log: MFstable/10 r292142: MFC r291983,r291984: r291983: Fix compilation warnings by adding unistd.h #include and missing return statements Sponsored by: EMC / Isilon Storage Division r291984: Add missing stdlib.h header Apply some minor style(9) fixes Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/tls/ttls2/ttls2.c stable/9/tools/regression/tls/ttls4/ttls4.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/tls/ttls2/ttls2.c ============================================================================== --- stable/9/tools/regression/tls/ttls2/ttls2.c Sun Dec 13 03:45:57 2015 (r292142) +++ stable/9/tools/regression/tls/ttls2/ttls2.c Sun Dec 13 03:47:56 2015 (r292143) @@ -1,7 +1,8 @@ /* $FreeBSD$ */ -#include #include +#include +#include int __thread i; @@ -13,6 +14,7 @@ foo1(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } void * @@ -23,9 +25,11 @@ foo2(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { pthread_t t1, t2; @@ -33,4 +37,6 @@ int main(int argc, char** argv) pthread_create(&t2, 0, foo2, 0); pthread_join(t1, 0); pthread_join(t2, 0); + + return (0); } Modified: stable/9/tools/regression/tls/ttls4/ttls4.c ============================================================================== --- stable/9/tools/regression/tls/ttls4/ttls4.c Sun Dec 13 03:45:57 2015 (r292142) +++ stable/9/tools/regression/tls/ttls4/ttls4.c Sun Dec 13 03:47:56 2015 (r292143) @@ -9,11 +9,13 @@ #include #include +#include #include int __thread n; -void *f1(void *arg) +void +*f1(void *arg) { if (n != 0) { printf("bug, n == %d \n", n); @@ -23,7 +25,8 @@ void *f1(void *arg) return (0); } -int main() +int +main(void) { pthread_t td; int i; From owner-svn-src-all@freebsd.org Sun Dec 13 03:51:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D81A14DB4; Sun, 13 Dec 2015 03:51:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A162A1840; Sun, 13 Dec 2015 03:51:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3pnpx077190; Sun, 13 Dec 2015 03:51:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3pnbL077187; Sun, 13 Dec 2015 03:51:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130351.tBD3pnbL077187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:51: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: r292144 - stable/10/lib/libc/regex/grot 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:51:51 -0000 Author: ngie Date: Sun Dec 13 03:51:49 2015 New Revision: 292144 URL: https://svnweb.freebsd.org/changeset/base/292144 Log: MFC r291832,r291833,r291834,r291835,r291836,r291838: r291832: Fix -Wformat warnings by using the correct format qualifiers Sponsored by: EMC / Isilon Storage Division r291833: - Use ANSI C function prototypes/definitions instead of K&R style ones - Add a missing return type for main(..) Sponsored by: EMC / Isilon Storage Division r291834: Add missing headers and sort #includes per style(9) Sponsored by: EMC / Isilon Storage Division r291835: Use ANSI C function prototypes/definitions instead of K&R style ones Sponsored by: EMC / Isilon Storage Division r291836: Use `==` instead of `=` in the function comment above split(..) so mkh -p exposes split(..). Sponsored by: EMC / Isilon Storage Division r291838: Fix -Wformat issues and minor whitespace issues in surrounding areas Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/debug.c stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/debug.c ============================================================================== --- stable/10/lib/libc/regex/grot/debug.c Sun Dec 13 03:47:56 2015 (r292143) +++ stable/10/lib/libc/regex/grot/debug.c Sun Dec 13 03:51:49 2015 (r292144) @@ -186,7 +186,7 @@ FILE *d; fprintf(d, ">"); break; default: - fprintf(d, "!%d(%d)!", OP(*s), opnd); + fprintf(d, "!%ld(%ld)!", OP(*s), (long)opnd); break; } if (!done) Modified: stable/10/lib/libc/regex/grot/main.c ============================================================================== --- stable/10/lib/libc/regex/grot/main.c Sun Dec 13 03:47:56 2015 (r292143) +++ stable/10/lib/libc/regex/grot/main.c Sun Dec 13 03:51:49 2015 (r292144) @@ -1,11 +1,13 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include "main.ih" @@ -26,9 +28,8 @@ extern void regprint(); /* - main - do the simple case, hand off to regress() for regression */ -main(argc, argv) -int argc; -char *argv[]; +int +main(int argc, char **argv) { regex_t re; # define NS 10 @@ -80,43 +81,43 @@ char *argv[]; err = regcomp(&re, argv[optind++], copts); if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); + fprintf(stderr, "error %s, %zu/%zu `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); exit(status); } - regprint(&re, stdout); + regprint(&re, stdout); if (optind >= argc) { regfree(&re); exit(status); } - if (eopts®_STARTEND) { + if ((eopts & REG_STARTEND) != 0) { subs[0].rm_so = startoff; subs[0].rm_eo = strlen(argv[optind]) - endoff; } err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); + fprintf(stderr, "error %s, %zu/%zu `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); exit(status); } - if (!(copts®_NOSUB)) { + if ((copts & REG_NOSUB) == 0) { len = (int)(subs[0].rm_eo - subs[0].rm_so); if (subs[0].rm_so != -1) { if (len != 0) - printf("match `%.*s'\n", len, - argv[optind] + subs[0].rm_so); + printf("match `%.*s'\n", (int)len, + argv[optind] + subs[0].rm_so); else printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); + argv[optind] + subs[0].rm_so); } for (i = 1; i < NS; i++) if (subs[i].rm_so != -1) printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); + (int)(subs[i].rm_eo - subs[i].rm_so), + argv[optind] + subs[i].rm_so); } exit(status); } @@ -126,8 +127,7 @@ char *argv[]; == void regress(FILE *in); */ void -regress(in) -FILE *in; +regress(FILE *in) { char inbuf[1000]; # define MAXF 10 @@ -174,13 +174,13 @@ FILE *in; } ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { + ne != strlen(badpat)+1) { fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", erbuf, SHORT-1, badpat); status = 1; } ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { + if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname) + 1) { fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", erbuf, bpname); status = 1; @@ -191,7 +191,7 @@ FILE *in; fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", erbuf, (long)REG_BADPAT); status = 1; - } else if (ne != strlen(erbuf)+1) { + } else if (ne != strlen(erbuf) + 1) { fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", erbuf, (long)REG_BADPAT); status = 1; @@ -201,28 +201,21 @@ FILE *in; /* - try - try it, and report on problems == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); + - opts: may not match f1 */ void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ +try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts) { regex_t re; # define NSUBS 10 regmatch_t subs[NSUBS]; # define NSHOULD 15 char *should[NSHOULD]; - int nshould; char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - int i; + size_t len; + int err, i, nshould; char *grump; + char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; char f0copy[1000]; char f2copy[1000]; @@ -233,9 +226,8 @@ int opts; /* may not match f1 */ if (err != 0 && (!opt('C', f1) || err != efind(f2))) { /* unexpected error or wrong error */ len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); + fprintf(stderr, "%d: %s error %s, %zu/%zu `%s'\n", + line, type, eprint(err), len, sizeof(erbuf), erbuf); status = 1; } else if (err == 0 && opt('C', f1)) { /* unexpected success */ @@ -264,16 +256,15 @@ int opts; /* may not match f1 */ if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { /* unexpected error or wrong error */ len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); + fprintf(stderr, "%d: %s exec error %s, %zu/%zu `%s'\n", + line, type, eprint(err), len, sizeof(erbuf), erbuf); status = 1; } else if (err != 0) { /* nothing more to check */ } else if (f3 == NULL) { /* unexpected success */ fprintf(stderr, "%d: %s exec should have failed\n", - line, type); + line, type); status = 1; err = 1; /* just on principle */ } else if (opts®_NOSUB) { @@ -300,7 +291,7 @@ int opts; /* may not match f1 */ grump = check(f2, subs[i], should[i]); if (grump != NULL) { fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); + type, i, grump); status = 1; err = 1; } @@ -311,12 +302,11 @@ int opts; /* may not match f1 */ /* - options - pick options out of a regression-test string + - type: 'c' - compile, 'e' - exec == int options(int type, char *s); */ int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; +options(int type, char *s) { char *p; int o = (type == 'c') ? copts : eopts; @@ -371,9 +361,7 @@ char *s; == int opt(int c, char *s); */ int /* predicate */ -opt(c, s) -int c; -char *s; +opt(int c, char *s) { return(strchr(s, c) != NULL); } @@ -383,8 +371,7 @@ char *s; == void fixstr(char *p); */ void -fixstr(p) -char *p; +fixstr(char *p) { if (p == NULL) return; @@ -405,10 +392,7 @@ char *p; == char *check(char *str, regmatch_t sub, char *should); */ char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; +check(char *str, regmatch_t sub, char *should) { int len; int shlen; @@ -442,7 +426,7 @@ char *should; /* check for in range */ if (sub.rm_eo > strlen(str)) { sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); + (long)sub.rm_so, (long)sub.rm_eo); return(grump); } @@ -482,8 +466,7 @@ char *should; == static char *eprint(int err); */ static char * -eprint(err) -int err; +eprint(int err) { static char epbuf[100]; size_t len; @@ -498,8 +481,7 @@ int err; == static int efind(char *name); */ static int -efind(name) -char *name; +efind(char *name) { static char efbuf[100]; size_t n; Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 03:47:56 2015 (r292143) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 03:51:49 2015 (r292144) @@ -6,14 +6,13 @@ __FBSDID("$FreeBSD$"); /* - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); + == int split(char *string, char *fields[], int nfields, char *sep); + - fields: list is not NULL-terminated + - nfields: number of entries available in fields[] + - sep: "" white, "c" single char, "ab" [ab]+ */ int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ +split(char *string, char *fields[], int nfields, char *sep) { char *p = string; char c; /* latest character */ @@ -151,9 +150,7 @@ char *sep; /* "" white, "c" single cha * pgm str sep n splits str by sep n times */ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { char buf[512]; int n; @@ -182,9 +179,8 @@ char *argv[]; exit(0); } -dosplit(string, seps) -char *string; -char *seps; +void +dosplit(char *string, char *seps) { # define NF 5 char *fields[NF]; @@ -194,10 +190,8 @@ char *seps; print(nf, NF, fields); } -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; +void +print(int nf, int nfp, char *fields[]) { int fn; int bound; @@ -277,7 +271,8 @@ struct { NULL, NULL, 0, { NULL }, }; -regress() +void +regress(void) { char buf[512]; int n; From owner-svn-src-all@freebsd.org Sun Dec 13 03:53:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3303AA410D7; Sun, 13 Dec 2015 03:53:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8A121A6E; Sun, 13 Dec 2015 03:53:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3rJk5077305; Sun, 13 Dec 2015 03:53:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3rI6B077302; Sun, 13 Dec 2015 03:53:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130353.tBD3rI6B077302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:53: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: r292145 - stable/9/lib/libc/regex/grot 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 03:53:20 -0000 Author: ngie Date: Sun Dec 13 03:53:18 2015 New Revision: 292145 URL: https://svnweb.freebsd.org/changeset/base/292145 Log: MFstable/10 r292144: MFC r291832,r291833,r291834,r291835,r291836,r291838: r291832: Fix -Wformat warnings by using the correct format qualifiers Sponsored by: EMC / Isilon Storage Division r291833: - Use ANSI C function prototypes/definitions instead of K&R style ones - Add a missing return type for main(..) Sponsored by: EMC / Isilon Storage Division r291834: Add missing headers and sort #includes per style(9) Sponsored by: EMC / Isilon Storage Division r291835: Use ANSI C function prototypes/definitions instead of K&R style ones Sponsored by: EMC / Isilon Storage Division r291836: Use `==` instead of `=` in the function comment above split(..) so mkh -p exposes split(..). Sponsored by: EMC / Isilon Storage Division r291838: Fix -Wformat issues and minor whitespace issues in surrounding areas Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/regex/grot/debug.c stable/9/lib/libc/regex/grot/main.c stable/9/lib/libc/regex/grot/split.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/regex/grot/debug.c ============================================================================== --- stable/9/lib/libc/regex/grot/debug.c Sun Dec 13 03:51:49 2015 (r292144) +++ stable/9/lib/libc/regex/grot/debug.c Sun Dec 13 03:53:18 2015 (r292145) @@ -186,7 +186,7 @@ FILE *d; fprintf(d, ">"); break; default: - fprintf(d, "!%d(%d)!", OP(*s), opnd); + fprintf(d, "!%ld(%ld)!", OP(*s), (long)opnd); break; } if (!done) Modified: stable/9/lib/libc/regex/grot/main.c ============================================================================== --- stable/9/lib/libc/regex/grot/main.c Sun Dec 13 03:51:49 2015 (r292144) +++ stable/9/lib/libc/regex/grot/main.c Sun Dec 13 03:53:18 2015 (r292145) @@ -1,11 +1,13 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include "main.ih" @@ -26,9 +28,8 @@ extern void regprint(); /* - main - do the simple case, hand off to regress() for regression */ -main(argc, argv) -int argc; -char *argv[]; +int +main(int argc, char **argv) { regex_t re; # define NS 10 @@ -80,43 +81,43 @@ char *argv[]; err = regcomp(&re, argv[optind++], copts); if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); + fprintf(stderr, "error %s, %zu/%zu `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); exit(status); } - regprint(&re, stdout); + regprint(&re, stdout); if (optind >= argc) { regfree(&re); exit(status); } - if (eopts®_STARTEND) { + if ((eopts & REG_STARTEND) != 0) { subs[0].rm_so = startoff; subs[0].rm_eo = strlen(argv[optind]) - endoff; } err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); + fprintf(stderr, "error %s, %zu/%zu `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); exit(status); } - if (!(copts®_NOSUB)) { + if ((copts & REG_NOSUB) == 0) { len = (int)(subs[0].rm_eo - subs[0].rm_so); if (subs[0].rm_so != -1) { if (len != 0) - printf("match `%.*s'\n", len, - argv[optind] + subs[0].rm_so); + printf("match `%.*s'\n", (int)len, + argv[optind] + subs[0].rm_so); else printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); + argv[optind] + subs[0].rm_so); } for (i = 1; i < NS; i++) if (subs[i].rm_so != -1) printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); + (int)(subs[i].rm_eo - subs[i].rm_so), + argv[optind] + subs[i].rm_so); } exit(status); } @@ -126,8 +127,7 @@ char *argv[]; == void regress(FILE *in); */ void -regress(in) -FILE *in; +regress(FILE *in) { char inbuf[1000]; # define MAXF 10 @@ -174,13 +174,13 @@ FILE *in; } ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { + ne != strlen(badpat)+1) { fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", erbuf, SHORT-1, badpat); status = 1; } ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { + if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname) + 1) { fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", erbuf, bpname); status = 1; @@ -191,7 +191,7 @@ FILE *in; fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", erbuf, (long)REG_BADPAT); status = 1; - } else if (ne != strlen(erbuf)+1) { + } else if (ne != strlen(erbuf) + 1) { fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", erbuf, (long)REG_BADPAT); status = 1; @@ -201,28 +201,21 @@ FILE *in; /* - try - try it, and report on problems == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); + - opts: may not match f1 */ void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ +try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts) { regex_t re; # define NSUBS 10 regmatch_t subs[NSUBS]; # define NSHOULD 15 char *should[NSHOULD]; - int nshould; char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - int i; + size_t len; + int err, i, nshould; char *grump; + char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; char f0copy[1000]; char f2copy[1000]; @@ -233,9 +226,8 @@ int opts; /* may not match f1 */ if (err != 0 && (!opt('C', f1) || err != efind(f2))) { /* unexpected error or wrong error */ len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); + fprintf(stderr, "%d: %s error %s, %zu/%zu `%s'\n", + line, type, eprint(err), len, sizeof(erbuf), erbuf); status = 1; } else if (err == 0 && opt('C', f1)) { /* unexpected success */ @@ -264,16 +256,15 @@ int opts; /* may not match f1 */ if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { /* unexpected error or wrong error */ len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); + fprintf(stderr, "%d: %s exec error %s, %zu/%zu `%s'\n", + line, type, eprint(err), len, sizeof(erbuf), erbuf); status = 1; } else if (err != 0) { /* nothing more to check */ } else if (f3 == NULL) { /* unexpected success */ fprintf(stderr, "%d: %s exec should have failed\n", - line, type); + line, type); status = 1; err = 1; /* just on principle */ } else if (opts®_NOSUB) { @@ -300,7 +291,7 @@ int opts; /* may not match f1 */ grump = check(f2, subs[i], should[i]); if (grump != NULL) { fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); + type, i, grump); status = 1; err = 1; } @@ -311,12 +302,11 @@ int opts; /* may not match f1 */ /* - options - pick options out of a regression-test string + - type: 'c' - compile, 'e' - exec == int options(int type, char *s); */ int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; +options(int type, char *s) { char *p; int o = (type == 'c') ? copts : eopts; @@ -371,9 +361,7 @@ char *s; == int opt(int c, char *s); */ int /* predicate */ -opt(c, s) -int c; -char *s; +opt(int c, char *s) { return(strchr(s, c) != NULL); } @@ -383,8 +371,7 @@ char *s; == void fixstr(char *p); */ void -fixstr(p) -char *p; +fixstr(char *p) { if (p == NULL) return; @@ -405,10 +392,7 @@ char *p; == char *check(char *str, regmatch_t sub, char *should); */ char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; +check(char *str, regmatch_t sub, char *should) { int len; int shlen; @@ -442,7 +426,7 @@ char *should; /* check for in range */ if (sub.rm_eo > strlen(str)) { sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); + (long)sub.rm_so, (long)sub.rm_eo); return(grump); } @@ -482,8 +466,7 @@ char *should; == static char *eprint(int err); */ static char * -eprint(err) -int err; +eprint(int err) { static char epbuf[100]; size_t len; @@ -498,8 +481,7 @@ int err; == static int efind(char *name); */ static int -efind(name) -char *name; +efind(char *name) { static char efbuf[100]; size_t n; Modified: stable/9/lib/libc/regex/grot/split.c ============================================================================== --- stable/9/lib/libc/regex/grot/split.c Sun Dec 13 03:51:49 2015 (r292144) +++ stable/9/lib/libc/regex/grot/split.c Sun Dec 13 03:53:18 2015 (r292145) @@ -6,14 +6,13 @@ __FBSDID("$FreeBSD$"); /* - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); + == int split(char *string, char *fields[], int nfields, char *sep); + - fields: list is not NULL-terminated + - nfields: number of entries available in fields[] + - sep: "" white, "c" single char, "ab" [ab]+ */ int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ +split(char *string, char *fields[], int nfields, char *sep) { char *p = string; char c; /* latest character */ @@ -151,9 +150,7 @@ char *sep; /* "" white, "c" single cha * pgm str sep n splits str by sep n times */ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { char buf[512]; int n; @@ -182,9 +179,8 @@ char *argv[]; exit(0); } -dosplit(string, seps) -char *string; -char *seps; +void +dosplit(char *string, char *seps) { # define NF 5 char *fields[NF]; @@ -194,10 +190,8 @@ char *seps; print(nf, NF, fields); } -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; +void +print(int nf, int nfp, char *fields[]) { int fn; int bound; @@ -277,7 +271,8 @@ struct { NULL, NULL, 0, { NULL }, }; -regress() +void +regress(void) { char buf[512]; int n; From owner-svn-src-all@freebsd.org Sun Dec 13 04:15:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E36AA421D0; Sun, 13 Dec 2015 04:15:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4099214D9; Sun, 13 Dec 2015 04:15:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4FA1b083522; Sun, 13 Dec 2015 04:15:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4FAQr083521; Sun, 13 Dec 2015 04:15:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512130415.tBD4FAQr083521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 13 Dec 2015 04:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292146 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:15:11 -0000 Author: imp Date: Sun Dec 13 04:15:10 2015 New Revision: 292146 URL: https://svnweb.freebsd.org/changeset/base/292146 Log: Fix typos in comments. Modified: head/sys/sys/module.h Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Sun Dec 13 03:53:18 2015 (r292145) +++ head/sys/sys/module.h Sun Dec 13 04:15:10 2015 (r292146) @@ -99,7 +99,7 @@ struct mod_pnp_match_info const char *bus; /* Name of the bus for this table */ const void *table; /* Pointer to pnp table */ int entry_len; /* Length of each entry in the table (may be */ - /* logner than descr descriebs). */ + /* longer than descr describes). */ int num_entry; /* Number of entries in the table */ }; #ifdef _KERNEL From owner-svn-src-all@freebsd.org Sun Dec 13 04:15:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC29DA421FA; Sun, 13 Dec 2015 04:15:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEDC41503; Sun, 13 Dec 2015 04:15:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4FDeg083568; Sun, 13 Dec 2015 04:15:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4FDBw083567; Sun, 13 Dec 2015 04:15:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512130415.tBD4FDBw083567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 13 Dec 2015 04:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292147 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:15:15 -0000 Author: imp Date: Sun Dec 13 04:15:13 2015 New Revision: 292147 URL: https://svnweb.freebsd.org/changeset/base/292147 Log: Eliminate a typo that crept into a last minute change before commit :( Noticed by: Olivier Cochard-Labbe Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Sun Dec 13 04:15:10 2015 (r292146) +++ head/tools/tools/nanobsd/defaults.sh Sun Dec 13 04:15:13 2015 (r292147) @@ -1024,7 +1024,7 @@ export_var ( ) { # Don't wawnt a subshe set_defaults_and_export ( ) { : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}} : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} - : ${NANO_DISKIMGDIR=:${NANO_OBJ}} + : ${NANO_DISKIMGDIR:=${NANO_OBJ}} NANO_WORLDDIR=${NANO_OBJ}/_.w NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install From owner-svn-src-all@freebsd.org Sun Dec 13 04:20:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 938F0A4254C; Sun, 13 Dec 2015 04:20:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7FB198B; Sun, 13 Dec 2015 04:20:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4Kl4o084107; Sun, 13 Dec 2015 04:20:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4KlUW084106; Sun, 13 Dec 2015 04:20:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130420.tBD4KlUW084106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:20: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: r292148 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:20:48 -0000 Author: ngie Date: Sun Dec 13 04:20:47 2015 New Revision: 292148 URL: https://svnweb.freebsd.org/changeset/base/292148 Log: MFC r291896: Remove unused atf.test.mk variables - ATF_BUILD_CC - ATF_BUILD_CPP - ATF_BUILD_CXX - ATF_SHELL - ATF_PREFIX Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/atf.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/atf.test.mk ============================================================================== --- stable/10/share/mk/atf.test.mk Sun Dec 13 04:15:13 2015 (r292147) +++ stable/10/share/mk/atf.test.mk Sun Dec 13 04:20:47 2015 (r292148) @@ -22,29 +22,6 @@ ATF_TESTS_C?= ATF_TESTS_CXX?= ATF_TESTS_SH?= -# Path to the prefix of the installed ATF tools, if any. -# -# If atf-run and atf-report are installed from ports, we automatically define a -# realregress target below to run the tests using these tools. The tools are -# searched for in the hierarchy specified by this variable. -ATF_PREFIX?= /usr/local - -# C compiler passed to ATF tests that need to build code. -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc -TESTS_ENV+= ATF_BUILD_CC=${ATF_BUILD_CC} - -# C preprocessor passed to ATF tests that need to build code. -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp -TESTS_ENV+= ATF_BUILD_CPP=${ATF_BUILD_CPP} - -# C++ compiler passed to ATF tests that need to build code. -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ -TESTS_ENV+= ATF_BUILD_CXX=${ATF_BUILD_CXX} - -# Shell interpreter used to run atf-sh(1) based tests. -ATF_SHELL?= ${DESTDIR}/bin/sh -TESTS_ENV+= ATF_SHELL=${ATF_SHELL} - .if !empty(ATF_TESTS_C) PROGS+= ${ATF_TESTS_C} _TESTS+= ${ATF_TESTS_C} From owner-svn-src-all@freebsd.org Sun Dec 13 04:22:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DC3CA42782; Sun, 13 Dec 2015 04:22:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7AC11CEF; Sun, 13 Dec 2015 04:22:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4MprU086596; Sun, 13 Dec 2015 04:22:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4MpSm086595; Sun, 13 Dec 2015 04:22:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130422.tBD4MpSm086595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:22: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: r292149 - stable/10/share/man/man7 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:22:52 -0000 Author: ngie Date: Sun Dec 13 04:22:50 2015 New Revision: 292149 URL: https://svnweb.freebsd.org/changeset/base/292149 Log: MFC r291891: Use .Fx instead of explicitly spelling out FreeBSD Fix several warnings reported by igor Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/man/man7/tests.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/tests.7 ============================================================================== --- stable/10/share/man/man7/tests.7 Sun Dec 13 04:20:47 2015 (r292148) +++ stable/10/share/man/man7/tests.7 Sun Dec 13 04:22:50 2015 (r292149) @@ -26,20 +26,22 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 13, 2014 +.Dd December 5, 2015 .Dt TESTS 7 .Os .Sh NAME .Nm tests -.Nd introduction to the FreeBSD Test Suite +.Nd introduction to the +.Fx +Test Suite .Sh DESCRIPTION The .Fx Test Suite provides a collection of automated tests for two major purposes. On one hand, the test suite aids .Em developers -to detect bugs and regressions when they modify the source tree. On the other -hand, it allows +to detect bugs and regressions when they modify the source tree. +On the other hand, it allows .Em end users (and, in particular, system administrators) to verify that fresh installations of the @@ -164,23 +166,26 @@ Test Suite: .Bl -tag -width "allow_sysctl_side_effects" .It allow_devfs_side_effects If defined, enables tests that may destroy and recreate semipermanent device -nodes, like disk devices. Without this variable, tests may still create and -destroy devices nodes that are normally transient, like /dev/tap* and -/dev/pts*, as long as they clean them up afterwards. However, tests that -require this variable have a relaxed cleanup requirement; they must recreate -any devices that they destroyed, but not necessarily with the same devnames. +nodes, like disk devices. +Without this variable, tests may still create and destroy devices nodes that +are normally transient, like /dev/tap* and /dev/pts*, as long as they clean +them up afterwards. +However, tests that require this variable have a relaxed cleanup requirement; +they must recreate any devices that they destroyed, but not necessarily with +the same devnames. .It allow_sysctl_side_effects Enables tests that change globally significant .Xr sysctl 8 -variables. The tests will undo any changes in their cleanup phases. +variables. +The tests will undo any changes in their cleanup phases. .It disks -Must be set to a space delimited list of disk device nodes. Tests that need -destructive access to disks must use these devices. Tests are not required to -preserve any data present on these disks. +Must be set to a space delimited list of disk device nodes. +Tests that need destructive access to disks must use these devices. +Tests are not required to preserve any data present on these disks. .It fibs -Must be set to a space delimited list of FIBs (routing tables). Tests that -need to modify a routing table may use any of these. Tests will cleanup any -new routes that they create. +Must be set to a space delimited list of FIBs (routing tables). +Tests that need to modify a routing table may use any of these. +Tests will cleanup any new routes that they create. .El .Ss What to do if something fails? If there is From owner-svn-src-all@freebsd.org Sun Dec 13 04:24:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0CFFA4285E; Sun, 13 Dec 2015 04:24:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A055C1E53; Sun, 13 Dec 2015 04:24:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4OFDo086802; Sun, 13 Dec 2015 04:24:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4OFJ6086799; Sun, 13 Dec 2015 04:24:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130424.tBD4OFJ6086799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292150 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:24:16 -0000 Author: ngie Date: Sun Dec 13 04:24:15 2015 New Revision: 292150 URL: https://svnweb.freebsd.org/changeset/base/292150 Log: MFC r292013: Use stdint.h instead of inttypes.h as the latter pollutes namespace more Submitted by: bde Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/stdio/open_memstream.c stable/10/lib/libc/stdio/open_wmemstream.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/open_memstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 04:22:50 2015 (r292149) +++ stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 04:24:15 2015 (r292150) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include Modified: stable/10/lib/libc/stdio/open_wmemstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 04:22:50 2015 (r292149) +++ stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 04:24:15 2015 (r292150) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include From owner-svn-src-all@freebsd.org Sun Dec 13 04:25:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20374A42980; Sun, 13 Dec 2015 04:25:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E36F31FEF; Sun, 13 Dec 2015 04:25:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4P0No086943; Sun, 13 Dec 2015 04:25:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4OxvT086933; Sun, 13 Dec 2015 04:24:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130424.tBD4OxvT086933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292151 - stable/9/lib/libc/stdio 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:25:01 -0000 Author: ngie Date: Sun Dec 13 04:24:59 2015 New Revision: 292151 URL: https://svnweb.freebsd.org/changeset/base/292151 Log: MFstable/10 r292150: MFC r292013: Use stdint.h instead of inttypes.h as the latter pollutes namespace more Submitted by: bde Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/stdio/open_memstream.c stable/9/lib/libc/stdio/open_wmemstream.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/open_memstream.c ============================================================================== --- stable/9/lib/libc/stdio/open_memstream.c Sun Dec 13 04:24:15 2015 (r292150) +++ stable/9/lib/libc/stdio/open_memstream.c Sun Dec 13 04:24:59 2015 (r292151) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include Modified: stable/9/lib/libc/stdio/open_wmemstream.c ============================================================================== --- stable/9/lib/libc/stdio/open_wmemstream.c Sun Dec 13 04:24:15 2015 (r292150) +++ stable/9/lib/libc/stdio/open_wmemstream.c Sun Dec 13 04:24:59 2015 (r292151) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include From owner-svn-src-all@freebsd.org Sun Dec 13 04:29:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF51A42BCE; Sun, 13 Dec 2015 04:29:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7534A117B; Sun, 13 Dec 2015 04:29:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4T9g5087295; Sun, 13 Dec 2015 04:29:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4T9nI087292; Sun, 13 Dec 2015 04:29:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130429.tBD4T9nI087292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:29: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: r292152 - stable/10/lib/libc/tests/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 04:29:10 -0000 Author: ngie Date: Sun Dec 13 04:29:09 2015 New Revision: 292152 URL: https://svnweb.freebsd.org/changeset/base/292152 Log: MFC r291980,r291981: r291980: Add missing va_ends for corresponding va_starts to clean up variable arguments initialized in _test_fmt(..) Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division r291981: Delete bogus freeing of uninitialized data Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/tests/stdio/getdelim_test.c stable/10/lib/libc/tests/stdio/printbasic_test.c stable/10/lib/libc/tests/stdio/printfloat_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/getdelim_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/getdelim_test.c Sun Dec 13 04:24:59 2015 (r292151) +++ stable/10/lib/libc/tests/stdio/getdelim_test.c Sun Dec 13 04:29:09 2015 (r292152) @@ -208,7 +208,6 @@ ATF_TC_BODY(empty_NULL_buffer, tc) /* Make sure NULL *linep and zero *linecapp are handled. */ fp = mkfilebuf(); - free(line); line = NULL; linecap = 42; ATF_REQUIRE(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); Modified: stable/10/lib/libc/tests/stdio/printbasic_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/printbasic_test.c Sun Dec 13 04:24:59 2015 (r292151) +++ stable/10/lib/libc/tests/stdio/printbasic_test.c Sun Dec 13 04:29:09 2015 (r292152) @@ -94,6 +94,8 @@ _testfmt(const char *result, const char "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n", wfmt, argstr, ws, wresult); } + va_end(ap); + va_end(ap2); } ATF_TC_WITHOUT_HEAD(int_within_limits); Modified: stable/10/lib/libc/tests/stdio/printfloat_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/printfloat_test.c Sun Dec 13 04:24:59 2015 (r292151) +++ stable/10/lib/libc/tests/stdio/printfloat_test.c Sun Dec 13 04:29:09 2015 (r292152) @@ -86,6 +86,8 @@ _testfmt(const char *result, const char "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n", wfmt, argstr, ws, wresult); } + va_end(ap); + va_end(ap2); } ATF_TC_WITHOUT_HEAD(float_within_limits); From owner-svn-src-all@freebsd.org Sun Dec 13 06:04:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7979AA41456; Sun, 13 Dec 2015 06:04:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 581CD1B60; Sun, 13 Dec 2015 06:04:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iofo67 with SMTP id o67so15176450iof.3; Sat, 12 Dec 2015 22:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Z5KcS+VAVcNjXplZUwmb00HFZKVyJUSfroiD0QjRMpU=; b=xmu8ttV8S7XIfSQOWk9KzMP5C+2W7NFDny7U43VgZANnykCdYYfttQ4Uqaru/owVq5 DBjnHM4jytZsqDWvy0XD2Fp5q1QP1inpkwVRF7jR3NOssB5nsNLYjcf0UzAU9dxp/qqO OesQPdusygEGsDYWnzETma69aOEXppiVx6zD4QFy+p1U51l6NV/Wrq3quihsuUw+A6pj jUWrvUUWo76wLkym5c5zmYLg4FA7ma508/5vYUY/Bvc3fPsB1Ayr4QOa4NxepzyLUuX2 ukq9VsvEcpE3DU4RdxUBCahPpocQTv5adboJBbWuT2iq7RTXZCIdIiNKiWy2O0YFyrbE eBUg== MIME-Version: 1.0 X-Received: by 10.107.11.147 with SMTP id 19mr22714230iol.165.1449986672793; Sat, 12 Dec 2015 22:04:32 -0800 (PST) Received: by 10.36.121.202 with HTTP; Sat, 12 Dec 2015 22:04:32 -0800 (PST) In-Reply-To: <201512112028.tBBKSRtn092966@repo.freebsd.org> References: <201512112028.tBBKSRtn092966@repo.freebsd.org> Date: Sat, 12 Dec 2015 22:04:32 -0800 Message-ID: Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf From: Adrian Chadd To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 06:04:33 -0000 Hm! cc1: warnings being treated as errors /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c: In function 'dump_dwarf': /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479: warning: 'b' may be used uninitialized in this function /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479: note: 'b' was declared here /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758: warning: 'pe' may be used uninitialized in this function /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758: note: 'pe' was declared here .. these both seem like legit. -a From owner-svn-src-all@freebsd.org Sun Dec 13 06:33:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FD92A42B57; Sun, 13 Dec 2015 06:33:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50B661A51; Sun, 13 Dec 2015 06:33:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD6XqOw024959; Sun, 13 Dec 2015 06:33:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD6XqrN024958; Sun, 13 Dec 2015 06:33:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130633.tBD6XqrN024958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 06:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292153 - head/lib/libc/regex/grot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 06:33:53 -0000 Author: ngie Date: Sun Dec 13 06:33:52 2015 New Revision: 292153 URL: https://svnweb.freebsd.org/changeset/base/292153 Log: Add -static to CFLAGS to unbreak the tests by using a libc.a with the xlocale private symbols exposed which aren't exposed publicly via the DSO PR: 191354 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/regex/grot/Makefile Modified: head/lib/libc/regex/grot/Makefile ============================================================================== --- head/lib/libc/regex/grot/Makefile Sun Dec 13 04:29:09 2015 (r292152) +++ head/lib/libc/regex/grot/Makefile Sun Dec 13 06:33:52 2015 (r292153) @@ -8,7 +8,7 @@ PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include .PATH: ${PATHS} -CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) +CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) .for incpath in ${PATHS} CFLAGS+= -I${incpath} .endfor From owner-svn-src-all@freebsd.org Sun Dec 13 06:54:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AFB1A14B91; Sun, 13 Dec 2015 06:54:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18B1213A6; Sun, 13 Dec 2015 06:54:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD6ss5V030681; Sun, 13 Dec 2015 06:54:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD6srOW030677; Sun, 13 Dec 2015 06:54:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130654.tBD6srOW030677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 06:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292154 - in stable/9: include lib/libc/stdio 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 06:54:55 -0000 Author: ngie Date: Sun Dec 13 06:54:53 2015 New Revision: 292154 URL: https://svnweb.freebsd.org/changeset/base/292154 Log: MFstable/10 r291602: MFC r285140: r285140 (by oshogbo): Add fdclose(3) function. This function is equivalent to fclose(3) function except that it does not close the underlying file descriptor. fdclose(3) is step forward to make FILE structure private. Reviewed by: wblock, jilles, jhb, pjd Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D2697 Modified: stable/9/include/stdio.h stable/9/lib/libc/stdio/Symbol.map stable/9/lib/libc/stdio/fclose.3 stable/9/lib/libc/stdio/fclose.c Directory Properties: stable/9/ (props changed) stable/9/include/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/stdio.h ============================================================================== --- stable/9/include/stdio.h Sun Dec 13 06:33:52 2015 (r292153) +++ stable/9/include/stdio.h Sun Dec 13 06:54:53 2015 (r292154) @@ -396,6 +396,7 @@ int (dprintf)(int, const char * __restr int asprintf(char **, const char *, ...) __printflike(2, 3); char *ctermid_r(char *); void fcloseall(void); +int fdclose(FILE *, int *); char *fgetln(FILE *, size_t *); const char *fmtcheck(const char *, const char *) __format_arg(2); int fpurge(FILE *); Modified: stable/9/lib/libc/stdio/Symbol.map ============================================================================== --- stable/9/lib/libc/stdio/Symbol.map Sun Dec 13 06:33:52 2015 (r292153) +++ stable/9/lib/libc/stdio/Symbol.map Sun Dec 13 06:54:53 2015 (r292154) @@ -160,6 +160,10 @@ FBSD_1.3 { open_wmemstream; }; +FBSD_1.4 { + fdclose; +}; + FBSDprivate_1.0 { _flockfile; _flockfile_debug_stub; Modified: stable/9/lib/libc/stdio/fclose.3 ============================================================================== --- stable/9/lib/libc/stdio/fclose.3 Sun Dec 13 06:33:52 2015 (r292153) +++ stable/9/lib/libc/stdio/fclose.3 Sun Dec 13 06:54:53 2015 (r292154) @@ -1,5 +1,6 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 1990, 1991, 1993 The Regents of the University of California. +.\" Copyright (c) 2015 Mariusz Zaborski +.\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek and the American National Standards Committee X3, @@ -32,11 +33,12 @@ .\" @(#)fclose.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 22, 2006 +.Dd July 4, 2015 .Dt FCLOSE 3 .Os .Sh NAME .Nm fclose , +.Nm fdclose , .Nm fcloseall .Nd close a stream .Sh LIBRARY @@ -45,6 +47,8 @@ .In stdio.h .Ft int .Fn fclose "FILE *stream" +.Ft int +.Fn fdclose "FILE *stream" "int *fdp" .Ft void .Fn fcloseall void .Sh DESCRIPTION @@ -59,36 +63,77 @@ first, using .Xr fflush 3 . .Pp The +.Fn fdclose +function is equivalent to +.Fn fclose +except that it does not close the underlying file descriptor. +If +.Fa fdp +is not +.Dv NULL , +the file descriptor will be written to it. +If the +.Fa fdp +argument will be different then NULL the file descriptor will be returned in it, +If the stream does not have an associated file descriptor, +.Fa fdp +will be set to -1. +This type of stream is created with functions such as +.Xr fmemopen 3 , +.Xr funopen 3 , +or +.Xr open_memstream 3 . +.Pp +The .Fn fcloseall function calls .Fn fclose on all open streams. .Sh RETURN VALUES -Upon successful completion 0 is returned. +.Fn fcloseall +does not return a value. +.Pp +Upon successful completion the +.Fn fclose +and +.Fn fdclose +functions return 0. Otherwise, .Dv EOF is returned and the global variable .Va errno is set to indicate the error. -In either case no further access to the stream is possible. .Sh ERRORS +.Fn fdclose +fails if: +.Bl -tag -width Er +.It Bq Er EOPNOTSUPP +The stream does not have an associated file descriptor. +.El +.Pp The .Fn fclose -function -may also fail and set +and +.Fn fdclose +functions may also fail and set .Va errno -for any of the errors specified for the routines -.Xr close 2 -or +for any of the errors specified for .Xr fflush 3 . +.Pp +The +.Fn fclose +function may also fail and set errno for any of the errors specified for +.Xr close 2 . .Sh NOTES The .Fn fclose -function -does not handle NULL arguments; they will result in a segmentation -violation. -This is intentional - it makes it easier to make sure programs written -under +and +.Fn fdclose +functions do not handle NULL arguments in the +.Fa stream +variable; this will result in a segmentation violation. +This is intentional. +It makes it easier to make sure programs written under .Fx are bug free. This behaviour is an implementation detail, and programs should not @@ -104,8 +149,13 @@ The function conforms to .St -isoC . -.Pp +.Sh HISTORY The .Fn fcloseall function first appeared in .Fx 7.0 . +.Pp +The +.Fn fdclose +function first appeared in +.Fx 11.0 . Modified: stable/9/lib/libc/stdio/fclose.c ============================================================================== --- stable/9/lib/libc/stdio/fclose.c Sun Dec 13 06:33:52 2015 (r292153) +++ stable/9/lib/libc/stdio/fclose.c Sun Dec 13 06:54:53 2015 (r292154) @@ -1,6 +1,7 @@ /*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 1990, 1993 The Regents of the University of California. + * Copyright (c) 2013 Mariusz Zaborski + * All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include +#include #include #include #include "un-namespace.h" @@ -45,19 +47,17 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "local.h" -int -fclose(FILE *fp) +static int +cleanfile(FILE *fp, bool c) { int r; - if (fp->_flags == 0) { /* not open! */ - errno = EBADF; - return (EOF); - } - FLOCKFILE(fp); r = fp->_flags & __SWR ? __sflush(fp) : 0; - if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0) - r = EOF; + if (c) { + if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0) + r = EOF; + } + if (fp->_flags & __SMBF) free((char *)fp->_bf._base); if (HASUB(fp)) @@ -80,6 +80,59 @@ fclose(FILE *fp) STDIO_THREAD_LOCK(); fp->_flags = 0; /* Release this FILE for reuse. */ STDIO_THREAD_UNLOCK(); + + return (r); +} + +int +fdclose(FILE *fp, int *fdp) +{ + int r, err; + + if (fdp != NULL) + *fdp = -1; + + if (fp->_flags == 0) { /* not open! */ + errno = EBADF; + return (EOF); + } + + FLOCKFILE(fp); + r = 0; + if (fp->_close != __sclose) { + r = EOF; + errno = EOPNOTSUPP; + } else if (fp->_file < 0) { + r = EOF; + errno = EBADF; + } + if (r == EOF) { + err = errno; + (void)cleanfile(fp, true); + errno = err; + } else { + if (fdp != NULL) + *fdp = fp->_file; + r = cleanfile(fp, false); + } FUNLOCKFILE(fp); + + return (r); +} + +int +fclose(FILE *fp) +{ + int r; + + if (fp->_flags == 0) { /* not open! */ + errno = EBADF; + return (EOF); + } + + FLOCKFILE(fp); + r = cleanfile(fp, true); + FUNLOCKFILE(fp); + return (r); } From owner-svn-src-all@freebsd.org Sun Dec 13 07:39:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D100CA42F6D; Sun, 13 Dec 2015 07:39:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E6E018BE; Sun, 13 Dec 2015 07:39:50 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD7dnrZ042293; Sun, 13 Dec 2015 07:39:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD7dnVm042288; Sun, 13 Dec 2015 07:39:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512130739.tBD7dnVm042288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 13 Dec 2015 07:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292155 - in head/sys: net netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 07:39:51 -0000 Author: melifaro Date: Sun Dec 13 07:39:49 2015 New Revision: 292155 URL: https://svnweb.freebsd.org/changeset/base/292155 Log: Remove LLE read lock from IPv6 fast path. LLE structure is mostly unchanged during its lifecycle: there are only 2 things relevant for fast path lookup code: 1) link-level address change. Since r286722, these updates are performed under AFDATA WLOCK. 2) Some sort of feedback indicating that this particular entry is used so we send NS to perform reachability verification instead of expiring entry. The only signal that is needed from fast path is something like binary yes/no. The latter is solved by the following changes: Special r_skip_req (introduced in D3688) value is used for fast path feedback. It is read lockless by fast path, but updated under req_mutex mutex. If this field is non-zero, then fast path will acquire lock and set it back to 0. After transitioning to STALE state, callout timer is armed to run each V_nd6_delay seconds to make sure that if packet was transmitted at the start of given interval, we would be able to switch to PROBE state in V_nd6_delay seconds as user expects. (in STALE state) timer is rescheduled until original V_nd6_gctimer expires keeping lle in STALE state (remaining timer value stored in lle_remtime). (in STALE state) timer is rescheduled if packet was transmitted less that V_nd6_delay seconds ago to make sure we transition to PROBE state exactly after V_n6_delay seconds. As a result, all packets towards lle in REACHABLE/STALE/PROBE states are handled by fast path without acquiring lle read lock. Differential Revision: https://reviews.freebsd.org/D3780 Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sun Dec 13 06:54:53 2015 (r292154) +++ head/sys/net/if_llatbl.c Sun Dec 13 07:39:49 2015 (r292155) @@ -288,6 +288,47 @@ lltable_set_entry_addr(struct ifnet *ifp } /* + * Tries to update @lle link-level address. + * Since update requires AFDATA WLOCK, function + * drops @lle lock, acquires AFDATA lock and then acquires + * @lle lock to maintain lock order. + * + * Returns 1 on success. + */ +int +lltable_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, + const char *lladdr) +{ + + /* Perform real LLE update */ + /* use afdata WLOCK to update fields */ + LLE_WLOCK_ASSERT(lle); + LLE_ADDREF(lle); + LLE_WUNLOCK(lle); + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(lle); + + /* + * Since we droppped LLE lock, other thread might have deleted + * this lle. Check and return + */ + if ((lle->la_flags & LLE_DELETED) != 0) { + IF_AFDATA_WUNLOCK(ifp); + LLE_FREE_LOCKED(lle); + return (0); + } + + /* Update data */ + lltable_set_entry_addr(ifp, lle, lladdr); + + IF_AFDATA_WUNLOCK(ifp); + + LLE_REMREF(lle); + + return (1); +} + +/* * * Performes generic cleanup routines and frees lle. * Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Sun Dec 13 06:54:53 2015 (r292154) +++ head/sys/net/if_llatbl.h Sun Dec 13 07:39:49 2015 (r292155) @@ -79,6 +79,8 @@ struct llentry { int16_t ln_state; /* IPv6 has ND6_LLINFO_NOSTATE == -2 */ uint16_t ln_router; time_t ln_ntick; + time_t lle_remtime; /* Real time remaining */ + time_t lle_hittime; /* Time when r_skip_req was unset */ int lle_refcnt; LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */ @@ -222,6 +224,8 @@ struct llentry *llentry_alloc(struct if size_t lltable_drop_entry_queue(struct llentry *); void lltable_set_entry_addr(struct ifnet *ifp, struct llentry *lle, const char *lladdr); +int lltable_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, + const char *lladdr); struct llentry *lltable_alloc_entry(struct lltable *llt, u_int flags, const struct sockaddr *l4addr); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Dec 13 06:54:53 2015 (r292154) +++ head/sys/netinet6/in6.c Sun Dec 13 07:39:49 2015 (r292155) @@ -2064,6 +2064,7 @@ in6_lltable_destroy_lle(struct llentry * LLE_WUNLOCK(lle); LLE_LOCK_DESTROY(lle); + LLE_REQ_DESTROY(lle); free(lle, M_LLTABLE); } @@ -2080,6 +2081,7 @@ in6_lltable_new(const struct in6_addr *a lle->base.lle_refcnt = 1; lle->base.lle_free = in6_lltable_destroy_lle; LLE_LOCK_INIT(&lle->base); + LLE_REQ_INIT(&lle->base); callout_init(&lle->base.lle_timer, 1); return (&lle->base); @@ -2288,6 +2290,13 @@ in6_lltable_lookup(struct lltable *llt, if (lle == NULL) return (NULL); + KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != + (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", + flags)); + + if (flags & LLE_UNLOCKED) + return (lle); + if (flags & LLE_EXCLUSIVE) LLE_WLOCK(lle); else @@ -2350,8 +2359,8 @@ in6_lltable_dump_entry(struct lltable *l sdl->sdl_index = ifp->if_index; sdl->sdl_type = ifp->if_type; bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); - ndpc.rtm.rtm_rmx.rmx_expire = - lle->la_flags & LLE_STATIC ? 0 : lle->la_expire; + ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + + lle->lle_remtime / hz; ndpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); if (lle->la_flags & LLE_STATIC) ndpc.rtm.rtm_flags |= RTF_STATIC; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Dec 13 06:54:53 2015 (r292154) +++ head/sys/netinet6/nd6.c Sun Dec 13 07:39:49 2015 (r292155) @@ -542,6 +542,107 @@ nd6_llinfo_get_holdsrc(struct llentry *l } /* + * Checks if we need to switch from STALE state. + * + * RFC 4861 requires switching from STALE to DELAY state + * on first packet matching entry, waiting V_nd6_delay and + * transition to PROBE state (if upper layer confirmation was + * not received). + * + * This code performs a bit differently: + * On packet hit we don't change state (but desired state + * can be guessed by control plane). However, after V_nd6_delay + * seconds code will transition to PROBE state (so DELAY state + * is kinda skipped in most situations). + * + * Typically, V_nd6_gctimer is bigger than V_nd6_delay, so + * we perform the following upon entering STALE state: + * + * 1) Arm timer to run each V_nd6_delay seconds to make sure that + * if packet was transmitted at the start of given interval, we + * would be able to switch to PROBE state in V_nd6_delay seconds + * as user expects. + * + * 2) Reschedule timer until original V_nd6_gctimer expires keeping + * lle in STALE state (remaining timer value stored in lle_remtime). + * + * 3) Reschedule timer if packet was transmitted less that V_nd6_delay + * seconds ago. + * + * Returns non-zero value if the entry is still STALE (storing + * the next timer interval in @pdelay). + * + * Returns zero value if original timer expired or we need to switch to + * PROBE (store that in @do_switch variable). + */ +static int +nd6_is_stale(struct llentry *lle, long *pdelay, int *do_switch) +{ + int nd_delay, nd_gctimer, r_skip_req; + time_t lle_hittime; + long delay; + + *do_switch = 0; + nd_gctimer = V_nd6_gctimer; + nd_delay = V_nd6_delay; + + LLE_REQ_LOCK(lle); + r_skip_req = lle->r_skip_req; + lle_hittime = lle->lle_hittime; + LLE_REQ_UNLOCK(lle); + + if (r_skip_req > 0) { + + /* + * Nonzero r_skip_req value was set upon entering + * STALE state. Since value was not changed, no + * packets were passed using this lle. Ask for + * timer reschedule and keep STALE state. + */ + delay = (long)(MIN(nd_gctimer, nd_delay)); + delay *= hz; + if (lle->lle_remtime > delay) + lle->lle_remtime -= delay; + else { + delay = lle->lle_remtime; + lle->lle_remtime = 0; + } + + if (delay == 0) { + + /* + * The original ng6_gctime timeout ended, + * no more rescheduling. + */ + return (0); + } + + *pdelay = delay; + return (1); + } + + /* + * Packet received. Verify timestamp + */ + delay = (long)(time_uptime - lle_hittime); + if (delay < nd_delay) { + + /* + * V_nd6_delay still not passed since the first + * hit in STALE state. + * Reshedule timer and return. + */ + *pdelay = (long)(nd_delay - delay) * hz; + return (1); + } + + /* Request switching to probe */ + *do_switch = 1; + return (0); +} + + +/* * Switch @lle state to new state optionally arming timers. * * Set noinline to be dtrace-friendly @@ -550,9 +651,11 @@ __noinline void nd6_llinfo_setstate(struct llentry *lle, int newstate) { struct ifnet *ifp; - long delay; + int nd_gctimer, nd_delay; + long delay, remtime; delay = 0; + remtime = 0; switch (newstate) { case ND6_LLINFO_INCOMPLETE: @@ -566,7 +669,19 @@ nd6_llinfo_setstate(struct llentry *lle, } break; case ND6_LLINFO_STALE: - delay = (long)V_nd6_gctimer * hz; + + /* + * Notify fast path that we want to know if any packet + * is transmitted by setting r_skip_req. + */ + LLE_REQ_LOCK(lle); + lle->r_skip_req = 1; + LLE_REQ_UNLOCK(lle); + nd_delay = V_nd6_delay; + nd_gctimer = V_nd6_gctimer; + + delay = (long)(MIN(nd_gctimer, nd_delay)) * hz; + remtime = (long)nd_gctimer * hz - delay; break; case ND6_LLINFO_DELAY: lle->la_asked = 0; @@ -577,6 +692,7 @@ nd6_llinfo_setstate(struct llentry *lle, if (delay > 0) nd6_llinfo_settimer_locked(lle, delay); + lle->lle_remtime = remtime; lle->ln_state = newstate; } @@ -592,7 +708,8 @@ nd6_llinfo_timer(void *arg) struct in6_addr *dst, *pdst, *psrc, src; struct ifnet *ifp; struct nd_ifinfo *ndi = NULL; - int send_ns; + int do_switch, send_ns; + long delay; KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; @@ -680,13 +797,35 @@ nd6_llinfo_timer(void *arg) break; case ND6_LLINFO_STALE: - /* Garbage Collection(RFC 2461 5.3) */ - if (!ND6_LLINFO_PERMANENT(ln)) { - EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); - nd6_free(ln, 1); - ln = NULL; + if (nd6_is_stale(ln, &delay, &do_switch) != 0) { + + /* + * No packet has used this entry and GC timeout + * has not been passed. Reshedule timer and + * return. + */ + nd6_llinfo_settimer_locked(ln, delay); + break; } - break; + + if (do_switch == 0) { + + /* + * GC timer has ended and entry hasn't been used. + * Run Garbage collector (RFC 4861, 5.3) + */ + if (!ND6_LLINFO_PERMANENT(ln)) { + EVENTHANDLER_INVOKE(lle_event, ln, + LLENTRY_EXPIRED); + nd6_free(ln, 1); + ln = NULL; + } + break; + } + + /* Entry has been used AND delay timer has ended. */ + + /* FALLTHROUGH */ case ND6_LLINFO_DELAY: if (ndi && (ndi->flags & ND6_IFF_PERFORMNUD) != 0) { @@ -1796,7 +1935,11 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * Record source link-layer address * XXX is it dependent to ifp->if_type? */ - lltable_set_entry_addr(ifp, ln, lladdr); + if (lltable_try_set_entry_addr(ifp, ln, lladdr) == 0) { + /* Entry was deleted */ + return; + } + nd6_llinfo_setstate(ln, ND6_LLINFO_STALE); EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); @@ -1996,31 +2139,25 @@ nd6_resolve(struct ifnet *ifp, int is_gw } IF_AFDATA_RLOCK(ifp); - ln = nd6_lookup(&dst6->sin6_addr, 0, ifp); - IF_AFDATA_RUNLOCK(ifp); - - /* - * Perform fast path for the following cases: - * 1) lle state is REACHABLE - * 2) lle state is DELAY (NS message sent) - * - * Every other case involves lle modification, so we handle - * them separately. - */ - if (ln == NULL || (ln->ln_state != ND6_LLINFO_REACHABLE && - ln->ln_state != ND6_LLINFO_DELAY)) { - /* Fall back to slow processing path */ - if (ln != NULL) - LLE_RUNLOCK(ln); - return (nd6_resolve_slow(ifp, m, dst6, desten, pflags)); + ln = nd6_lookup(&dst6->sin6_addr, LLE_UNLOCKED, ifp); + if (ln != NULL && (ln->r_flags & RLLE_VALID) != 0) { + /* Entry found, let's copy lle info */ + bcopy(&ln->ll_addr, desten, ifp->if_addrlen); + if (pflags != NULL) + *pflags = LLE_VALID | (ln->r_flags & RLLE_IFADDR); + /* Check if we have feedback request from nd6 timer */ + if (ln->r_skip_req != 0) { + LLE_REQ_LOCK(ln); + ln->r_skip_req = 0; /* Notify that entry was used */ + ln->lle_hittime = time_uptime; + LLE_REQ_UNLOCK(ln); + } + IF_AFDATA_RUNLOCK(ifp); + return (0); } + IF_AFDATA_RUNLOCK(ifp); - - bcopy(&ln->ll_addr, desten, ifp->if_addrlen); - if (pflags != NULL) - *pflags = ln->la_flags; - LLE_RUNLOCK(ln); - return (0); + return (nd6_resolve_slow(ifp, m, dst6, desten, pflags)); } Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Dec 13 06:54:53 2015 (r292154) +++ head/sys/netinet6/nd6_nbr.c Sun Dec 13 07:39:49 2015 (r292155) @@ -765,7 +765,10 @@ nd6_na_input(struct mbuf *m, int off, in /* * Record link-layer address, and update the state. */ - lltable_set_entry_addr(ifp, ln, lladdr); + if (lltable_try_set_entry_addr(ifp, ln, lladdr) == 0) { + ln = NULL; + goto freeit; + } EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); if (is_solicited) nd6_llinfo_setstate(ln, ND6_LLINFO_REACHABLE); @@ -831,7 +834,12 @@ nd6_na_input(struct mbuf *m, int off, in * Update link-local address, if any. */ if (lladdr != NULL) { - lltable_set_entry_addr(ifp, ln, lladdr); + int ret; + ret = lltable_try_set_entry_addr(ifp, ln,lladdr); + if (ret == 0) { + ln = NULL; + goto freeit; + } EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); } From owner-svn-src-all@freebsd.org Sun Dec 13 08:17:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5859EA41E5E; Sun, 13 Dec 2015 08:17:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 185D91257; Sun, 13 Dec 2015 08:17:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD8Hoaf053773; Sun, 13 Dec 2015 08:17:50 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD8HoRS053771; Sun, 13 Dec 2015 08:17:50 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201512130817.tBD8HoRS053771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 13 Dec 2015 08:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292156 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 08:17:51 -0000 Author: mmel Date: Sun Dec 13 08:17:49 2015 New Revision: 292156 URL: https://svnweb.freebsd.org/changeset/base/292156 Log: OFW: Add helper functions for parsing xref based lists. By using this functions, we can parse a list of tuples, each of them holds xref and variable number of values. This kind of list is used in DT for clocks, gpios, resets ... Discussed with: ian, nwhitehorn Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D4316 Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sun Dec 13 07:39:49 2015 (r292155) +++ head/sys/dev/ofw/ofw_bus_subr.c Sun Dec 13 08:17:49 2015 (r292156) @@ -607,3 +607,134 @@ ofw_bus_find_child_device_by_phandle(dev return (retval); } + +/* + * Parse property that contain list of xrefs and values + * (like standard "clocks" and "resets" properties) + * Input arguments: + * node - consumers device node + * list_name - name of parsed list - "clocks" + * cells_name - name of size property - "#clock-cells" + * Output arguments: + * producer - handle of producer + * ncells - number of cells in result + * cells - array of decoded cells + */ +int +ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, + const char *cells_name, int idx, phandle_t *producer, int *ncells, + pcell_t **cells) +{ + phandle_t pnode; + phandle_t *elems; + uint32_t pcells; + int rv, i, j, nelems, cnt; + + elems = NULL; + nelems = OF_getencprop_alloc(node, list_name, sizeof(*elems), + (void **)&elems); + if (nelems <= 0) + return (ENOENT); + rv = ENOENT; + for (i = 0, cnt = 0; i < nelems; i += pcells, cnt++) { + pnode = elems[i++]; + if (OF_getencprop(OF_node_from_xref(pnode), + cells_name, &pcells, sizeof(pcells)) == -1) { + printf("Missing %s property\n", cells_name); + rv = ENOENT; + break; + } + + if ((i + pcells) > nelems) { + printf("Invalid %s property value <%d>\n", cells_name, + pcells); + rv = ERANGE; + break; + } + if (cnt == idx) { + *cells= malloc(pcells * sizeof(**cells), M_OFWPROP, + M_WAITOK); + *producer = pnode; + *ncells = pcells; + for (j = 0; j < pcells; j++) + (*cells)[j] = elems[i + j]; + rv = 0; + break; + } + } + if (elems != NULL) + free(elems, M_OFWPROP); + return (rv); +} + +/* + * Find index of string in string list property (case sensitive). + */ +int +ofw_bus_find_string_index(phandle_t node, const char *list_name, + const char *name, int *idx) +{ + char *elems; + int rv, i, cnt, nelems; + + elems = NULL; + nelems = OF_getprop_alloc(node, list_name, 1, (void **)&elems); + if (nelems <= 0) + return (ENOENT); + + rv = ENOENT; + for (i = 0, cnt = 0; i < nelems; cnt++) { + if (strcmp(elems + i, name) == 0) { + *idx = cnt; + rv = 0; + break; + } + i += strlen(elems + i) + 1; + } + + if (elems != NULL) + free(elems, M_OFWPROP); + return (rv); +} + +/* + * Create zero terminated array of strings from string list property. + */ +int +ofw_bus_string_list_to_array(phandle_t node, const char *list_name, + const char ***array) +{ + char *elems, *tptr; + int i, cnt, nelems, len; + + elems = NULL; + nelems = OF_getprop_alloc(node, list_name, 1, (void **)&elems); + if (nelems <= 0) + return (nelems); + + /* Count number of strings. */ + for (i = 0, cnt = 0; i < nelems; cnt++) + i += strlen(elems + i) + 1; + + /* Allocate space for arrays and all strings. */ + *array = malloc((cnt + 1) * sizeof(char *) + nelems, M_OFWPROP, + M_WAITOK); + + /* Get address of first string. */ + tptr = (char *)(*array + cnt); + + /* Copy strings. */ + memcpy(tptr, elems, nelems); + free(elems, M_OFWPROP); + + /* Fill string pointers. */ + for (i = 0, cnt = 0; i < nelems; cnt++) { + len = strlen(tptr + i) + 1; + *array[cnt] = tptr; + i += len; + tptr += len; + } + *array[cnt] = 0; + + return (cnt); +} Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sun Dec 13 07:39:49 2015 (r292155) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Dec 13 08:17:49 2015 (r292156) @@ -110,4 +110,13 @@ phandle_t ofw_bus_find_child(phandle_t, /* Helper routine to find a device_t child matchig a given phandle_t */ device_t ofw_bus_find_child_device_by_phandle(device_t bus, phandle_t node); +/* Helper routines for parsing lists */ +int ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name, + const char *cells_name, int idx, phandle_t *producer, int *ncells, + pcell_t **cells); +int ofw_bus_find_string_index(phandle_t node, const char *list_name, + const char *name, int *idx); +int ofw_bus_string_list_to_array(phandle_t node, const char *list_name, + const char ***array); + #endif /* !_DEV_OFW_OFW_BUS_SUBR_H_ */ From owner-svn-src-all@freebsd.org Sun Dec 13 08:23:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12AF0A3B3FE; Sun, 13 Dec 2015 08:23:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D54171868; Sun, 13 Dec 2015 08:23:46 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD8NjNa056621; Sun, 13 Dec 2015 08:23:45 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD8NjgY056620; Sun, 13 Dec 2015 08:23:45 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201512130823.tBD8NjgY056620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 13 Dec 2015 08:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292157 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 08:23:47 -0000 Author: mmel Date: Sun Dec 13 08:23:45 2015 New Revision: 292157 URL: https://svnweb.freebsd.org/changeset/base/292157 Log: OFW_IICBUS: Register ofw_iicbus node. The iicbus can be referenced from other nodes in DT. Approved by: kib (mentor) Modified: head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Sun Dec 13 08:17:49 2015 (r292156) +++ head/sys/dev/ofw/ofw_iicbus.c Sun Dec 13 08:23:45 2015 (r292157) @@ -190,6 +190,8 @@ ofw_iicbus_attach(device_t dev) device_set_ivars(childdev, dinfo); } + /* Register bus */ + OF_device_register_xref(OF_xref_from_node(node), dev); return (bus_generic_attach(dev)); } From owner-svn-src-all@freebsd.org Sun Dec 13 08:27:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 503E0A3B73B; Sun, 13 Dec 2015 08:27:15 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA261B02; Sun, 13 Dec 2015 08:27:15 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD8REGa056774; Sun, 13 Dec 2015 08:27:14 GMT (envelope-from kaiw@FreeBSD.org) Received: (from kaiw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD8REHV056773; Sun, 13 Dec 2015 08:27:14 GMT (envelope-from kaiw@FreeBSD.org) Message-Id: <201512130827.tBD8REHV056773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaiw set sender to kaiw@FreeBSD.org using -f From: Kai Wang Date: Sun, 13 Dec 2015 08:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292158 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 08:27:15 -0000 Author: kaiw Date: Sun Dec 13 08:27:14 2015 New Revision: 292158 URL: https://svnweb.freebsd.org/changeset/base/292158 Log: Fixed uninitialized variable warnings. Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Sun Dec 13 08:23:45 2015 (r292157) +++ head/contrib/elftoolchain/readelf/readelf.c Sun Dec 13 08:27:14 2015 (r292158) @@ -4814,6 +4814,7 @@ dump_dwarf_line(struct readelf *re) } endoff = offset + length; + pe = (uint8_t *) d->d_buf + endoff; version = re->dw_read(d, &offset, 2); hdrlen = re->dw_read(d, &offset, dwarf_size); minlen = re->dw_read(d, &offset, 1); @@ -4879,7 +4880,6 @@ dump_dwarf_line(struct readelf *re) #define ADDRESS(x) ((((x) - opbase) / lrange) * minlen) p++; - pe = (uint8_t *) d->d_buf + endoff; printf("\n"); printf(" Line Number Statements:\n"); @@ -7476,7 +7476,7 @@ static int64_t _decode_sleb128(uint8_t **dp, uint8_t *dpe) { int64_t ret = 0; - uint8_t b; + uint8_t b = 0; int shift = 0; uint8_t *src = *dp; From owner-svn-src-all@freebsd.org Sun Dec 13 08:43:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6705EA4239F; Sun, 13 Dec 2015 08:43:48 +0000 (UTC) (envelope-from kaiw27@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 292EA155B; Sun, 13 Dec 2015 08:43:48 +0000 (UTC) (envelope-from kaiw27@gmail.com) Received: by qkfb125 with SMTP id b125so97271520qkf.2; Sun, 13 Dec 2015 00:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zTRde+FMfqAjM59cA29LxRuHUT80lcJTKHc3zqoBgOs=; b=NQ8B/Jr9q8PZQv3qzl+OFEdmwXke0k9/J4WUHuj/50kZMqPlWuBsYcav41eJz9AznP 7Ct+uVCPrTEp0khZIoFWT84VHg+ttROtRdiXPWQ9g/u8a3GAdnvpojLpyHHAulIIEX93 pw1NN3apK68odlw2Y9bEieCLdxOtNpDHbfS7N8WBalf6KCcpyiKoSBjGSglkeHA+TmBq VMpqnOYCBdYaPPnV6HRgGJphC4ZFy0roAEk/YvSajj8Ce8upu65lU7oTaMaX69hhupOJ EQiVrAV2lCjMrRn4LQ2eWCFo4g6minPSv2EmqlxCpMKx3JccrnYyl6p7xBlJMAAysJM9 Swyw== MIME-Version: 1.0 X-Received: by 10.55.203.20 with SMTP id d20mr35833544qkj.57.1449996227267; Sun, 13 Dec 2015 00:43:47 -0800 (PST) Received: by 10.55.21.95 with HTTP; Sun, 13 Dec 2015 00:43:47 -0800 (PST) In-Reply-To: References: <201512112028.tBBKSRtn092966@repo.freebsd.org> Date: Sun, 13 Dec 2015 09:43:47 +0100 Message-ID: Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf From: Kai Wang To: Adrian Chadd Cc: Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 08:43:48 -0000 2015-12-13 7:04 GMT+01:00 Adrian Chadd : > Hm! > > cc1: warnings being treated as errors > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c: > In function 'dump_dwarf': > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479: > warning: 'b' may be used uninitialized in this function > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479: > note: 'b' was declared here > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758: > warning: 'pe' may be used uninitialized in this function > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758: > note: 'pe' was declared here > > .. these both seem like legit. > > Hi, Sorry about the breakage. Should be fixed by r292158. Somehow clang didn't catch this. Had to use gcc to see this warning. Thanks, Kai From owner-svn-src-all@freebsd.org Sun Dec 13 09:05:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1ADA416B4; Sun, 13 Dec 2015 09:05:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5810B1367; Sun, 13 Dec 2015 09:05:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD95tih068514; Sun, 13 Dec 2015 09:05:55 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD95tqO068513; Sun, 13 Dec 2015 09:05:55 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201512130905.tBD95tqO068513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 13 Dec 2015 09:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292159 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 09:05:56 -0000 Author: mmel Date: Sun Dec 13 09:05:55 2015 New Revision: 292159 URL: https://svnweb.freebsd.org/changeset/base/292159 Log: SIMPLEBUS: Don't panic if child device doesn't have devinfo set. Strictly speaking, missing devinfo is error which can be caused by instantiating child using device_add_child() instead of BUS_ADD_CHILD(). However, we can tolerate it. Approved by: kib (mentor) Modified: head/sys/dev/fdt/simplebus.c Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Sun Dec 13 08:27:14 2015 (r292158) +++ head/sys/dev/fdt/simplebus.c Sun Dec 13 09:05:55 2015 (r292159) @@ -304,6 +304,8 @@ simplebus_get_devinfo(device_t bus __unu struct simplebus_devinfo *ndi; ndi = device_get_ivars(child); + if (ndi == NULL) + return (NULL); return (&ndi->obdinfo); } @@ -313,6 +315,8 @@ simplebus_get_resource_list(device_t bus struct simplebus_devinfo *ndi; ndi = device_get_ivars(child); + if (ndi == NULL) + return (NULL); return (&ndi->rl); } @@ -380,6 +384,8 @@ simplebus_print_res(struct simplebus_dev { int rv; + if (di == NULL) + return (0); rv = 0; rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx"); rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld"); From owner-svn-src-all@freebsd.org Sun Dec 13 09:13:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A00AFA41BFD; Sun, 13 Dec 2015 09:13:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 630CD18AD; Sun, 13 Dec 2015 09:13:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::6514:f4:a390:3c16] (unknown [IPv6:2001:7b8:3a7:0:6514:f4:a390:3c16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 409FF1C644; Sun, 13 Dec 2015 10:13:13 +0100 (CET) Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Dimitry Andric In-Reply-To: Date: Sun, 13 Dec 2015 10:13:06 +0100 Cc: Adrian Chadd , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-Id: <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> References: <201512112028.tBBKSRtn092966@repo.freebsd.org> To: Kai Wang X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 09:13:22 -0000 --Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 13 Dec 2015, at 09:43, Kai Wang wrote: >=20 > 2015-12-13 7:04 GMT+01:00 Adrian Chadd : > cc1: warnings being treated as errors > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c: > In function 'dump_dwarf': > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:7479: > warning: 'b' may be used uninitialized in this function > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:7479: > note: 'b' was declared here > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:4758: > warning: 'pe' may be used uninitialized in this function > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:4758: > note: 'pe' was declared here >=20 > .. these both seem like legit. >=20 >=20 > Hi, >=20 > Sorry about the breakage. Should be fixed by r292158. > Somehow clang didn't catch this. Had to use gcc to see this warning. Indeed, this is interesting. For clang to warn similarly, the -Wconditional-uninitialized option has to be enabled explicitly, and then you get a lot of them (this is from just before your commit): = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4861= :33: error: variable 'pe' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] dirndx =3D _decode_uleb128(&p, pe); ^~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758= :17: note: initialize the variable 'pe' to silence this warning uint8_t *p, *pe; ^ =3D NULL = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6167= :8: error: variable 'cie_ra' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] cie_ra); ^~~~~~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6060= :19: note: initialize the variable 'cie_ra' to silence this warning Dwarf_Half cie_ra; ^ =3D 0 = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6164= :8: error: variable 'cie_caf' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] cie_caf, cie_daf, low_pc, re->dbg); ^~~~~~~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6057= :24: note: initialize the variable 'cie_caf' to silence this warning Dwarf_Unsigned cie_caf, cie_daf, cie_instlen, func_len, = fde_length; ^ =3D 0 = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6164= :17: error: variable 'cie_daf' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] cie_caf, cie_daf, low_pc, re->dbg); ^~~~~~~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6057= :33: note: initialize the variable 'cie_daf' to silence this warning Dwarf_Unsigned cie_caf, cie_daf, cie_instlen, func_len, = fde_length; ^ =3D 0 = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7492= :21: error: variable 'b' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] if (shift < 32 && (b & 0x40) !=3D 0) ^ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479= :11: note: initialize the variable 'b' to silence this warning uint8_t b; ^ =3D '\0' 5 errors generated. I'll check if there is a specific reason upstream does not enable this warning by default for -Wall. Maybe there is a risk of false positives. -Dimitry --Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEYEARECAAYFAlZtNqgACgkQsF6jCi4glqNtNgCgqXUa+7zhqWdqsKKuhLLC2dGq 9vcAoKidiRBPCCFY0wX0DQ9ZJwH8nLKL =Q7rP -----END PGP SIGNATURE----- --Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD-- From owner-svn-src-all@freebsd.org Sun Dec 13 10:55:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 480C5A42693; Sun, 13 Dec 2015 10:55:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 12AB61A16; Sun, 13 Dec 2015 10:55:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 762E6425735; Sun, 13 Dec 2015 21:55:26 +1100 (AEDT) Date: Sun, 13 Dec 2015 21:55:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292153 - head/lib/libc/regex/grot In-Reply-To: <201512130633.tBD6XqrN024958@repo.freebsd.org> Message-ID: <20151213202334.G997@besplex.bde.org> References: <201512130633.tBD6XqrN024958@repo.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=R4L+YolX c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=8F9S-QAE3UA2aw2DpygA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 10:55:36 -0000 On Sun, 13 Dec 2015, Garrett Cooper wrote: > Log: > Add -static to CFLAGS to unbreak the tests by using a libc.a with > the xlocale private symbols exposed which aren't exposed publicly > via the DSO This is an interesting hack. I think there are some bad bugs in static libraries from exposing public private (sic) symbols in them, and from using private public (sic) symbols. Or perhaps the reverse. A public private symbol is one that is public (extern) in C but not exported from the shared library. A private public symbol is one that is public (extern) in C and is also exported by the shared library, but is a weak symbol so it is sort of private for both. An example of the latter is 'open' or syslog. Both are in the user namespace for Standard C. syslog is in the user namespace for some versions of POSIX. libc is supposed to use renamed versions so that it never uses a user version. It mostly does this for _open. open is a weak symbol so that sloppy parts of libc and POSIX applications can see it. Non-POSIX applications can see it too unless they replace it. According to nm on libc.a, the only thing in the library with a sloppy reference to open is citrus_mmap.o. It also references close, fstat, mmap and munmap. This is probably OK since it is an extension of POSIX. There is the following thicket of complications in names for what should be the simple open syscall: open.o: X U __libc_interposing X U __stack_chk_fail X U __stack_chk_guard X 0000000000000000 W open _open.o: X U .cerror X 0000000000000000 T __sys_open X 0000000000000000 W _open Even _open is a weak symbol. That makes no sense. Similarly for all syscalls except ones like _exit whose primary syscall name has the single underscore. I think it is just a bug in the PSEUDO macro in SYS.h. Functions like syslog() are not handled so carefully. They are never renamed. This was not a problem, since they were not called much from other parts of libc. Perhaps never for syslog(), or just from associated parts with the closure of the parts being entirely inside or entirely outside APIs that have syslog(). But this was broken by the stack protector code. The stack protector code is not called from all over the library, e.g., for open as shown above. This turns the careful renaming for open into just an obfuscation (except the obfuscations also give pessimizations). Test program for this. X #include X #include X X #ifndef NO_DEBLOAT X void X openlog(void) X { X puts("opensyslog() is not in the Standard C library()"); X } X X void X syslog(void) X { X puts("syslog() is not in the Standard C library()"); X /* I am careful not to call this, but stack_protector.c isn't. */ X // system("rm -rf /"); X } X X void X vsyslog(void) X { X puts("vsyslog() is not even in POSIX"); X } X X void X closelog(void) X { X puts("opensyslog() is not in the Standard C library()"); X } X X off_t X lseek(int fd, off_t offset, int whence) X { X puts("lseek() is not in the Standard C library()"); X return -1; X } X #endif X X int X main(void) X { X #ifdef FORCE_USE X openlog(); X vsyslog(); X closelog(); X #else X open("/dev/null", 0); /* warm up for debugging */ X open("/dev/null", 0); /* try to get it to call us */ X #endif X puts("hello world is bloated"); X } This must be run under gdb. Manually corrupt the stack so that __stack_chk_fail is called. Then the private syslog() is called iff the linkage is static. The other functions are normally not called since __stack_chk_fail kills the program with SIGABRT after calling syslog(). Debugging this shows another bug (bogusness at least): _open uses the open syscall, but open uses the openat syscall. Debugging this is especially difficult when it is dynamically linked. Then the __libc_interposing, __stack_chk_fail and __stack_chk_guard symbols are so private that even the debugger can't see them, at least with the library not compiled with -g. With static linkage, they are normal public symbols. This program was originally for testing reduction of library bloat. The bloat is so large that the null program main(){} now links to syslog and might even call it if the stack gets corrupted. So the null program now has size more than 460KB on amd64 (more than 4 times larger than /bin/sh in FreeBSD-1). Bruce From owner-svn-src-all@freebsd.org Sun Dec 13 11:08:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B4CBA1401B; Sun, 13 Dec 2015 11:08:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD1DC1EF1; Sun, 13 Dec 2015 11:08:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDB8T3v004506; Sun, 13 Dec 2015 11:08:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDB8TG9004505; Sun, 13 Dec 2015 11:08:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201512131108.tBDB8TG9004505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 13 Dec 2015 11:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292160 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 11:08:31 -0000 Author: trasz Date: Sun Dec 13 11:08:29 2015 New Revision: 292160 URL: https://svnweb.freebsd.org/changeset/base/292160 Log: Avoid useless relocking. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Sun Dec 13 09:05:55 2015 (r292159) +++ head/sys/kern/kern_racct.c Sun Dec 13 11:08:29 2015 (r292160) @@ -631,8 +631,8 @@ racct_add_force(struct proc *p, int reso mtx_lock(&racct_lock); racct_adjust_resource(p->p_racct, resource, amount); + racct_add_cred_locked(p->p_ucred, resource, amount); mtx_unlock(&racct_lock); - racct_add_cred(p->p_ucred, resource, amount); } static int From owner-svn-src-all@freebsd.org Sun Dec 13 11:21:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A85DDA1498A; Sun, 13 Dec 2015 11:21:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7803614B4; Sun, 13 Dec 2015 11:21:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDBLDXP007621; Sun, 13 Dec 2015 11:21:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDBLDFN007620; Sun, 13 Dec 2015 11:21:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201512131121.tBDBLDFN007620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 13 Dec 2015 11:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292161 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 11:21:14 -0000 Author: trasz Date: Sun Dec 13 11:21:13 2015 New Revision: 292161 URL: https://svnweb.freebsd.org/changeset/base/292161 Log: Actually make the 'amount' argument to racct_adjust_resource() signed, as it was always supposed to be. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Sun Dec 13 11:08:29 2015 (r292160) +++ head/sys/kern/kern_racct.c Sun Dec 13 11:21:13 2015 (r292161) @@ -501,7 +501,7 @@ racct_destroy(struct racct **racct) */ static void racct_adjust_resource(struct racct *racct, int resource, - uint64_t amount) + int64_t amount) { ASSERT_RACCT_ENABLED(); From owner-svn-src-all@freebsd.org Sun Dec 13 11:30:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F13EAA421D4; Sun, 13 Dec 2015 11:30:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF2291A43; Sun, 13 Dec 2015 11:30:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDBUaVA010422; Sun, 13 Dec 2015 11:30:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDBUaak010420; Sun, 13 Dec 2015 11:30:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201512131130.tBDBUaak010420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 13 Dec 2015 11:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292162 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 11:30:38 -0000 Author: trasz Date: Sun Dec 13 11:30:36 2015 New Revision: 292162 URL: https://svnweb.freebsd.org/changeset/base/292162 Log: Tweak comments. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_racct.c head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Sun Dec 13 11:21:13 2015 (r292161) +++ head/sys/kern/kern_racct.c Sun Dec 13 11:30:36 2015 (r292162) @@ -495,8 +495,8 @@ racct_destroy(struct racct **racct) } /* - * Increase consumption of 'resource' by 'amount' for 'racct' - * and all its parents. Differently from other cases, 'amount' here + * Increase consumption of 'resource' by 'amount' for 'racct', + * but not its parents. Differently from other cases, 'amount' here * may be less than zero. */ static void Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Sun Dec 13 11:21:13 2015 (r292161) +++ head/sys/kern/kern_rctl.c Sun Dec 13 11:30:36 2015 (r292162) @@ -282,7 +282,7 @@ rctl_would_exceed(const struct proc *p, } /* - * Special version of rctl_available() function for the %cpu resource. + * Special version of rctl_get_available() for the %CPU resource. * We slightly cheat here and return less than we normally would. */ int64_t From owner-svn-src-all@freebsd.org Sun Dec 13 16:37:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC3CA42382; Sun, 13 Dec 2015 16:37:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A0B13A7; Sun, 13 Dec 2015 16:37:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDGb1On002314; Sun, 13 Dec 2015 16:37:01 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDGb1S4002313; Sun, 13 Dec 2015 16:37:01 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512131637.tBDGb1S4002313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 13 Dec 2015 16:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292163 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 16:37:03 -0000 Author: melifaro Date: Sun Dec 13 16:37:01 2015 New Revision: 292163 URL: https://svnweb.freebsd.org/changeset/base/292163 Log: Fix PINNED routes handling. Before r291643, adding new interface prefix had the following logic: try_add: EEXIST && (PINNED) { try_del(w/o PINNED flag) if (OK) try_add(PINNED) } In r291643, deletion was performed w/ PINNED flag held which leaded to new interface prefixes (like ::1) overriding older ones. Fix this by requesting deletion w/o RTF_PINNED. PR: kern/205285 Submitted by: Fabian Keil Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Dec 13 11:30:36 2015 (r292162) +++ head/sys/net/route.c Sun Dec 13 16:37:01 2015 (r292163) @@ -1586,7 +1586,10 @@ rtrequest1_fib(int req, struct rt_addrin */ struct sockaddr *info_dst = info->rti_info[RTAX_DST]; info->rti_info[RTAX_DST] = ndst; + /* Do not delete existing PINNED(interface) routes */ + info->rti_flags &= ~RTF_PINNED; rt_old = rt_unlinkrte(rnh, info, &error); + info->rti_flags |= RTF_PINNED; info->rti_info[RTAX_DST] = info_dst; if (rt_old != NULL) rn = rnh->rnh_addaddr(ndst, netmask, rnh, From owner-svn-src-all@freebsd.org Sun Dec 13 17:08:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7A42A43AAC; Sun, 13 Dec 2015 17:08:46 +0000 (UTC) (envelope-from rm@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id C90E51259; Sun, 13 Dec 2015 17:08:46 +0000 (UTC) (envelope-from rm@FreeBSD.org) Received: from [127.0.0.1] (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 13A691AD7; Sun, 13 Dec 2015 17:08:44 +0000 (UTC) (envelope-from rm@FreeBSD.org) Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf To: Dimitry Andric , Kai Wang References: <201512112028.tBBKSRtn092966@repo.freebsd.org> <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> Cc: Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ed Maste From: Ruslan Makhmatkhanov Message-ID: <566DA52B.1050805@FreeBSD.org> Date: Sun, 13 Dec 2015 20:04:43 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 17:08:46 -0000 Sorry for break in, but I tried to update to r292130 and have this messages on `make kernel`. Does it by chance has something to do with toolchain update and was it fixed in subsequent commits? Thanks. ===> zlib (install) install -o root -g wheel -m 555 zlib.ko /boot/kernel/ kldxref /boot/kernel kldxref: unknown metadata record 4 in file atacard.ko kldxref: unknown metadata record 4 in file atp.ko kldxref: unknown metadata record 4 in file atp.ko kldxref: unknown metadata record 4 in file cmx.ko kldxref: unknown metadata record 4 in file fdc.ko kldxref: unknown metadata record 4 in file if_an.ko kldxref: unknown metadata record 4 in file if_aue.ko [...] It printed one this message for every kernel module. -- Regards, Ruslan T.O.S. Of Reality From owner-svn-src-all@freebsd.org Sun Dec 13 18:58:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24532A42B5B; Sun, 13 Dec 2015 18:58:13 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C50FA1940; Sun, 13 Dec 2015 18:58:12 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id p66so35077401wmp.1; Sun, 13 Dec 2015 10:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0T7haAj3VeHQMDgMK0IgWycJqnE5S3JMHI98N34zVpk=; b=uc/Y2g+pbzuP2ypxhpk9noIuRlceQNWg4Yf8U1Nof/csz7L+we+GW/OWHz/X7QayBY 4wl1I4x1ZDWcOHhBYBA/yeE2pGwNd1G9neNS6O/9z5i2ofe/K08Zm5OKVGGtKxhRfGD0 3goXFYfVH1q2+oQJCOIoIHwvzjAn4SlrUdDJPVVzpb2WpGiM/4x3yE0/aWYB+VjVeqPJ ReKjB5TcyQF3Dq7Mhw4TUPMAsMycNW/LXHu4LOUSgQZmdrWcqhmilhYHR5U9u/X5kohz Sf97rT2piEz19p+4x35ybwD1YpbIIHXswnP4TAAy0/g5l6QgoeIdAh+6HfTSxW4zfFYl C2nQ== MIME-Version: 1.0 X-Received: by 10.28.60.11 with SMTP id j11mr19061675wma.57.1450033090517; Sun, 13 Dec 2015 10:58:10 -0800 (PST) Received: by 10.27.170.79 with HTTP; Sun, 13 Dec 2015 10:58:10 -0800 (PST) In-Reply-To: <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> References: <201512112028.tBBKSRtn092966@repo.freebsd.org> <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> Date: Sun, 13 Dec 2015 12:58:10 -0600 Message-ID: Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf From: Benjamin Kaduk To: Dimitry Andric Cc: Kai Wang , Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ed Maste Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 18:58:13 -0000 On Sun, Dec 13, 2015 at 3:13 AM, Dimitry Andric wrote: > On 13 Dec 2015, at 09:43, Kai Wang wrote: > > > > 2015-12-13 7:04 GMT+01:00 Adrian Chadd : > > cc1: warnings being treated as errors > > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c: > > In function 'dump_dwarf': > > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479: > > warning: 'b' may be used uninitialized in this function > > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479: > > note: 'b' was declared here > > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758: > > warning: 'pe' may be used uninitialized in this function > > > /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758: > > note: 'pe' was declared here > > > > .. these both seem like legit. > > > > > > Hi, > > > > Sorry about the breakage. Should be fixed by r292158. > > Somehow clang didn't catch this. Had to use gcc to see this warning. > > Indeed, this is interesting. For clang to warn similarly, the > -Wconditional-uninitialized option has to be enabled explicitly, and > then you get a lot of them (this is from just before your commit): > > /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4861:33: > error: variable 'pe' may be uninitialized when used here > [-Werror,-Wconditional-uninitialized] > dirndx = _decode_uleb128(&p, pe); > [...] > I'll check if there is a specific reason upstream does not enable this > warning by default for -Wall. Maybe there is a risk of false positives. > > -Dimitry > > I'm pretty sure I've seen lots of false positives from -Wconditional-uninitialized in the krb5 and openafs codebases. I either set -Wno-error=conditional-uninitialized or -Wno-conditional-uninitialized depending on how distracting they are in my build logs. -Ben From owner-svn-src-all@freebsd.org Sun Dec 13 20:31:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A9E7A430F9; Sun, 13 Dec 2015 20:31:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39EC2144F; Sun, 13 Dec 2015 20:31:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDKVae0072162; Sun, 13 Dec 2015 20:31:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDKVajo072161; Sun, 13 Dec 2015 20:31:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512132031.tBDKVajo072161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 13 Dec 2015 20:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292164 - head/tools/bsdbox X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 20:31:37 -0000 Author: adrian Date: Sun Dec 13 20:31:36 2015 New Revision: 292164 URL: https://svnweb.freebsd.org/changeset/base/292164 Log: Fix bsdbox builds after the recent libkvm requirement for libelf. Modified: head/tools/bsdbox/Makefile.base Modified: head/tools/bsdbox/Makefile.base ============================================================================== --- head/tools/bsdbox/Makefile.base Sun Dec 13 16:37:01 2015 (r292163) +++ head/tools/bsdbox/Makefile.base Sun Dec 13 20:31:36 2015 (r292164) @@ -14,7 +14,7 @@ CRUNCH_ALIAS_tset= reset CRUNCH_PROGS_usr.bin+= vmstat #CRUNCH_PROGS_user.bin+= systat -CRUNCH_LIBS+= -ldevstat -lncursesw -lncurses -lmemstat -lkvm +CRUNCH_LIBS+= -ldevstat -lncursesw -lncurses -lmemstat -lkvm -lelf # CRUNCH_PROGS_usr.bin+= tar CRUNCH_PROGS_usr.bin+= cpio From owner-svn-src-all@freebsd.org Sun Dec 13 20:48:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B0A4A43CE1; Sun, 13 Dec 2015 20:48:27 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0E9F1EBD; Sun, 13 Dec 2015 20:48:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDKmPdd075516; Sun, 13 Dec 2015 20:48:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDKmOm9075505; Sun, 13 Dec 2015 20:48:24 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132048.tBDKmOm9075505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 20:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292165 - in head/sys: dev/bwn dev/otus dev/ral dev/usb/wlan 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 20:48:27 -0000 Author: avos Date: Sun Dec 13 20:48:24 2015 New Revision: 292165 URL: https://svnweb.freebsd.org/changeset/base/292165 Log: net80211: remove hardcoded slot time durations from drivers - Add IEEE80211_GET_SLOTTIME(ic) macro. - Use predefined macroses to set slot time. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4044 Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/otus/if_otus.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.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/net80211/ieee80211_phy.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/bwn/if_bwn.c Sun Dec 13 20:48:24 2015 (r292165) @@ -2721,8 +2721,7 @@ bwn_updateslot(struct ieee80211com *ic) BWN_LOCK(sc); if (sc->sc_flags & BWN_FLAG_RUNNING) { mac = (struct bwn_mac *)sc->sc_curmac; - bwn_set_slot_time(mac, - (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20); + bwn_set_slot_time(mac, IEEE80211_GET_SLOTTIME(ic)); } BWN_UNLOCK(sc); } Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/otus/if_otus.c Sun Dec 13 20:48:24 2015 (r292165) @@ -2423,7 +2423,7 @@ otus_updateslot(struct otus_softc *sc) OTUS_LOCK_ASSERT(sc); - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); otus_write(sc, AR_MAC_REG_SLOT_TIME, slottime << 10); (void)otus_write_barrier(sc); } Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/ral/rt2560.c Sun Dec 13 20:48:24 2015 (r292165) @@ -2254,7 +2254,7 @@ rt2560_update_slot(struct ieee80211com * uint32_t tmp; #ifndef FORCE_SLOTTIME - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); #else /* * Setting slot time according to "short slot time" capability @@ -2272,13 +2272,13 @@ rt2560_update_slot(struct ieee80211com * * (-1Mb~-2Mb lower) and the _whole_ BSS would stop using short * slot time. */ - slottime = 20; + slottime = IEEE80211_DUR_SLOT; #endif /* update the MAC slot boundaries */ tx_sifs = RAL_SIFS - RT2560_TXRX_TURNAROUND; tx_pifs = tx_sifs + slottime; - tx_difs = tx_sifs + 2 * slottime; + tx_difs = IEEE80211_DUR_DIFS(tx_sifs, slottime); eifs = (ic->ic_curmode == IEEE80211_MODE_11B) ? 364 : 60; tmp = RAL_READ(sc, RT2560_CSR11); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/ral/rt2661.c Sun Dec 13 20:48:24 2015 (r292165) @@ -2090,7 +2090,7 @@ rt2661_update_slot(struct ieee80211com * uint8_t slottime; uint32_t tmp; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); tmp = RAL_READ(sc, RT2661_MAC_CSR9); tmp = (tmp & ~0xff) | slottime; Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/ral/rt2860.c Sun Dec 13 20:48:24 2015 (r292165) @@ -3048,7 +3048,7 @@ rt2860_updateslot(struct ieee80211com *i tmp = RAL_READ(sc, RT2860_BKOFF_SLOT_CFG); tmp &= ~0xff; - tmp |= (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + tmp |= IEEE80211_GET_SLOTTIME(ic); RAL_WRITE(sc, RT2860_BKOFF_SLOT_CFG, tmp); } Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/usb/wlan/if_rum.c Sun Dec 13 20:48:24 2015 (r292165) @@ -2068,7 +2068,7 @@ rum_update_slot_cb(struct rum_softc *sc, struct ieee80211com *ic = &sc->sc_ic; uint8_t slottime; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); rum_modbits(sc, RT2573_MAC_CSR9, slottime, 0xff); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/usb/wlan/if_run.c Sun Dec 13 20:48:24 2015 (r292165) @@ -5186,7 +5186,7 @@ run_updateslot_cb(void *arg) run_read(sc, RT2860_BKOFF_SLOT_CFG, &tmp); tmp &= ~0xff; - tmp |= (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + tmp |= IEEE80211_GET_SLOTTIME(ic); run_write(sc, RT2860_BKOFF_SLOT_CFG, tmp); } Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/usb/wlan/if_ural.c Sun Dec 13 20:48:24 2015 (r292165) @@ -1771,7 +1771,7 @@ ural_update_slot(struct ural_softc *sc) struct ieee80211com *ic = &sc->sc_ic; uint16_t slottime, sifs, eifs; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + slottime = IEEE80211_GET_SLOTTIME(ic); /* * These settings may sound a bit inconsistent but this is what the Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/usb/wlan/if_urtw.c Sun Dec 13 20:48:24 2015 (r292165) @@ -4291,18 +4291,18 @@ urtw_updateslottask(void *arg, int pendi if (sc->sc_flags & URTW_RTL8187B) { urtw_write8_m(sc, URTW_SIFS, 0x22); if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) - urtw_write8_m(sc, URTW_SLOT, 0x9); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SHSLOT); else - urtw_write8_m(sc, URTW_SLOT, 0x14); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SLOT); urtw_write8_m(sc, URTW_8187B_EIFS, 0x5b); urtw_write8_m(sc, URTW_CARRIER_SCOUNT, 0x5b); } else { urtw_write8_m(sc, URTW_SIFS, 0x22); if (sc->sc_state == IEEE80211_S_ASSOC && ic->ic_flags & IEEE80211_F_SHSLOT) - urtw_write8_m(sc, URTW_SLOT, 0x9); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SHSLOT); else - urtw_write8_m(sc, URTW_SLOT, 0x14); + urtw_write8_m(sc, URTW_SLOT, IEEE80211_DUR_SLOT); if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) { urtw_write8_m(sc, URTW_DIFS, 0x14); urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14); Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 20:48:24 2015 (r292165) @@ -3621,8 +3621,7 @@ urtwn_wme_update(struct ieee80211com *ic int ac; acm = 0; - slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? - IEEE80211_DUR_SHSLOT : IEEE80211_DUR_SLOT; + slottime = IEEE80211_GET_SLOTTIME(ic); URTWN_LOCK(sc); for (ac = WME_AC_BE; ac < WME_NUM_AC; ac++) { Modified: head/sys/net80211/ieee80211_phy.h ============================================================================== --- head/sys/net80211/ieee80211_phy.h Sun Dec 13 20:31:36 2015 (r292164) +++ head/sys/net80211/ieee80211_phy.h Sun Dec 13 20:48:24 2015 (r292165) @@ -53,6 +53,10 @@ #define IEEE80211_DUR_SHSLOT 9 /* ERP short slottime */ #define IEEE80211_DUR_OFDM_SLOT 9 /* OFDM slottime */ +#define IEEE80211_GET_SLOTTIME(ic) \ + ((ic->ic_flags & IEEE80211_F_SHSLOT) ? \ + IEEE80211_DUR_SHSLOT : IEEE80211_DUR_SLOT) + /* * DIFS (microseconds). */ From owner-svn-src-all@freebsd.org Sun Dec 13 20:53:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FB28A4213C; Sun, 13 Dec 2015 20:53:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5826D12FC; Sun, 13 Dec 2015 20:53:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDKrpl4078299; Sun, 13 Dec 2015 20:53:51 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDKrpGY078296; Sun, 13 Dec 2015 20:53:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132053.tBDKrpGY078296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 20:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292166 - in head/sys/dev/wtap: . plugins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 20:53:52 -0000 Author: avos Date: Sun Dec 13 20:53:51 2015 New Revision: 292166 URL: https://svnweb.freebsd.org/changeset/base/292166 Log: wtap: do not include when is already included Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4536 Modified: head/sys/dev/wtap/if_wtap_module.c head/sys/dev/wtap/if_wtapvar.h head/sys/dev/wtap/plugins/visibility.c Modified: head/sys/dev/wtap/if_wtap_module.c ============================================================================== --- head/sys/dev/wtap/if_wtap_module.c Sun Dec 13 20:48:24 2015 (r292165) +++ head/sys/dev/wtap/if_wtap_module.c Sun Dec 13 20:53:51 2015 (r292166) @@ -41,7 +41,6 @@ #include #include -#include #include #include #include Modified: head/sys/dev/wtap/if_wtapvar.h ============================================================================== --- head/sys/dev/wtap/if_wtapvar.h Sun Dec 13 20:48:24 2015 (r292165) +++ head/sys/dev/wtap/if_wtapvar.h Sun Dec 13 20:53:51 2015 (r292166) @@ -32,7 +32,6 @@ #ifndef _DEV_WTAP_WTAPVAR_H #define _DEV_WTAP_WTAPVAR_H -#include #include #include #include @@ -44,7 +43,6 @@ #include #include -#include #include #include #include Modified: head/sys/dev/wtap/plugins/visibility.c ============================================================================== --- head/sys/dev/wtap/plugins/visibility.c Sun Dec 13 20:48:24 2015 (r292165) +++ head/sys/dev/wtap/plugins/visibility.c Sun Dec 13 20:53:51 2015 (r292166) @@ -41,7 +41,6 @@ #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Sun Dec 13 21:00:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C53DA427C5; Sun, 13 Dec 2015 21:00:22 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45741194C; Sun, 13 Dec 2015 21:00:22 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDL0LhJ078591; Sun, 13 Dec 2015 21:00:21 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDL0LIi078588; Sun, 13 Dec 2015 21:00:21 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132100.tBDL0LIi078588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 21:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292167 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:00:22 -0000 Author: avos Date: Sun Dec 13 21:00:21 2015 New Revision: 292167 URL: https://svnweb.freebsd.org/changeset/base/292167 Log: urtwn: add rate control support for RTL8188EU. Tested with: - RTL8188EU, STA and HOSTAP modes. - RTL8188CUS, STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4402 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 20:53:51 2015 (r292166) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 21:00:21 2015 (r292167) @@ -183,8 +183,12 @@ static struct ieee80211vap *urtwn_vap_cr static void urtwn_vap_delete(struct ieee80211vap *); static struct mbuf * urtwn_rx_frame(struct urtwn_softc *, uint8_t *, int, int *); -static struct mbuf * urtwn_rxeof(struct usb_xfer *, struct urtwn_data *, +static struct mbuf * urtwn_report_intr(struct usb_xfer *, struct urtwn_data *, int *, int8_t *); +static struct mbuf * urtwn_rxeof(struct urtwn_softc *, uint8_t *, int, + int *, int8_t *); +static void urtwn_r88e_ratectl_tx_complete(struct urtwn_softc *, + void *); static void urtwn_txeof(struct urtwn_softc *, struct urtwn_data *, int); static int urtwn_alloc_list(struct urtwn_softc *, @@ -295,6 +299,10 @@ static int urtwn_wme_update(struct ieee static void urtwn_set_promisc(struct urtwn_softc *); static void urtwn_update_promisc(struct ieee80211com *); static void urtwn_update_mcast(struct ieee80211com *); +static struct ieee80211_node *urtwn_r88e_node_alloc(struct ieee80211vap *, + const uint8_t mac[IEEE80211_ADDR_LEN]); +static void urtwn_r88e_newassoc(struct ieee80211_node *, int); +static void urtwn_r88e_node_free(struct ieee80211_node *); static void urtwn_set_chan(struct urtwn_softc *, struct ieee80211_channel *, struct ieee80211_channel *); @@ -419,6 +427,7 @@ urtwn_attach(device_t self) mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); + URTWN_NT_LOCK_INIT(sc); callout_init(&sc->sc_watchdog_ch, 0); mbufq_init(&sc->sc_snd, ifqmaxlen); @@ -504,6 +513,12 @@ urtwn_attach(device_t self) ic->ic_wme.wme_update = urtwn_wme_update; ic->ic_update_promisc = urtwn_update_promisc; ic->ic_update_mcast = urtwn_update_mcast; + if (sc->chip & URTWN_CHIP_88E) { + ic->ic_node_alloc = urtwn_r88e_node_alloc; + ic->ic_newassoc = urtwn_r88e_newassoc; + sc->sc_node_free = ic->ic_node_free; + ic->ic_node_free = urtwn_r88e_node_free; + } ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), URTWN_TX_RADIOTAP_PRESENT, @@ -560,6 +575,7 @@ urtwn_detach(device_t self) URTWN_UNLOCK(sc); ieee80211_ifdetach(ic); + URTWN_NT_LOCK_DESTROY(sc); mtx_destroy(&sc->sc_mtx); return (0); @@ -638,6 +654,8 @@ urtwn_vap_create(struct ieee80211com *ic TASK_INIT(&uvp->tsf_task_adhoc, 0, urtwn_tsf_task_adhoc, vap); } + if (URTWN_CHIP_HAS_RATECTL(sc)) + ieee80211_ratectl_init(vap); /* complete setup */ ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status, mac); @@ -649,12 +667,15 @@ static void urtwn_vap_delete(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; + struct urtwn_softc *sc = ic->ic_softc; struct urtwn_vap *uvp = URTWN_VAP(vap); if (uvp->bcn_mbuf != NULL) m_freem(uvp->bcn_mbuf); if (vap->iv_opmode == IEEE80211_M_IBSS) ieee80211_draintask(ic, &uvp->tsf_task_adhoc); + if (URTWN_CHIP_HAS_RATECTL(sc)) + ieee80211_ratectl_deinit(vap); ieee80211_vap_detach(vap); free(uvp, M_80211_VAP); } @@ -743,16 +764,14 @@ urtwn_rx_frame(struct urtwn_softc *sc, u } static struct mbuf * -urtwn_rxeof(struct usb_xfer *xfer, struct urtwn_data *data, int *rssi, +urtwn_report_intr(struct usb_xfer *xfer, struct urtwn_data *data, int *rssi, int8_t *nf) { struct urtwn_softc *sc = data->sc; struct ieee80211com *ic = &sc->sc_ic; struct r92c_rx_stat *stat; - struct mbuf *m, *m0 = NULL, *prevm = NULL; - uint32_t rxdw0; uint8_t *buf; - int len, totlen, pktlen, infosz, npkts; + int len; usbd_xfer_status(xfer, &len, NULL, NULL, NULL); @@ -762,6 +781,36 @@ urtwn_rxeof(struct usb_xfer *xfer, struc } buf = data->buf; + stat = (struct r92c_rx_stat *)buf; + + if (sc->chip & URTWN_CHIP_88E) { + int report_sel = MS(le32toh(stat->rxdw3), R88E_RXDW3_RPT); + + switch (report_sel) { + case R88E_RXDW3_RPT_RX: + return (urtwn_rxeof(sc, buf, len, rssi, nf)); + case R88E_RXDW3_RPT_TX1: + urtwn_r88e_ratectl_tx_complete(sc, &stat[1]); + break; + default: + DPRINTFN(7, "case %d was not handled\n", report_sel); + break; + } + } else + return (urtwn_rxeof(sc, buf, len, rssi, nf)); + + return (NULL); +} + +static struct mbuf * +urtwn_rxeof(struct urtwn_softc *sc, uint8_t *buf, int len, int *rssi, + int8_t *nf) +{ + struct r92c_rx_stat *stat; + struct mbuf *m, *m0 = NULL, *prevm = NULL; + uint32_t rxdw0; + int totlen, pktlen, infosz, npkts; + /* Get the number of encapsulated frames. */ stat = (struct r92c_rx_stat *)buf; npkts = MS(le32toh(stat->rxdw2), R92C_RXDW2_PKTCNT); @@ -805,6 +854,35 @@ urtwn_rxeof(struct usb_xfer *xfer, struc } static void +urtwn_r88e_ratectl_tx_complete(struct urtwn_softc *sc, void *arg) +{ + struct r88e_tx_rpt_ccx *rpt = arg; + struct ieee80211vap *vap; + struct ieee80211_node *ni; + uint8_t macid; + int ntries; + + macid = MS(rpt->rptb1, R88E_RPTB1_MACID); + ntries = MS(rpt->rptb2, R88E_RPTB2_RETRY_CNT); + + URTWN_NT_LOCK(sc); + ni = sc->node_list[macid]; + if (ni != NULL) { + vap = ni->ni_vap; + + if (rpt->rptb1 & R88E_RPTB1_PKT_OK) { + ieee80211_ratectl_tx_complete(vap, ni, + IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL); + } else { + ieee80211_ratectl_tx_complete(vap, ni, + IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL); + } + } else + DPRINTFN(8, "macid %d, ni is NULL\n", macid); + URTWN_NT_UNLOCK(sc); +} + +static void urtwn_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) { struct urtwn_softc *sc = usbd_xfer_softc(xfer); @@ -824,7 +902,7 @@ urtwn_bulk_rx_callback(struct usb_xfer * if (data == NULL) goto tr_setup; STAILQ_REMOVE_HEAD(&sc->sc_rx_active, next); - m = urtwn_rxeof(xfer, data, &rssi, &nf); + m = urtwn_report_intr(xfer, data, &rssi, &nf); STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -2008,10 +2086,7 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_write_1(sc, R92C_T2T_SIFS + 1, 10); /* Intialize rate adaptation. */ - if (sc->chip & URTWN_CHIP_88E) - ni->ni_txrate = - ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]; - else + if (!(sc->chip & URTWN_CHIP_88E)) urtwn_ra_init(sc); /* Turn link LED on. */ urtwn_set_led(sc, URTWN_LED_LINK, 1); @@ -2162,16 +2237,38 @@ urtwn_r88e_get_rssi(struct urtwn_softc * return (rssi); } +static __inline uint8_t +rate2ridx(uint8_t rate) +{ + switch (rate) { + case 12: return 4; + case 18: return 5; + case 24: return 6; + case 36: return 7; + case 48: return 8; + case 72: return 9; + case 96: return 10; + case 108: return 11; + case 2: return 0; + case 4: return 1; + case 11: return 2; + case 22: return 3; + default: return 0; + } +} + static int urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, struct urtwn_data *data) { - struct ieee80211_frame *wh; - struct ieee80211_key *k = NULL; + const struct ieee80211_txparam *tp; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_key *k = NULL; + struct ieee80211_channel *chan; + struct ieee80211_frame *wh; struct r92c_tx_desc *txd; - uint8_t macid, raid, ridx, subtype, type, tid, qsel; + uint8_t macid, raid, rate, ridx, subtype, type, tid, qsel; int hasqos, ismcast; URTWN_ASSERT_LOCKED(sc); @@ -2192,6 +2289,38 @@ urtwn_tx_data(struct urtwn_softc *sc, st } else tid = 0; + chan = (ni->ni_chan != IEEE80211_CHAN_ANYC) ? + ni->ni_chan : ic->ic_curchan; + tp = &vap->iv_txparms[ieee80211_chan2mode(chan)]; + + /* Choose a TX rate index. */ + if (type == IEEE80211_FC0_TYPE_MGT) + rate = tp->mgmtrate; + else if (ismcast) + rate = tp->mcastrate; + else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rate = tp->ucastrate; + else if (m->m_flags & M_EAPOL) + rate = tp->mgmtrate; + else { + if (URTWN_CHIP_HAS_RATECTL(sc)) { + /* XXX pass pktlen */ + (void) ieee80211_ratectl_rate(ni, NULL, 0); + rate = ni->ni_txrate; + } else { + if (ic->ic_curmode != IEEE80211_MODE_11B) + rate = 108; + else + rate = 22; + } + } + + ridx = rate2ridx(rate); + if (ic->ic_curmode != IEEE80211_MODE_11B) + raid = R92C_RAID_11BG; + else + raid = R92C_RAID_11B; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { @@ -2214,25 +2343,21 @@ urtwn_tx_data(struct urtwn_softc *sc, st if (ismcast) txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); - raid = R92C_RAID_11B; /* by default */ - ridx = URTWN_RIDX_CCK1; if (!ismcast) { - macid = URTWN_MACID_BSS; + if (sc->chip & URTWN_CHIP_88E) { + struct urtwn_node *un = URTWN_NODE(ni); + macid = un->id; + } else + macid = URTWN_MACID_BSS; if (type == IEEE80211_FC0_TYPE_DATA) { qsel = tid % URTWN_MAX_TID; - if (!(m->m_flags & M_EAPOL)) { - if (ic->ic_curmode != IEEE80211_MODE_11B) { - raid = R92C_RAID_11BG; - ridx = URTWN_RIDX_OFDM54; - } else - ridx = URTWN_RIDX_CCK11; - } - - if (sc->chip & URTWN_CHIP_88E) - txd->txdw2 |= htole32(R88E_TXDW2_AGGBK); - else + if (sc->chip & URTWN_CHIP_88E) { + txd->txdw2 |= htole32( + R88E_TXDW2_AGGBK | + R88E_TXDW2_CCX_RPT); + } else txd->txdw1 |= htole32(R92C_TXDW1_AGGBK); if (ic->ic_flags & IEEE80211_F_USEPROT) { @@ -2272,8 +2397,8 @@ urtwn_tx_data(struct urtwn_softc *sc, st txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); /* Force this rate if needed. */ - if (ismcast || type != IEEE80211_FC0_TYPE_DATA || - (m->m_flags & M_EAPOL)) + if (URTWN_CHIP_HAS_RATECTL(sc) || ismcast || + (m->m_flags & M_EAPOL) || type != IEEE80211_FC0_TYPE_DATA) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); if (!hasqos) { @@ -3705,6 +3830,63 @@ urtwn_update_mcast(struct ieee80211com * /* XXX do nothing? */ } +static struct ieee80211_node * +urtwn_r88e_node_alloc(struct ieee80211vap *vap, + const uint8_t mac[IEEE80211_ADDR_LEN]) +{ + struct urtwn_node *un; + + un = malloc(sizeof (struct urtwn_node), M_80211_NODE, + M_NOWAIT | M_ZERO); + + if (un == NULL) + return NULL; + + un->id = URTWN_MACID_UNDEFINED; + + return &un->ni; +} + +static void +urtwn_r88e_newassoc(struct ieee80211_node *ni, int isnew) +{ + struct urtwn_softc *sc = ni->ni_ic->ic_softc; + struct urtwn_node *un = URTWN_NODE(ni); + uint8_t id; + + if (!isnew) + return; + + URTWN_NT_LOCK(sc); + for (id = 0; id <= URTWN_MACID_MAX(sc); id++) { + if (id != URTWN_MACID_BC && sc->node_list[id] == NULL) { + un->id = id; + sc->node_list[id] = ni; + break; + } + } + URTWN_NT_UNLOCK(sc); + + if (id > URTWN_MACID_MAX(sc)) { + device_printf(sc->sc_dev, "%s: node table is full\n", + __func__); + } +} + +static void +urtwn_r88e_node_free(struct ieee80211_node *ni) +{ + struct urtwn_softc *sc = ni->ni_ic->ic_softc; + struct urtwn_node *un = URTWN_NODE(ni); + + URTWN_NT_LOCK(sc); + if (un->id != URTWN_MACID_UNDEFINED) + sc->node_list[un->id] = NULL; + URTWN_NT_UNLOCK(sc); + + sc->sc_node_free(ni); +} + static void urtwn_set_chan(struct urtwn_softc *sc, struct ieee80211_channel *c, struct ieee80211_channel *extc) @@ -4022,6 +4204,12 @@ urtwn_init(struct urtwn_softc *sc) /* Enable hardware sequence numbering. */ urtwn_write_1(sc, R92C_HWSEQ_CTRL, 0xff); + /* Enable per-packet TX report. */ + if (sc->chip & URTWN_CHIP_88E) { + urtwn_write_1(sc, R88E_TX_RPT_CTRL, + urtwn_read_1(sc, R88E_TX_RPT_CTRL) | R88E_TX_RPT1_ENA); + } + /* Perform LO and IQ calibrations. */ urtwn_iq_calib(sc); /* Perform LC calibration. */ Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Sun Dec 13 20:53:51 2015 (r292166) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Sun Dec 13 21:00:21 2015 (r292167) @@ -158,6 +158,9 @@ #define R92C_INIRTS_RATE_SEL 0x480 #define R92C_INIDATA_RATE_SEL(macid) (0x484 + (macid)) #define R92C_MAX_AGGR_NUM 0x4ca +#define R88E_TX_RPT_CTRL 0x4ec +#define R88E_TX_RPT_MACID_MAX 0x4ed +#define R88E_TX_RPT_TIME 0x4f0 /* EDCA Configuration. */ #define R92C_EDCA_VO_PARAM 0x500 #define R92C_EDCA_VI_PARAM 0x504 @@ -479,6 +482,10 @@ #define R92C_RRSR_RSC_UPSUBCHNL 0x00400000 #define R92C_RRSR_SHORT 0x00800000 +/* Bits for R88E_TX_RPT_CTRL. */ +#define R88E_TX_RPT1_ENA 0x01 +#define R88E_TX_RPT2_ENA 0x02 + /* Bits for R92C_EDCA_XX_PARAM. */ #define R92C_EDCA_PARAM_AIFS_M 0x000000ff #define R92C_EDCA_PARAM_AIFS_S 0 @@ -895,6 +902,11 @@ struct r92c_fw_cmd_macid_cfg { uint8_t macid; #define URTWN_MACID_BSS 0 #define URTWN_MACID_BC 4 /* Broadcast. */ +#define R92C_MACID_MAX 31 +#define R88E_MACID_MAX 63 +#define URTWN_MACID_MAX(sc) (((sc)->chip & URTWN_CHIP_88E) ? \ + R88E_MACID_MAX : R92C_MACID_MAX) +#define URTWN_MACID_UNDEFINED (uint8_t)-1 #define URTWN_MACID_VALID 0x80 } __packed; @@ -972,6 +984,11 @@ struct r92c_rx_stat { #define R92C_RXDW3_RATE_S 0 #define R92C_RXDW3_HT 0x00000040 #define R92C_RXDW3_HTC 0x00000400 +#define R88E_RXDW3_RPT_M 0x0000c000 +#define R88E_RXDW3_RPT_S 14 +#define R88E_RXDW3_RPT_RX 0 +#define R88E_RXDW3_RPT_TX1 1 +#define R88E_RXDW3_RPT_TX2 2 uint32_t rxdw4; uint32_t rxdw5; @@ -1059,6 +1076,7 @@ struct r92c_tx_desc { uint32_t txdw2; #define R88E_TXDW2_AGGBK 0x00010000 +#define R88E_TXDW2_CCX_RPT 0x00080000 uint16_t txdw3; uint16_t txdseq; @@ -1091,6 +1109,30 @@ struct r92c_tx_desc { uint16_t pad; } __packed __attribute__((aligned(4))); +struct r88e_tx_rpt_ccx { + uint8_t rptb0; + uint8_t rptb1; +#define R88E_RPTB1_MACID_M 0x3f +#define R88E_RPTB1_MACID_S 0 +#define R88E_RPTB1_PKT_OK 0x40 +#define R88E_RPTB1_BMC 0x80 + + uint8_t rptb2; +#define R88E_RPTB2_RETRY_CNT_M 0x3f +#define R88E_RPTB2_RETRY_CNT_S 0 +#define R88E_RPTB2_LIFE_EXPIRE 0x40 +#define R88E_RPTB2_RETRY_OVER 0x80 + + uint8_t rptb3; + uint8_t rptb4; + uint8_t rptb5; + uint8_t rptb6; +#define R88E_RPTB6_QSEL_M 0xf0 +#define R88E_RPTB6_QSEL_S 4 + + uint8_t rptb7; +} __packed; + static const uint8_t ridx2rate[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 20:53:51 2015 (r292166) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 21:00:21 2015 (r292167) @@ -86,6 +86,12 @@ struct urtwn_fw_info { size_t size; }; +struct urtwn_node { + struct ieee80211_node ni; /* must be the first */ + uint8_t id; +}; +#define URTWN_NODE(ni) ((struct urtwn_node *)(ni)) + struct urtwn_vap { struct ieee80211vap vap; @@ -152,10 +158,16 @@ struct urtwn_softc { #define URTWN_CHIP_UMC_A_CUT 0x08 #define URTWN_CHIP_88E 0x10 +#define URTWN_CHIP_HAS_RATECTL(_sc) (!!((_sc)->chip & URTWN_CHIP_88E)) + + void (*sc_node_free)(struct ieee80211_node *); void (*sc_rf_write)(struct urtwn_softc *, int, uint8_t, uint32_t); int (*sc_power_on)(struct urtwn_softc *); + struct ieee80211_node *node_list[R88E_MACID_MAX]; + struct mtx nt_mtx; + uint8_t board_type; uint8_t regulatory; uint8_t pa_setting; @@ -213,3 +225,9 @@ struct urtwn_softc { #define URTWN_LOCK(sc) mtx_lock(&(sc)->sc_mtx) #define URTWN_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define URTWN_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) + +#define URTWN_NT_LOCK_INIT(sc) \ + mtx_init(&(sc)->nt_mtx, "node table lock", NULL, MTX_DEF) +#define URTWN_NT_LOCK(sc) mtx_lock(&(sc)->nt_mtx) +#define URTWN_NT_UNLOCK(sc) mtx_unlock(&(sc)->nt_mtx) +#define URTWN_NT_LOCK_DESTROY(sc) mtx_destroy(&(sc)->nt_mtx) From owner-svn-src-all@freebsd.org Sun Dec 13 21:09:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4110AA42EDA; Sun, 13 Dec 2015 21:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5BA1E65; Sun, 13 Dec 2015 21:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDL9lS5081368; Sun, 13 Dec 2015 21:09:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDL9lrN081365; Sun, 13 Dec 2015 21:09:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132109.tBDL9lrN081365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292168 - stable/10/lib/libc/regex/grot 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:09:48 -0000 Author: ngie Date: Sun Dec 13 21:09:46 2015 New Revision: 292168 URL: https://svnweb.freebsd.org/changeset/base/292168 Log: MFC r276737,r289369,r289376,r289424,r291219,r291382,r291385,r291908: r276737 (by imp): Remove old ioctl use and support, once and for all. r289369 (by emaste): newfs_msdos: rework option parsing to match NetBSD NetBSD split newfs_msdos in two so that they can reuse the file system creation part in makefs. This change is a step on the path of bringing that support to FreeBSD. Reviewed by: kib, pfg Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3905 r289376 (by emaste): newfs_msdos: move mkfs_msdos to separate file for later use in makefs Sponsored by: The FreeBSD Foundation r289424 (by emaste): newfs_msdos: prefer snprintf to sprintf Obtained from: NetBSD Sponsored by: The FreeBSD Foundation r291219 (by emaste): newfs_msdos: rework error handling for eventual use in makefs Return -1 on errors from mkfs_msdos() instead of err()/errx(), to allow different consumers to handle errors as appropriate. Obtained from: NetBSD Sponsored by: The FreeBSD Foundation r291382 (by emaste): mkfs_msdos: sync with NetBSD Add a sanity test and clean up whitespace. Obtained from: NetBSD r291385 (by emaste): Use netbsd usage() implementation in newfs_msdos In r289629 newfs_msdos option descriptions are available in mkfs_msdos.h. Obtained from: NetBSD r291908: Fix leak in mkfs_msdos(..) by initializing img to NULL and free'ing at the end of the function Differential Revision: https://reviews.freebsd.org/D4405 PR: 204943 Reviewed by: emaste, jilles Reported by: David Binderman Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/Makefile stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:00:21 2015 (r292167) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:09:46 2015 (r292168) @@ -62,7 +62,8 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: main.ih +main.o: debug.ih main.ih split.ih +split.o: split.ih r: re tests ./re #include +#include "debug.ih" #include "main.ih" +#include "split.ih" char *progname; int debug = 0; @@ -22,9 +24,6 @@ regoff_t startoff = 0; regoff_t endoff = 0; -extern int split(); -extern void regprint(); - /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:00:21 2015 (r292167) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:09:46 2015 (r292168) @@ -4,6 +4,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "split.ih" + /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-all@freebsd.org Sun Dec 13 21:14:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49580A431F2; Sun, 13 Dec 2015 21:14:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 027451255; Sun, 13 Dec 2015 21:14:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLE55b084209; Sun, 13 Dec 2015 21:14:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLE4WX084206; Sun, 13 Dec 2015 21:14:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132114.tBDLE4WX084206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:14: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: r292169 - stable/10/lib/libc/regex/grot 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:14:06 -0000 Author: ngie Date: Sun Dec 13 21:14:04 2015 New Revision: 292169 URL: https://svnweb.freebsd.org/changeset/base/292169 Log: Revert r292168 -- I used the wrong commit message by accident Modified: stable/10/lib/libc/regex/grot/Makefile stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:09:46 2015 (r292168) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:14:04 2015 (r292169) @@ -62,8 +62,7 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: debug.ih main.ih split.ih -split.o: split.ih +main.o: main.ih r: re tests ./re #include -#include "debug.ih" #include "main.ih" -#include "split.ih" char *progname; int debug = 0; @@ -24,6 +22,9 @@ regoff_t startoff = 0; regoff_t endoff = 0; +extern int split(); +extern void regprint(); + /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:09:46 2015 (r292168) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:14:04 2015 (r292169) @@ -4,8 +4,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "split.ih" - /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-all@freebsd.org Sun Dec 13 21:15:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53613A432F4; Sun, 13 Dec 2015 21:15:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06CA013BE; Sun, 13 Dec 2015 21:15:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLF46e084314; Sun, 13 Dec 2015 21:15:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLF3Xb084311; Sun, 13 Dec 2015 21:15:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132115.tBDLF3Xb084311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:15: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: r292170 - stable/10/lib/libc/regex/grot 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:15:05 -0000 Author: ngie Date: Sun Dec 13 21:15:03 2015 New Revision: 292170 URL: https://svnweb.freebsd.org/changeset/base/292170 Log: MFC r291837: split.ih: - Create automatically generated include header for split.c main.c: - Use function definitions from debug.ih and split.ih instead of externs Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/Makefile stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:14:04 2015 (r292169) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:15:03 2015 (r292170) @@ -62,7 +62,8 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: main.ih +main.o: debug.ih main.ih split.ih +split.o: split.ih r: re tests ./re #include +#include "debug.ih" #include "main.ih" +#include "split.ih" char *progname; int debug = 0; @@ -22,9 +24,6 @@ regoff_t startoff = 0; regoff_t endoff = 0; -extern int split(); -extern void regprint(); - /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:14:04 2015 (r292169) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:15:03 2015 (r292170) @@ -4,6 +4,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "split.ih" + /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-all@freebsd.org Sun Dec 13 21:15:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66F6A433CD; Sun, 13 Dec 2015 21:15:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCEF15AC; Sun, 13 Dec 2015 21:15:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLFuRa084404; Sun, 13 Dec 2015 21:15:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLFuHm084400; Sun, 13 Dec 2015 21:15:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132115.tBDLFuHm084400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292171 - stable/9/lib/libc/regex/grot 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:15:57 -0000 Author: ngie Date: Sun Dec 13 21:15:56 2015 New Revision: 292171 URL: https://svnweb.freebsd.org/changeset/base/292171 Log: MFstable/10 r292170: MFC r291837: split.ih: - Create automatically generated include header for split.c main.c: - Use function definitions from debug.ih and split.ih instead of externs Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/regex/grot/Makefile stable/9/lib/libc/regex/grot/main.c stable/9/lib/libc/regex/grot/split.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/regex/grot/Makefile ============================================================================== --- stable/9/lib/libc/regex/grot/Makefile Sun Dec 13 21:15:03 2015 (r292170) +++ stable/9/lib/libc/regex/grot/Makefile Sun Dec 13 21:15:56 2015 (r292171) @@ -62,7 +62,8 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: main.ih +main.o: debug.ih main.ih split.ih +split.o: split.ih r: re tests ./re #include +#include "debug.ih" #include "main.ih" +#include "split.ih" char *progname; int debug = 0; @@ -22,9 +24,6 @@ regoff_t startoff = 0; regoff_t endoff = 0; -extern int split(); -extern void regprint(); - /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/9/lib/libc/regex/grot/split.c ============================================================================== --- stable/9/lib/libc/regex/grot/split.c Sun Dec 13 21:15:03 2015 (r292170) +++ stable/9/lib/libc/regex/grot/split.c Sun Dec 13 21:15:56 2015 (r292171) @@ -4,6 +4,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "split.ih" + /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-all@freebsd.org Sun Dec 13 21:27:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9137EA43AA7; Sun, 13 Dec 2015 21:27:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 549D41B3C; Sun, 13 Dec 2015 21:27:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::6514:f4:a390:3c16] (unknown [IPv6:2001:7b8:3a7:0:6514:f4:a390:3c16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3259F1C263; Sun, 13 Dec 2015 22:27:18 +0100 (CET) Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1123F654-1F02-4ED7-8B95-DF645B1C170F"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Dimitry Andric In-Reply-To: <566DA52B.1050805@FreeBSD.org> Date: Sun, 13 Dec 2015 22:27:12 +0100 Cc: Kai Wang , Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ed Maste Message-Id: References: <201512112028.tBBKSRtn092966@repo.freebsd.org> <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> <566DA52B.1050805@FreeBSD.org> To: Ruslan Makhmatkhanov X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:27:21 -0000 --Apple-Mail=_1123F654-1F02-4ED7-8B95-DF645B1C170F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 13 Dec 2015, at 18:04, Ruslan Makhmatkhanov wrote: >=20 > Sorry for break in, but I tried to update to r292130 and have this = messages on `make kernel`. Does it by chance has something to do with = toolchain update and was it fixed in subsequent commits? Thanks. >=20 > =3D=3D=3D> zlib (install) > install -o root -g wheel -m 555 zlib.ko /boot/kernel/ > kldxref /boot/kernel > kldxref: unknown metadata record 4 in file atacard.ko > kldxref: unknown metadata record 4 in file atp.ko > kldxref: unknown metadata record 4 in file atp.ko > kldxref: unknown metadata record 4 in file cmx.ko > kldxref: unknown metadata record 4 in file fdc.ko > kldxref: unknown metadata record 4 in file if_an.ko > kldxref: unknown metadata record 4 in file if_aue.ko >=20 > [...] >=20 > It printed one this message for every kernel module. I think this is fixed by Warner's r292078: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D292078 Augment kldxref to find the new MODULE_PNP_INFO records now in modules, simplify them into a more normal form and write them to linker.hints. Differential Review: https://reviews.freebsd.org/D3461 -Dimitry --Apple-Mail=_1123F654-1F02-4ED7-8B95-DF645B1C170F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.28 iEYEARECAAYFAlZt4rUACgkQsF6jCi4glqMoeQCeIHZC0wZKaKPBhv5MuzqwjavI BIUAoKSk52rh3VKFgGUKC0QoB/CAE5zE =sfRq -----END PGP SIGNATURE----- --Apple-Mail=_1123F654-1F02-4ED7-8B95-DF645B1C170F-- From owner-svn-src-all@freebsd.org Sun Dec 13 21:31:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D79BA43D5B; Sun, 13 Dec 2015 21:31:47 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3AD41DC5; Sun, 13 Dec 2015 21:31:46 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLVkPU087711; Sun, 13 Dec 2015 21:31:46 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLVksx087710; Sun, 13 Dec 2015 21:31:46 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201512132131.tBDLVksx087710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Sun, 13 Dec 2015 21:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292172 - head/usr.bin/unzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:31:47 -0000 Author: ak (ports committer) Date: Sun Dec 13 21:31:45 2015 New Revision: 292172 URL: https://svnweb.freebsd.org/changeset/base/292172 Log: - Properly set mode and atime/ctime for symlinks Approved by: des Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Sun Dec 13 21:15:56 2015 (r292171) +++ head/usr.bin/unzip/unzip.c Sun Dec 13 21:31:45 2015 (r292172) @@ -127,7 +127,6 @@ errorx(const char *fmt, ...) exit(1); } -#if 0 /* non-fatal error message + errno */ static void warning(const char *fmt, ...) @@ -143,7 +142,6 @@ warning(const char *fmt, ...) va_end(ap); fprintf(stderr, ": %s\n", strerror(errno)); } -#endif /* non-fatal error message, no errno */ static void @@ -539,12 +537,21 @@ recheck: return; } + ts[0].tv_sec = 0; + ts[0].tv_nsec = UTIME_NOW; + ts[1] = mtime; + /* process symlinks */ linkname = archive_entry_symlink(e); if (linkname != NULL) { - if (symlink(linkname, *path) < 0) + if (symlink(linkname, *path) != 0) error("symlink('%s')", *path); info(" extracting: %s -> %s\n", *path, linkname); + if (lchmod(*path, mode) != 0) + warning("Cannot set mode for '%s'", *path); + /* set access and modification time */ + if (utimensat(AT_FDCWD, *path, ts, AT_SYMLINK_NOFOLLOW) != 0) + warning("utimensat('%s')", *path); return; } @@ -629,9 +636,6 @@ recheck: info("\n"); /* set access and modification time */ - ts[0].tv_sec = 0; - ts[0].tv_nsec = UTIME_NOW; - ts[1] = mtime; if (futimens(fd, ts) != 0) error("futimens('%s')", *path); if (close(fd) != 0) From owner-svn-src-all@freebsd.org Sun Dec 13 21:43:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17D81A42903; Sun, 13 Dec 2015 21:43:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C31A41798; Sun, 13 Dec 2015 21:43:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLhsK9093330; Sun, 13 Dec 2015 21:43:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLhshC093329; Sun, 13 Dec 2015 21:43:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132143.tBDLhshC093329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 21:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292173 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:43:56 -0000 Author: avos Date: Sun Dec 13 21:43:54 2015 New Revision: 292173 URL: https://svnweb.freebsd.org/changeset/base/292173 Log: urtwn(4): setup channel frequency/flags for radiotap in urtwn_set_channel() Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3832 Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 21:31:45 2015 (r292172) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 21:43:54 2015 (r292173) @@ -754,8 +754,6 @@ urtwn_rx_frame(struct urtwn_softc *sc, u } tap->wr_dbm_antsignal = rssi; tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR; - tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); - tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); } *rssi_p = rssi; @@ -2416,8 +2414,6 @@ urtwn_tx_data(struct urtwn_softc *sc, st struct urtwn_tx_radiotap_header *tap = &sc->sc_txtap; tap->wt_flags = 0; - tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); - tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; ieee80211_radiotap_tx(vap, m); @@ -3725,6 +3721,7 @@ static void urtwn_set_channel(struct ieee80211com *ic) { struct urtwn_softc *sc = ic->ic_softc; + struct ieee80211_channel *c = ic->ic_curchan; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); URTWN_LOCK(sc); @@ -3732,7 +3729,11 @@ urtwn_set_channel(struct ieee80211com *i /* Make link LED blink during scan. */ urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); } - urtwn_set_chan(sc, ic->ic_curchan, NULL); + urtwn_set_chan(sc, c, NULL); + sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq); + sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags); + sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq); + sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags); URTWN_UNLOCK(sc); } From owner-svn-src-all@freebsd.org Sun Dec 13 21:50:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EFABA42EE6; Sun, 13 Dec 2015 21:50:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 510771BA3; Sun, 13 Dec 2015 21:50:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLocbg093733; Sun, 13 Dec 2015 21:50:38 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLockD093731; Sun, 13 Dec 2015 21:50:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132150.tBDLockD093731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 21:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292174 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 21:50:39 -0000 Author: avos Date: Sun Dec 13 21:50:38 2015 New Revision: 292174 URL: https://svnweb.freebsd.org/changeset/base/292174 Log: urtwn: add a command queue for sleepable tasks. An implementation from rum(4) was used (it looks simpler for me). Will be used for h/w encryption support. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4447 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 21:43:54 2015 (r292173) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 21:50:38 2015 (r292174) @@ -213,6 +213,9 @@ static uint16_t urtwn_read_2(struct urt static uint32_t urtwn_read_4(struct urtwn_softc *, uint16_t); static int urtwn_fw_cmd(struct urtwn_softc *, uint8_t, const void *, int); +static void urtwn_cmdq_cb(void *, int); +static int urtwn_cmd_sleepable(struct urtwn_softc *, const void *, + size_t, CMD_FUNC_PROTO); static void urtwn_r92c_rf_write(struct urtwn_softc *, int, uint8_t, uint32_t); static void urtwn_r88e_rf_write(struct urtwn_softc *, int, @@ -427,6 +430,7 @@ urtwn_attach(device_t self) mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); + URTWN_CMDQ_LOCK_INIT(sc); URTWN_NT_LOCK_INIT(sc); callout_init(&sc->sc_watchdog_ch, 0); mbufq_init(&sc->sc_snd, ifqmaxlen); @@ -525,6 +529,8 @@ urtwn_attach(device_t self) &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap), URTWN_RX_RADIOTAP_PRESENT); + TASK_INIT(&sc->cmdq_task, 0, urtwn_cmdq_cb, sc); + if (bootverbose) ieee80211_announce(ic); @@ -574,8 +580,13 @@ urtwn_detach(device_t self) urtwn_free_rx_list(sc); URTWN_UNLOCK(sc); - ieee80211_ifdetach(ic); + if (ic->ic_softc == sc) { + ieee80211_draintask(ic, &sc->cmdq_task); + ieee80211_ifdetach(ic); + } + URTWN_NT_LOCK_DESTROY(sc); + URTWN_CMDQ_LOCK_DESTROY(sc); mtx_destroy(&sc->sc_mtx); return (0); @@ -1259,6 +1270,64 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin return (0); } +static void +urtwn_cmdq_cb(void *arg, int pending) +{ + struct urtwn_softc *sc = arg; + struct urtwn_cmdq *item; + + /* + * Device must be powered on (via urtwn_power_on()) + * before any command may be sent. + */ + URTWN_LOCK(sc); + if (!(sc->sc_flags & URTWN_RUNNING)) { + URTWN_UNLOCK(sc); + return; + } + + URTWN_CMDQ_LOCK(sc); + while (sc->cmdq[sc->cmdq_first].func != NULL) { + item = &sc->cmdq[sc->cmdq_first]; + sc->cmdq_first = (sc->cmdq_first + 1) % URTWN_CMDQ_SIZE; + URTWN_CMDQ_UNLOCK(sc); + + item->func(sc, &item->data); + + URTWN_CMDQ_LOCK(sc); + memset(item, 0, sizeof (*item)); + } + URTWN_CMDQ_UNLOCK(sc); + URTWN_UNLOCK(sc); +} + +static int +urtwn_cmd_sleepable(struct urtwn_softc *sc, const void *ptr, size_t len, + CMD_FUNC_PROTO) +{ + struct ieee80211com *ic = &sc->sc_ic; + + KASSERT(len <= sizeof(union sec_param), ("buffer overflow")); + + URTWN_CMDQ_LOCK(sc); + if (sc->cmdq[sc->cmdq_last].func != NULL) { + device_printf(sc->sc_dev, "%s: cmdq overflow\n", __func__); + URTWN_CMDQ_UNLOCK(sc); + + return (EAGAIN); + } + + if (ptr != NULL) + memcpy(&sc->cmdq[sc->cmdq_last].data, ptr, len); + sc->cmdq[sc->cmdq_last].func = func; + sc->cmdq_last = (sc->cmdq_last + 1) % URTWN_CMDQ_SIZE; + URTWN_CMDQ_UNLOCK(sc); + + ieee80211_runtask(ic, &sc->cmdq_task); + + return (0); +} + static __inline void urtwn_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, uint32_t val) { Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 21:43:54 2015 (r292173) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 21:50:38 2015 (r292174) @@ -71,15 +71,18 @@ struct urtwn_data { }; typedef STAILQ_HEAD(, urtwn_data) urtwn_datahead; +union sec_param { + struct ieee80211_key key; +}; + +#define CMD_FUNC_PROTO void (*func)(struct urtwn_softc *, \ + union sec_param *) + struct urtwn_cmdq { - void *arg0; - void *arg1; - void (*func)(void *); - struct ieee80211_key *k; - struct ieee80211_key key; - uint8_t mac[IEEE80211_ADDR_LEN]; - uint8_t wcid; + union sec_param data; + CMD_FUNC_PROTO; }; +#define URTWN_CMDQ_SIZE 16 struct urtwn_fw_info { const uint8_t *data; @@ -203,17 +206,11 @@ struct urtwn_softc { struct callout sc_watchdog_ch; struct mtx sc_mtx; -/* need to be power of 2, otherwise URTWN_CMDQ_GET fails */ -#define URTWN_CMDQ_MAX 16 -#define URTWN_CMDQ_MASQ (URTWN_CMDQ_MAX - 1) - struct urtwn_cmdq cmdq[URTWN_CMDQ_MAX]; + struct urtwn_cmdq cmdq[URTWN_CMDQ_SIZE]; + struct mtx cmdq_mtx; struct task cmdq_task; - uint32_t cmdq_store; - uint8_t cmdq_exec; - uint8_t cmdq_run; - uint8_t cmdq_key_set; -#define URTWN_CMDQ_ABORT 0 -#define URTWN_CMDQ_GO 1 + uint8_t cmdq_first; + uint8_t cmdq_last; uint32_t rf_chnlbw[R92C_MAX_CHAINS]; struct usb_xfer *sc_xfer[URTWN_N_TRANSFER]; @@ -226,6 +223,12 @@ struct urtwn_softc { #define URTWN_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define URTWN_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) +#define URTWN_CMDQ_LOCK_INIT(sc) \ + mtx_init(&(sc)->cmdq_mtx, "cmdq lock", NULL, MTX_DEF) +#define URTWN_CMDQ_LOCK(sc) mtx_lock(&(sc)->cmdq_mtx) +#define URTWN_CMDQ_UNLOCK(sc) mtx_unlock(&(sc)->cmdq_mtx) +#define URTWN_CMDQ_LOCK_DESTROY(sc) mtx_destroy(&(sc)->cmdq_mtx) + #define URTWN_NT_LOCK_INIT(sc) \ mtx_init(&(sc)->nt_mtx, "node table lock", NULL, MTX_DEF) #define URTWN_NT_LOCK(sc) mtx_lock(&(sc)->nt_mtx) From owner-svn-src-all@freebsd.org Sun Dec 13 22:00:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78641A43580; Sun, 13 Dec 2015 22:00:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3797E1139; Sun, 13 Dec 2015 22:00:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDM0K89098745; Sun, 13 Dec 2015 22:00:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDM0KZ2098742; Sun, 13 Dec 2015 22:00:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132200.tBDM0KZ2098742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 22:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292175 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 22:00:21 -0000 Author: avos Date: Sun Dec 13 22:00:19 2015 New Revision: 292175 URL: https://svnweb.freebsd.org/changeset/base/292175 Log: urtwn: add support for hardware encryption (WEP, TKIP and CCMP) Tested with: - RTL8188EU; - RTL8188CUS; Modes: - IBSS mode: TKIP, CCMP (WPA-None); - STA / HOSTAP modes - WEP (static), TKIP, CCMP; Reviewed by: kevlo Approved by: adrian (mentor) Obtained from: OpenBSD (mostly) Differential Revision: https://reviews.freebsd.org/D4448 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 21:50:38 2015 (r292174) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 22:00:19 2015 (r292175) @@ -244,6 +244,17 @@ static int urtwn_setup_beacon(struct ur static void urtwn_update_beacon(struct ieee80211vap *, int); static int urtwn_tx_beacon(struct urtwn_softc *sc, struct urtwn_vap *); +static int urtwn_key_alloc(struct ieee80211vap *, + struct ieee80211_key *, ieee80211_keyix *, + ieee80211_keyix *); +static void urtwn_key_set_cb(struct urtwn_softc *, + union sec_param *); +static void urtwn_key_del_cb(struct urtwn_softc *, + union sec_param *); +static int urtwn_key_set(struct ieee80211vap *, + const struct ieee80211_key *); +static int urtwn_key_delete(struct ieee80211vap *, + const struct ieee80211_key *); static void urtwn_tsf_task_adhoc(void *, int); static void urtwn_tsf_sync_enable(struct urtwn_softc *, struct ieee80211vap *); @@ -279,6 +290,8 @@ static int urtwn_mac_init(struct urtwn_ static void urtwn_bb_init(struct urtwn_softc *); static void urtwn_rf_init(struct urtwn_softc *); static void urtwn_cam_init(struct urtwn_softc *); +static int urtwn_cam_write(struct urtwn_softc *, uint32_t, + uint32_t); static void urtwn_pa_bias_init(struct urtwn_softc *); static void urtwn_rxfilter_init(struct urtwn_softc *); static void urtwn_edca_init(struct urtwn_softc *); @@ -500,6 +513,11 @@ urtwn_attach(device_t self) | IEEE80211_C_WME /* 802.11e */ ; + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP | + IEEE80211_CRYPTO_TKIP | + IEEE80211_CRYPTO_AES_CCM; + bands = 0; setbit(&bands, IEEE80211_MODE_11B); setbit(&bands, IEEE80211_MODE_11G); @@ -659,6 +677,9 @@ urtwn_vap_create(struct ieee80211com *ic uvp->newstate = vap->iv_newstate; vap->iv_newstate = urtwn_newstate; vap->iv_update_beacon = urtwn_update_beacon; + vap->iv_key_alloc = urtwn_key_alloc; + vap->iv_key_set = urtwn_key_set; + vap->iv_key_delete = urtwn_key_delete; if (opmode == IEEE80211_M_IBSS) { uvp->recv_mgmt = vap->iv_recv_mgmt; vap->iv_recv_mgmt = urtwn_ibss_recv_mgmt; @@ -699,7 +720,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u struct mbuf *m; struct r92c_rx_stat *stat; uint32_t rxdw0, rxdw3; - uint8_t rate; + uint8_t rate, cipher; int8_t rssi = 0; int infosz; @@ -729,6 +750,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u } rate = MS(rxdw3, R92C_RXDW3_RATE); + cipher = MS(rxdw0, R92C_RXDW0_CIPHER); infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8; /* Get RSSI from PHY status descriptor if present. */ @@ -748,9 +770,14 @@ urtwn_rx_frame(struct urtwn_softc *sc, u } /* Finalize mbuf. */ - wh = (struct ieee80211_frame *)((uint8_t *)&stat[1] + infosz); - memcpy(mtod(m, uint8_t *), wh, pktlen); - m->m_pkthdr.len = m->m_len = pktlen; + memcpy(mtod(m, uint8_t *), (uint8_t *)&stat[1] + infosz, pktlen); + m->m_pkthdr.len = m->m_len = pktlen; + wh = mtod(m, struct ieee80211_frame *); + + if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && + cipher != R92C_CAM_ALGO_NONE) { + m->m_flags |= M_WEP; + } if (ieee80211_radiotap_active(ic)) { struct urtwn_rx_radiotap_header *tap = &sc->sc_rxtap; @@ -1862,6 +1889,153 @@ urtwn_tx_beacon(struct urtwn_softc *sc, return (0); } +static int +urtwn_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, + ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) +{ + struct urtwn_softc *sc = vap->iv_ic->ic_softc; + uint8_t i; + + if (!(&vap->iv_nw_keys[0] <= k && + k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { + if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { + URTWN_LOCK(sc); + /* + * First 4 slots for group keys, + * what is left - for pairwise. + * XXX incompatible with IBSS RSN. + */ + for (i = IEEE80211_WEP_NKID; + i < R92C_CAM_ENTRY_COUNT; i++) { + if ((sc->keys_bmap & (1 << i)) == 0) { + sc->keys_bmap |= 1 << i; + *keyix = i; + break; + } + } + URTWN_UNLOCK(sc); + if (i == R92C_CAM_ENTRY_COUNT) { + device_printf(sc->sc_dev, + "%s: no free space in the key table\n", + __func__); + return 0; + } + } else + *keyix = 0; + } else { + *keyix = k - vap->iv_nw_keys; + } + *rxkeyix = *keyix; + return 1; +} + +static void +urtwn_key_set_cb(struct urtwn_softc *sc, union sec_param *data) +{ + struct ieee80211_key *k = &data->key; + uint8_t algo, keyid; + int i, error; + + if (k->wk_keyix < IEEE80211_WEP_NKID) + keyid = k->wk_keyix; + else + keyid = 0; + + /* Map net80211 cipher to HW crypto algorithm. */ + switch (k->wk_cipher->ic_cipher) { + case IEEE80211_CIPHER_WEP: + if (k->wk_keylen < 8) + algo = R92C_CAM_ALGO_WEP40; + else + algo = R92C_CAM_ALGO_WEP104; + break; + case IEEE80211_CIPHER_TKIP: + algo = R92C_CAM_ALGO_TKIP; + break; + case IEEE80211_CIPHER_AES_CCM: + algo = R92C_CAM_ALGO_AES; + break; + default: + device_printf(sc->sc_dev, "%s: undefined cipher %d\n", + __func__, k->wk_cipher->ic_cipher); + return; + } + + DPRINTFN(9, "keyix %d, keyid %d, algo %d/%d, flags %04X, len %d, " + "macaddr %s\n", k->wk_keyix, keyid, k->wk_cipher->ic_cipher, algo, + k->wk_flags, k->wk_keylen, ether_sprintf(k->wk_macaddr)); + + /* Write key. */ + for (i = 0; i < 4; i++) { + error = urtwn_cam_write(sc, R92C_CAM_KEY(k->wk_keyix, i), + LE_READ_4(&k->wk_key[i * 4])); + if (error != 0) + goto fail; + } + + /* Write CTL0 last since that will validate the CAM entry. */ + error = urtwn_cam_write(sc, R92C_CAM_CTL1(k->wk_keyix), + LE_READ_4(&k->wk_macaddr[2])); + if (error != 0) + goto fail; + error = urtwn_cam_write(sc, R92C_CAM_CTL0(k->wk_keyix), + SM(R92C_CAM_ALGO, algo) | + SM(R92C_CAM_KEYID, keyid) | + SM(R92C_CAM_MACLO, LE_READ_2(&k->wk_macaddr[0])) | + R92C_CAM_VALID); + if (error != 0) + goto fail; + + return; + +fail: + device_printf(sc->sc_dev, "%s fails, error %d\n", __func__, error); +} + +static void +urtwn_key_del_cb(struct urtwn_softc *sc, union sec_param *data) +{ + struct ieee80211_key *k = &data->key; + int i; + + DPRINTFN(9, "keyix %d, flags %04X, macaddr %s\n", + k->wk_keyix, k->wk_flags, ether_sprintf(k->wk_macaddr)); + + urtwn_cam_write(sc, R92C_CAM_CTL0(k->wk_keyix), 0); + urtwn_cam_write(sc, R92C_CAM_CTL1(k->wk_keyix), 0); + + /* Clear key. */ + for (i = 0; i < 4; i++) + urtwn_cam_write(sc, R92C_CAM_KEY(k->wk_keyix, i), 0); + sc->keys_bmap &= ~(1 << k->wk_keyix); +} + +static int +urtwn_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + struct urtwn_softc *sc = vap->iv_ic->ic_softc; + + if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { + /* Not for us. */ + return (1); + } + + return (!urtwn_cmd_sleepable(sc, k, sizeof(*k), urtwn_key_set_cb)); +} + +static int +urtwn_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + struct urtwn_softc *sc = vap->iv_ic->ic_softc; + + if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { + /* Not for us. */ + return (1); + } + + return (!urtwn_cmd_sleepable(sc, k, sizeof(*k), urtwn_key_del_cb)); +} + static void urtwn_tsf_task_adhoc(void *arg, int pending) { @@ -2479,6 +2653,26 @@ urtwn_tx_data(struct urtwn_softc *sc, st txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); } + if (k != NULL && !(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { + uint8_t cipher; + + switch (k->wk_cipher->ic_cipher) { + case IEEE80211_CIPHER_WEP: + case IEEE80211_CIPHER_TKIP: + cipher = R92C_TXDW1_CIPHER_RC4; + break; + case IEEE80211_CIPHER_AES_CCM: + cipher = R92C_TXDW1_CIPHER_AES; + break; + default: + device_printf(sc->sc_dev, "%s: unknown cipher %d\n", + __func__, k->wk_cipher->ic_cipher); + return (EINVAL); + } + + txd->txdw1 |= htole32(SM(R92C_TXDW1_CIPHER, cipher)); + } + if (ieee80211_radiotap_active_vap(vap)) { struct urtwn_tx_radiotap_header *tap = &sc->sc_txtap; @@ -3383,6 +3577,23 @@ urtwn_cam_init(struct urtwn_softc *sc) R92C_CAMCMD_POLLING | R92C_CAMCMD_CLR); } +static int +urtwn_cam_write(struct urtwn_softc *sc, uint32_t addr, uint32_t data) +{ + usb_error_t error; + + error = urtwn_write_4(sc, R92C_CAMWRITE, data); + if (error != USB_ERR_NORMAL_COMPLETION) + return (EIO); + error = urtwn_write_4(sc, R92C_CAMCMD, + R92C_CAMCMD_POLLING | R92C_CAMCMD_WRITE | + SM(R92C_CAMCMD_ADDR, addr)); + if (error != USB_ERR_NORMAL_COMPLETION) + return (EIO); + + return (0); +} + static void urtwn_pa_bias_init(struct urtwn_softc *sc) { @@ -4271,6 +4482,18 @@ urtwn_init(struct urtwn_softc *sc) /* Clear per-station keys table. */ urtwn_cam_init(sc); + /* Enable decryption / encryption. */ + urtwn_write_2(sc, R92C_SECCFG, + R92C_SECCFG_TXUCKEY_DEF | R92C_SECCFG_RXUCKEY_DEF | + R92C_SECCFG_TXENC_ENA | R92C_SECCFG_RXDEC_ENA | + R92C_SECCFG_TXBCKEY_DEF | R92C_SECCFG_RXBCKEY_DEF); + + /* + * Install static keys (if any). + * Must be called after urtwn_cam_init(). + */ + ieee80211_runtask(ic, &sc->cmdq_task); + /* Enable hardware sequence numbering. */ urtwn_write_1(sc, R92C_HWSEQ_CTRL, 0xff); Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Sun Dec 13 21:50:38 2015 (r292174) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Sun Dec 13 22:00:19 2015 (r292175) @@ -557,6 +557,16 @@ #define R92C_CAMCMD_CLR 0x40000000 #define R92C_CAMCMD_POLLING 0x80000000 +/* Bits for R92C_SECCFG. */ +#define R92C_SECCFG_TXUCKEY_DEF 0x0001 +#define R92C_SECCFG_RXUCKEY_DEF 0x0002 +#define R92C_SECCFG_TXENC_ENA 0x0004 +#define R92C_SECCFG_RXDEC_ENA 0x0008 +#define R92C_SECCFG_CMP_A2 0x0010 +#define R92C_SECCFG_TXBCKEY_DEF 0x0040 +#define R92C_SECCFG_RXBCKEY_DEF 0x0080 +#define R88E_SECCFG_CHK_KEYID 0x0100 + /* Bits for R92C_RXFLTMAP*. */ #define R92C_RXFLTMAP_SUBTYPE(subtype) \ (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) @@ -968,6 +978,8 @@ struct r92c_rx_stat { #define R92C_RXDW0_ICVERR 0x00008000 #define R92C_RXDW0_INFOSZ_M 0x000f0000 #define R92C_RXDW0_INFOSZ_S 16 +#define R92C_RXDW0_CIPHER_M 0x00700000 +#define R92C_RXDW0_CIPHER_S 20 #define R92C_RXDW0_QOS 0x00800000 #define R92C_RXDW0_SHIFT_M 0x03000000 #define R92C_RXDW0_SHIFT_S 24 Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 21:50:38 2015 (r292174) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 22:00:19 2015 (r292175) @@ -205,6 +205,7 @@ struct urtwn_softc { struct callout sc_watchdog_ch; struct mtx sc_mtx; + uint32_t keys_bmap; struct urtwn_cmdq cmdq[URTWN_CMDQ_SIZE]; struct mtx cmdq_mtx; From owner-svn-src-all@freebsd.org Sun Dec 13 22:03:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67759A43821 for ; Sun, 13 Dec 2015 22:03:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1E41596 for ; Sun, 13 Dec 2015 22:03:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgfb51 with SMTP id b51so33864935qgf.3 for ; Sun, 13 Dec 2015 14:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=W6UMzcbm+eDnXuk8O8OWTdU6NAMOuhG763BiRfLlcME=; b=YpOqBfMSbmt+2Jv0sfuaSQ78DZQ6edsEFmcZ4lptqopTKaaz4k9OBMelX5uOIGo+xj CNOz2fJcKNcQ35JUst1gt4uJ0BN1XOHj0AIdtjn/3hFfyoKDjjRzykZYAT11UkIDS+gI UbtxB6ZTQGrtZna3yrRzci03duB6tyWnWpWp+Xn+5lfPZhbLcKif8CNr2ER7KhWLsfTj eG6Ca+MDe/LIKqOww/QS0MJEUv6TlaBCtGhv8F2dARfq6uepBDuX64LueJmE9NMh0+TV JkTqF+RNEVfk/p1vGc4XtuFs9SOiaVkdSgbAVPC67kHbqQWbYH9dGjISHtLQfbLwOlsT 0Czw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=W6UMzcbm+eDnXuk8O8OWTdU6NAMOuhG763BiRfLlcME=; b=Zt3CTQLyCLkjcjsSodfpaiQ/PqyIxilWOM/1r7K3ngGWp9a3I/gchNQkM7aknv+yhj oOvotv73B2BxyagBcEz9ZZS1PFeQlndBXg1imulJigVFnQ/SWbzG4pUP6IRwZelIfzzS aQIavWSGN48hxju07p+kFUttbDvPuKQm+/vqnU2rGV4xKHA1U+pR+dGeK615J5zLEyvz ftmligutYAaBcowgFWazUmUUNZCh+q6o7lVNGiOJSQR3/Vus6tsWaoaE3bry6mU/hTrl XB9+pAbDSbKUf8g+Bpw7cllasWrauWtGwiXMd2SYKn3Wvl1c6FdiIUg854mT8Md93TFc lo9A== X-Gm-Message-State: ALoCoQniQ60wdoZiUwj60igD1DmamZpvmzOzgmDiCLmO+rJmDwxmhrHlbO2b/hgN5MGYFUIC4rO+MGXii+4RseuaqbPyzon4nA== MIME-Version: 1.0 X-Received: by 10.140.40.38 with SMTP id w35mr38002635qgw.52.1450044182204; Sun, 13 Dec 2015 14:03:02 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Sun, 13 Dec 2015 14:03:02 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201512112028.tBBKSRtn092966@repo.freebsd.org> <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> <566DA52B.1050805@FreeBSD.org> Date: Sun, 13 Dec 2015 15:03:02 -0700 X-Google-Sender-Auth: RAbp29F9XljDVbRRZeBeWtJ_Vms Message-ID: Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf From: Warner Losh To: Dimitry Andric Cc: Ruslan Makhmatkhanov , Kai Wang , Adrian Chadd , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ed Maste Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 22:03:03 -0000 On Sun, Dec 13, 2015 at 2:27 PM, Dimitry Andric wrote: > On 13 Dec 2015, at 18:04, Ruslan Makhmatkhanov wrote: > > > > Sorry for break in, but I tried to update to r292130 and have this > messages on `make kernel`. Does it by chance has something to do with > toolchain update and was it fixed in subsequent commits? Thanks. > > > > ===> zlib (install) > > install -o root -g wheel -m 555 zlib.ko /boot/kernel/ > > kldxref /boot/kernel > > kldxref: unknown metadata record 4 in file atacard.ko > > kldxref: unknown metadata record 4 in file atp.ko > > kldxref: unknown metadata record 4 in file atp.ko > > kldxref: unknown metadata record 4 in file cmx.ko > > kldxref: unknown metadata record 4 in file fdc.ko > > kldxref: unknown metadata record 4 in file if_an.ko > > kldxref: unknown metadata record 4 in file if_aue.ko > > > > [...] > > > > It printed one this message for every kernel module. > > I think this is fixed by Warner's r292078: > > https://svnweb.freebsd.org/base?view=revision&revision=292078 > > Augment kldxref to find the new MODULE_PNP_INFO records now in > modules, simplify them into a more normal form and write them to > linker.hints. > > Differential Review: > https://reviews.freebsd.org/D3461 Yes. Perhaps I should have dropped an UPDATING entry to explain this. I thought I'd actually committed something so that it was silent when kldxref didn't understand a metadata record a long time ago so this sort of thing wouldn't happen. I thought I'd merged it last summer in anticipation of this work landing. What is your build environment? The message has 0 to do with the toolchain update. It's all about the new PNP info in the kernel modules. Warner From owner-svn-src-all@freebsd.org Sun Dec 13 22:08:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23DFA43B71; Sun, 13 Dec 2015 22:08:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A043C188F; Sun, 13 Dec 2015 22:08:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDM8RuV001719; Sun, 13 Dec 2015 22:08:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDM8Rp0001715; Sun, 13 Dec 2015 22:08:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512132208.tBDM8Rp0001715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 13 Dec 2015 22:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292176 - in head/sys/dev: usb/wlan wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 22:08:29 -0000 Author: avos Date: Sun Dec 13 22:08:27 2015 New Revision: 292176 URL: https://svnweb.freebsd.org/changeset/base/292176 Log: wpi, rum and urtwn: update copyright headers Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4489 Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sun Dec 13 22:00:19 2015 (r292175) +++ head/sys/dev/usb/wlan/if_rum.c Sun Dec 13 22:08:27 2015 (r292176) @@ -4,6 +4,7 @@ * Copyright (c) 2005-2007 Damien Bergamini * Copyright (c) 2006 Niall O'Higgins * Copyright (c) 2007-2008 Hans Petter Selasky + * Copyright (c) 2015 Andriy Voskoboinyk * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 22:00:19 2015 (r292175) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 13 22:08:27 2015 (r292176) @@ -3,6 +3,7 @@ /*- * Copyright (c) 2010 Damien Bergamini * Copyright (c) 2014 Kevin Lo + * Copyright (c) 2015 Andriy Voskoboinyk * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Dec 13 22:00:19 2015 (r292175) +++ head/sys/dev/wpi/if_wpi.c Sun Dec 13 22:08:27 2015 (r292176) @@ -2,6 +2,7 @@ * Copyright (c) 2006,2007 * Damien Bergamini * Benjamin Close + * Copyright (c) 2015 Andriy Voskoboinyk * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun Dec 13 22:00:19 2015 (r292175) +++ head/sys/dev/wpi/if_wpi_debug.h Sun Dec 13 22:08:27 2015 (r292176) @@ -2,6 +2,7 @@ * Copyright (c) 2006,2007 * Damien Bergamini * Benjamin Close + * Copyright (c) 2015 Andriy Voskoboinyk * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above From owner-svn-src-all@freebsd.org Sun Dec 13 22:11:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8227FA43E7A; Sun, 13 Dec 2015 22:11:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55D361B0E; Sun, 13 Dec 2015 22:11:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDMBbAH001887; Sun, 13 Dec 2015 22:11:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDMBbxN001886; Sun, 13 Dec 2015 22:11:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512132211.tBDMBbxN001886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 13 Dec 2015 22:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292177 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 13 Dec 2015 22:11:38 -0000 Author: imp Date: Sun Dec 13 22:11:37 2015 New Revision: 292177 URL: https://svnweb.freebsd.org/changeset/base/292177 Log: The new pnp module records causes older kldxref to spew some warnings. Make a note of it to inform people how to get around it. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Dec 13 22:08:27 2015 (r292176) +++ head/UPDATING Sun Dec 13 22:11:37 2015 (r292177) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20151211: + The code to start recording plug and play data into the modules has + been committed. While the old tools will properly build a new kernel, + a number of warnings about "unknown metadata record 4" will be produced + for an older kldxref. To avoid such warnings, make sure to rebuild + the kernel toolchain (or world). Make sure that you have r292078 or + later when trying to build 292077 or later before rebuilding. + 20151207: Debug data files are now built by default with 'make buildworld' and installed with 'make installworld'. This facilitates debugging but From owner-svn-src-all@freebsd.org Mon Dec 14 01:09:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C3BA04984; Mon, 14 Dec 2015 01:09:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A76105B; Mon, 14 Dec 2015 01:09:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE19RZl054842; Mon, 14 Dec 2015 01:09:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE19Pr1054828; Mon, 14 Dec 2015 01:09:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512140109.tBE19Pr1054828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 14 Dec 2015 01:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292180 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/lpc arm/ti dev/mmc dev/mmc/host dev/sdhci powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 01:09:28 -0000 Author: ian Date: Mon Dec 14 01:09:25 2015 New Revision: 292180 URL: https://svnweb.freebsd.org/changeset/base/292180 Log: Move the DRIVER_MODULE() statements that declare mmc(4) to be a child of the various bridge drivers out of dev/mmc.c and into the bridge drivers. Requested by: jhb (almost two years ago; better late than never) Modified: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/at91/at91_mci.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/lpc/lpc_mmc.c head/sys/arm/ti/ti_sdhci.c head/sys/dev/mmc/bridge.h head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/mmc.c head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_pci.c head/sys/powerpc/mpc85xx/fsl_sdhc.c Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/allwinner/a10_mmc.c Mon Dec 14 01:09:25 2015 (r292180) @@ -883,3 +883,4 @@ static driver_t a10_mmc_driver = { }; DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, 0, 0); +DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c Mon Dec 14 01:09:25 2015 (r292180) @@ -1098,3 +1098,4 @@ static devclass_t aml8726_mmc_devclass; DRIVER_MODULE(aml8726_mmc, simplebus, aml8726_mmc_driver, aml8726_mmc_devclass, 0, 0); MODULE_DEPEND(aml8726_mmc, aml8726_gpio, 1, 1, 1); +DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Mon Dec 14 01:09:25 2015 (r292180) @@ -1377,3 +1377,4 @@ static devclass_t aml8726_sdxc_devclass; DRIVER_MODULE(aml8726_sdxc, simplebus, aml8726_sdxc_driver, aml8726_sdxc_devclass, 0, 0); MODULE_DEPEND(aml8726_sdxc, aml8726_gpio, 1, 1, 1); +DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/at91/at91_mci.c Mon Dec 14 01:09:25 2015 (r292180) @@ -1412,3 +1412,4 @@ DRIVER_MODULE(at91_mci, simplebus, at91_ DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, NULL, NULL); #endif +DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Dec 14 01:09:25 2015 (r292180) @@ -675,3 +675,4 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); +DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/freescale/imx/imx_sdhci.c Mon Dec 14 01:09:25 2015 (r292180) @@ -827,4 +827,4 @@ static driver_t imx_sdhci_driver = { DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); - +DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/lpc/lpc_mmc.c Mon Dec 14 01:09:25 2015 (r292180) @@ -775,3 +775,4 @@ static driver_t lpc_mmc_driver = { }; DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, 0, 0); +DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/arm/ti/ti_sdhci.c Mon Dec 14 01:09:25 2015 (r292180) @@ -721,3 +721,4 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/dev/mmc/bridge.h ============================================================================== --- head/sys/dev/mmc/bridge.h Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/dev/mmc/bridge.h Mon Dec 14 01:09:25 2015 (r292180) @@ -54,6 +54,8 @@ #ifndef DEV_MMC_BRIDGE_H #define DEV_MMC_BRIDGE_H +#include + /* * This file defines interfaces for the mmc bridge. The names chosen * are similar to or the same as the names used in Linux to allow for @@ -135,4 +137,7 @@ struct mmc_host { struct mmc_ios ios; /* Current state of the host */ }; +extern driver_t mmc_driver; +extern devclass_t mmc_devclass; + #endif /* DEV_MMC_BRIDGE_H */ Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/dev/mmc/host/dwmmc.c Mon Dec 14 01:09:25 2015 (r292180) @@ -1177,4 +1177,4 @@ static devclass_t dwmmc_devclass; DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, 0, 0); - +DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/dev/mmc/mmc.c Mon Dec 14 01:09:25 2015 (r292180) @@ -1805,22 +1805,9 @@ static device_method_t mmc_methods[] = { DEVMETHOD_END }; -static driver_t mmc_driver = { +driver_t mmc_driver = { "mmc", mmc_methods, sizeof(struct mmc_softc), }; -static devclass_t mmc_devclass; - -DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); -DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL); +devclass_t mmc_devclass; Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/dev/sdhci/sdhci_fdt.c Mon Dec 14 01:09:25 2015 (r292180) @@ -307,3 +307,4 @@ static devclass_t sdhci_fdt_devclass; DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, NULL, NULL); MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); +DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/dev/sdhci/sdhci_pci.c Mon Dec 14 01:09:25 2015 (r292180) @@ -474,3 +474,4 @@ static devclass_t sdhci_pci_devclass; DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_driver, sdhci_pci_devclass, NULL, NULL); MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); +DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sdhc.c Mon Dec 14 00:22:03 2015 (r292179) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Mon Dec 14 01:09:25 2015 (r292180) @@ -125,6 +125,7 @@ static driver_t fsl_sdhc_driver = { static devclass_t fsl_sdhc_devclass; DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); +DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); /***************************************************************************** From owner-svn-src-all@freebsd.org Mon Dec 14 07:08:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D574A421B4; Mon, 14 Dec 2015 07:08:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0501E56; Mon, 14 Dec 2015 07:08:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE78Hfu060556; Mon, 14 Dec 2015 07:08:17 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE78Hr2060555; Mon, 14 Dec 2015 07:08:17 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512140708.tBE78Hr2060555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 14 Dec 2015 07:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292181 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 07:08:18 -0000 Author: kevlo Date: Mon Dec 14 07:08:17 2015 New Revision: 292181 URL: https://svnweb.freebsd.org/changeset/base/292181 Log: Add the cryptodev device. Modified: head/share/man/man4/aesni.4 Modified: head/share/man/man4/aesni.4 ============================================================================== --- head/share/man/man4/aesni.4 Mon Dec 14 01:09:25 2015 (r292180) +++ head/share/man/man4/aesni.4 Mon Dec 14 07:08:17 2015 (r292181) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 6, 2010 +.Dd December 14, 2015 .Dt AESNI 4 .Os .Sh NAME @@ -36,6 +36,7 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device crypto" +.Cd "device cryptodev" .Cd "device aesni" .Ed .Pp From owner-svn-src-all@freebsd.org Mon Dec 14 07:54:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E1CA43ED4; Mon, 14 Dec 2015 07:54:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 274A71645; Mon, 14 Dec 2015 07:54:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE7sjsH075294; Mon, 14 Dec 2015 07:54:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE7sjMn075293; Mon, 14 Dec 2015 07:54:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512140754.tBE7sjMn075293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Dec 2015 07:54: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: r292182 - stable/10/sys/amd64/amd64 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 07:54:46 -0000 Author: kib Date: Mon Dec 14 07:54:45 2015 New Revision: 292182 URL: https://svnweb.freebsd.org/changeset/base/292182 Log: MFC r291948: Use ANSI C definition. Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Mon Dec 14 07:08:17 2015 (r292181) +++ stable/10/sys/amd64/amd64/machdep.c Mon Dec 14 07:54:45 2015 (r292182) @@ -1158,12 +1158,7 @@ struct soft_segment_descriptor gdt_segs[ }; void -setidt(idx, func, typ, dpl, ist) - int idx; - inthand_t *func; - int typ; - int dpl; - int ist; +setidt(int idx, inthand_t *func, int typ, int dpl, int ist) { struct gate_descriptor *ip; From owner-svn-src-all@freebsd.org Mon Dec 14 09:24:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A788A424D8; Mon, 14 Dec 2015 09:24:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 352351742; Mon, 14 Dec 2015 09:24:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9Ofar010772; Mon, 14 Dec 2015 09:24:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9Of5J010769; Mon, 14 Dec 2015 09:24:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140924.tBE9Of5J010769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09: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: r292183 - in stable/10/sys/dev/usb: . wlan 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:24:42 -0000 Author: hselasky Date: Mon Dec 14 09:24:40 2015 New Revision: 292183 URL: https://svnweb.freebsd.org/changeset/base/292183 Log: MFC r263985, r275646 and r289028: Add more USB IDs. PR: usb/188046 Modified: stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_run.c stable/10/sys/dev/usb/wlan/if_upgt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Dec 14 07:54:45 2015 (r292182) +++ stable/10/sys/dev/usb/usbdevs Mon Dec 14 09:24:40 2015 (r292183) @@ -525,7 +525,7 @@ vendor DMI 0x0c0b DMI vendor CANYON 0x0c10 Canyon vendor ICOM 0x0c26 Icom Inc. vendor GNOTOMETRICS 0x0c33 GN Otometrics -vendor CHICONY2 0x0c45 Chicony +vendor CHICONY2 0x0c45 Chicony / Microdia / Sonix Technology Co., Ltd. vendor REINERSCT 0x0c4b Reiner-SCT vendor SEALEVEL 0x0c52 Sealevel System vendor JETI 0x0c6c Jeti @@ -687,6 +687,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor DISPLAYLINK 0x17e9 DisplayLink vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala @@ -775,6 +776,7 @@ vendor MOSCHIP 0x9710 MosChip Semicondu vendor NETGEAR4 0x9846 Netgear vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com +vendor CACE 0xcace CACE Technologies vendor EVOLUTION 0xdeee Evolution Robotics products vendor DATAAPEX 0xdaae DataApex vendor HP2 0xf003 Hewlett Packard @@ -862,6 +864,7 @@ product ACCTON RT3070_3 0xc522 RT3070 product ACCTON RT3070_5 0xd522 RT3070 product ACCTON RTL8192SU 0xc512 RTL8192SU product ACCTON ZD1211B 0xe501 ZD1211B +product ACCTON WN7512 0xf522 WN7512 /* Aceeca products */ product ACEECA MEZ1000 0x0001 MEZ1000 RDA @@ -1226,6 +1229,11 @@ product ATHEROS2 AR5523_2 0x0003 AR5523 product ATHEROS2 AR5523_2_NF 0x0004 AR5523 (no firmware) product ATHEROS2 AR5523_3 0x0005 AR5523 product ATHEROS2 AR5523_3_NF 0x0006 AR5523 (no firmware) +product ATHEROS2 TG121N 0x1001 TG121N +product ATHEROS2 WN821NV2 0x1002 WN821NV2 +product ATHEROS2 3CRUSBN275 0x1010 3CRUSBN275 +product ATHEROS2 WN612 0x1011 WN612 +product ATHEROS2 AR9170 0x9170 AR9170 /* Atmel Comp. products */ product ATMEL STK541 0x2109 Zigbee Controller @@ -1241,6 +1249,9 @@ product AUTHENTEC AES1610 0x1600 AES1610 /* Avision products */ product AVISION 1200U 0x0268 1200U scanner +/* AVM products */ +product AVM FRITZWLAN 0x8401 FRITZ!WLAN N + /* Axesstel products */ product AXESSTEL DATAMODEM 0x1000 Data Modem @@ -1343,6 +1354,9 @@ product BROTHER MFC8600_9650 0x0100 MFC8 product BTC BTC6100 0x5550 6100C Keyboard product BTC BTC7932 0x6782 Keyboard with mouse port +/* CACE Technologies products */ +product CACE AIRPCAPNX 0x0300 AirPcap NX + /* Canon, Inc. products */ product CANON N656U 0x2206 CanoScan N656U product CANON N1220U 0x2207 CanoScan N1220U @@ -1603,6 +1617,7 @@ product DLINK DUBE100C1 0x1a02 DUB-E100 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E product DLINK DWA125D1 0x330f DWA-125 rev D1 +product DLINK DWA123D1 0x3310 DWA-123 rev D1 product DLINK DWL122 0x3700 DWL-122 product DLINK DWLG120 0x3701 DWL-G120 product DLINK DWL120F 0x3702 DWL-120 rev F @@ -1642,8 +1657,10 @@ product DLINK DWA131B 0x330d DWA-131 re product DLINK2 RTL8192SU_1 0x3300 RTL8192SU product DLINK2 RTL8192SU_2 0x3302 RTL8192SU product DLINK2 DWA131A1 0x3303 DWA-131 A1 +product DLINK2 DWA160A2 0x3a09 DWA-160 A2 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) +product DLINK2 DWA130D1 0x3a0f DWA-130 D1 product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 @@ -1654,12 +1671,35 @@ product DLINK2 RT3072_1 0x3c0b RT3072 product DLINK2 RT3070_1 0x3c0d RT3070 product DLINK2 RT3070_2 0x3c0e RT3070 product DLINK2 RT3070_3 0x3c0f RT3070 +product DLINK2 DWA160A1 0x3c10 DWA-160 A1 product DLINK2 RT2870_2 0x3c11 RT2870 product DLINK2 DWA130 0x3c13 DWA-130 product DLINK2 RT3070_4 0x3c15 RT3070 product DLINK2 RT3070_5 0x3c16 RT3070 product DLINK3 DWM652 0x3e04 DWM-652 +/* DisplayLink products */ +product DISPLAYLINK LCD4300U 0x01ba LCD-4300U +product DISPLAYLINK LCD8000U 0x01bb LCD-8000U +product DISPLAYLINK LD220 0x0100 Samsung LD220 +product DISPLAYLINK GUC2020 0x0059 IOGEAR DVI GUC2020 +product DISPLAYLINK VCUD60 0x0136 Rextron DVI +product DISPLAYLINK CONV 0x0138 StarTech CONV-USB2DVI +product DISPLAYLINK DLDVI 0x0141 DisplayLink DVI +product DISPLAYLINK VGA10 0x015a CMP-USBVGA10 +product DISPLAYLINK WSDVI 0x0198 WS Tech DVI +product DISPLAYLINK EC008 0x019b EasyCAP008 DVI +product DISPLAYLINK HPDOCK 0x01d4 HP USB Docking +product DISPLAYLINK NL571 0x01d7 HP USB DVI +product DISPLAYLINK M01061 0x01e2 Lenovo DVI +product DISPLAYLINK SWDVI 0x024c SUNWEIT DVI +product DISPLAYLINK NBDOCK 0x0215 VideoHome NBdock1920 +product DISPLAYLINK LUM70 0x02a9 Lilliput UM-70 +product DISPLAYLINK UM7X0 0x401a nanovision MiMo +product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 +product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock +product DISPLAYLINK PLUGABLE 0x0377 Plugable docking station + /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer product DMI DISK 0x2bcf Generic Disk @@ -1720,6 +1760,7 @@ product ELECOM MOUSE29UO 0x0002 mouse 29 product ELECOM LDUSBTX0 0x200c LD-USB/TX product ELECOM LDUSBTX1 0x4002 LD-USB/TX product ELECOM LDUSBLTX 0x4005 LD-USBL/TX +product ELECOM WDC150SU2M 0x4008 WDC-150SU2M product ELECOM LDUSBTX2 0x400b LD-USB/TX product ELECOM LDUSB20 0x4010 LD-USB20 product ELECOM UCSGT 0x5003 UC-SGT @@ -2448,6 +2489,7 @@ product IODATA USBETTXS 0x0913 USB ETTX product IODATA USBWNB11A 0x0919 USB WN-B11 product IODATA USBWNB11 0x0922 USB Airport WN-B11 product IODATA ETGUS2 0x0930 ETG-US2 +product IODATA WNGDNUS2 0x093f WN-GDN/US2 product IODATA RT3072_1 0x0944 RT3072 product IODATA RT3072_2 0x0945 RT3072 product IODATA RT3072_3 0x0947 RT3072 @@ -2613,6 +2655,7 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 product LEADTEK 9531 0x2101 9531 GPS /* Lenovo products */ +product LENOVO GIGALAN 0x304b USB 3.0 Ethernet product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet /* Lexar products */ @@ -3030,6 +3073,11 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor product MEI S2000 0x1101 Series 2000 Combo Acceptor +/* Microdia / Sonix Techonology Co., Ltd. products */ +product CHICONY2 YUREX 0x1010 YUREX +product CHICONY2 CAM_1 0x62c0 CAM_1 +product CHICONY2 TEMPER 0x7401 TEMPer sensor + /* Micro Star International products */ product MSI BT_DONGLE 0x1967 Bluetooth USB dongle product MSI RT3070_1 0x3820 RT3070 @@ -3182,6 +3230,7 @@ product NATIONAL BEARPAW2400 0x1001 Bear /* NEC products */ product NEC HUB_0050 0x0050 USB 2.0 7-Port Hub product NEC HUB_005A 0x005a USB 2.0 4-Port Hub +product NEC WL300NUG 0x0249 WL300NU-G product NEC HUB 0x55aa hub product NEC HUB_B 0x55ab hub @@ -3209,12 +3258,17 @@ product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet product NETGEAR M4100 0x1100 M4100/M5300/M7100 series switch -product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN +product NETGEAR WG111V1_2 0x4240 PrismGT USB 2.0 WLAN product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U product NETGEAR WG111U_NF 0x4301 WG111U (no firmware) product NETGEAR WG111V2 0x6a00 WG111V2 +product NETGEAR WN111V2 0x9001 WN111V2 +product NETGEAR WNDA3100 0x9010 WNDA3100 +product NETGEAR WNDA4100 0x9012 WNDA4100 +product NETGEAR WNDA3200 0x9018 WNDA3200 product NETGEAR RTL8192CU 0x9021 RTL8192CU +product NETGEAR WNA1000 0x9040 WNA1000 product NETGEAR WNA1000M 0x9041 WNA1000M product NETGEAR2 MA101 0x4100 MA101 product NETGEAR2 MA101B 0x4102 MA101 Rev B @@ -3478,6 +3532,7 @@ product PLANEX GW_US11H 0x14ea GW-US11H product PLANEX2 RTL8188CUS 0x1201 RTL8188CUS product PLANEX2 GW_US11S 0x3220 GW-US11S WLAN product PLANEX2 GW_US54GXS 0x5303 GW-US54GXS WLAN +product PLANEX2 GW_US300 0x5304 GW-US300 product PLANEX2 RTL8188CU_1 0xab2a RTL8188CU product PLANEX2 RTL8188CU_2 0xed17 RTL8188CU product PLANEX2 RTL8188CU_3 0x4902 RTL8188CU @@ -3658,6 +3713,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC MF112 0x0103 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z @@ -4395,6 +4451,7 @@ product TREK THUMBDRIVE_8MB 0x9988 Thumb /* TRENDnet products */ product TRENDNET RTL8192CU 0x624d RTL8192CU +product TRENDNET TEW646UBH 0x646b TEW-646UBH product TRENDNET RTL8188CU 0x648b RTL8188CU /* Tripp-Lite products */ @@ -4548,8 +4605,10 @@ product WINBOND UH104 0x5518 4-port USB product WINMAXGROUP FLASH64MC 0x6660 USB Flash Disk 64M-C /* Wistron NeWeb products */ +product WISTRONNEWEB WNC0600 0x0326 WNC-0600USB product WISTRONNEWEB UR045G 0x0427 PrismGT USB 2.0 WLAN product WISTRONNEWEB UR055G 0x0711 UR055G +product WISTRONNEWEB O8494 0x0804 ORiNOCO 802.11n product WISTRONNEWEB AR5523_1 0x0826 AR5523 product WISTRONNEWEB AR5523_1_NF 0x0827 AR5523 (no firmware) product WISTRONNEWEB AR5523_2 0x082a AR5523 @@ -4598,7 +4657,9 @@ product ZCOM AR5523_NF 0x0013 AR5523 dr product ZCOM XM142 0x0015 XM-142 product ZCOM ZD1211B 0x001a ZD1211B product ZCOM RT2870_1 0x0022 RT2870 +product ZCOM UB81 0x0023 UB81 product ZCOM RT2870_2 0x0025 RT2870 +product ZCOM UB82 0x0026 UB82 /* Zinwell products */ product ZINWELL RT2570 0x0260 RT2570 @@ -4617,6 +4678,7 @@ product ZORAN EX20DSC 0x4343 Digital Ca /* Zydas Technology Corporation products */ product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg product ZYDAS ZD1211B 0x1215 ZD1211B +product ZYDAS ZD1221 0x1221 ZD1221 /* ZyXEL Communication Co. products */ product ZYXEL OMNI56K 0x1500 Omni 56K Plus @@ -4628,6 +4690,8 @@ product ZYXEL M202 0x340a M-202 product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 +product ZYXEL NWD271N 0x3417 NWD-271N +product ZYXEL NWD211AN 0x3418 NWD-211AN product ZYXEL RT2870_2 0x341a RT2870 product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Mon Dec 14 07:54:45 2015 (r292182) +++ stable/10/sys/dev/usb/wlan/if_run.c Mon Dec 14 09:24:40 2015 (r292183) @@ -246,6 +246,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(MSI, RT3070_9), RUN_DEV(MSI, RT3070_10), RUN_DEV(MSI, RT3070_11), + RUN_DEV(NETGEAR, WNDA4100), RUN_DEV(OVISLINK, RT3072), RUN_DEV(PARA, RT3070), RUN_DEV(PEGATRON, RT2870), @@ -317,6 +318,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), + RUN_DEV(ZYXEL, RT3070), RUN_DEV_EJECT(ZYXEL, NWD2705), RUN_DEV_EJECT(RALINK, RT_STOR), #undef RUN_DEV_EJECT Modified: stable/10/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_upgt.c Mon Dec 14 07:54:45 2015 (r292182) +++ stable/10/sys/dev/usb/wlan/if_upgt.c Mon Dec 14 09:24:40 2015 (r292183) @@ -182,7 +182,7 @@ static const STRUCT_USB_HOST_ID upgt_dev UPGT_DEV(FSC, E5400), UPGT_DEV(GLOBESPAN, PRISM_GT_1), UPGT_DEV(GLOBESPAN, PRISM_GT_2), - UPGT_DEV(NETGEAR, WG111V2_2), + UPGT_DEV(NETGEAR, WG111V1_2), UPGT_DEV(INTERSIL, PRISM_GT), UPGT_DEV(SMC, 2862WG), UPGT_DEV(USR, USR5422), From owner-svn-src-all@freebsd.org Mon Dec 14 09:42:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DECFA4335D; Mon, 14 Dec 2015 09:42:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68BC3107F; Mon, 14 Dec 2015 09:42:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9geT7018409; Mon, 14 Dec 2015 09:42:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9geDQ018404; Mon, 14 Dec 2015 09:42:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140942.tBE9geDQ018404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292184 - in stable/9/sys/dev/usb: . serial 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:42:41 -0000 Author: hselasky Date: Mon Dec 14 09:42:39 2015 New Revision: 292184 URL: https://svnweb.freebsd.org/changeset/base/292184 Log: MFC r263985, r275646, r281745, r287575 and r289028: Add more USB IDs. PR: 199522 PR: 188046 Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs stable/9/sys/dev/usb/wlan/if_run.c (contents, props changed) stable/9/sys/dev/usb/wlan/if_upgt.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 Mon Dec 14 09:24:40 2015 (r292183) +++ stable/9/sys/dev/usb/serial/u3g.c Mon Dec 14 09:42:39 2015 (r292184) @@ -494,6 +494,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC313U, 0), U3G_DEV(SIERRA, AC597E, 0), + U3G_DEV(SIERRA, AC875, 0), U3G_DEV(SIERRA, AC875E, 0), U3G_DEV(SIERRA, AC875U, 0), U3G_DEV(SIERRA, AC875U_2, 0), @@ -508,7 +509,6 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(SIERRA, AC885U, 0), U3G_DEV(SIERRA, AIRCARD580, 0), U3G_DEV(SIERRA, AIRCARD595, 0), - U3G_DEV(SIERRA, AIRCARD875, 0), U3G_DEV(SIERRA, C22, 0), U3G_DEV(SIERRA, C597, 0), U3G_DEV(SIERRA, C888, 0), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Dec 14 09:24:40 2015 (r292183) +++ stable/9/sys/dev/usb/usbdevs Mon Dec 14 09:42:39 2015 (r292184) @@ -525,7 +525,7 @@ vendor DMI 0x0c0b DMI vendor CANYON 0x0c10 Canyon vendor ICOM 0x0c26 Icom Inc. vendor GNOTOMETRICS 0x0c33 GN Otometrics -vendor CHICONY2 0x0c45 Chicony +vendor CHICONY2 0x0c45 Chicony / Microdia / Sonix Technology Co., Ltd. vendor REINERSCT 0x0c4b Reiner-SCT vendor SEALEVEL 0x0c52 Sealevel System vendor JETI 0x0c6c Jeti @@ -687,6 +687,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor DISPLAYLINK 0x17e9 DisplayLink vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala @@ -775,6 +776,7 @@ vendor MOSCHIP 0x9710 MosChip Semicondu vendor NETGEAR4 0x9846 Netgear vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com +vendor CACE 0xcace CACE Technologies vendor EVOLUTION 0xdeee Evolution Robotics products vendor DATAAPEX 0xdaae DataApex vendor HP2 0xf003 Hewlett Packard @@ -862,6 +864,7 @@ product ACCTON RT3070_3 0xc522 RT3070 product ACCTON RT3070_5 0xd522 RT3070 product ACCTON RTL8192SU 0xc512 RTL8192SU product ACCTON ZD1211B 0xe501 ZD1211B +product ACCTON WN7512 0xf522 WN7512 /* Aceeca products */ product ACEECA MEZ1000 0x0001 MEZ1000 RDA @@ -1226,6 +1229,11 @@ product ATHEROS2 AR5523_2 0x0003 AR5523 product ATHEROS2 AR5523_2_NF 0x0004 AR5523 (no firmware) product ATHEROS2 AR5523_3 0x0005 AR5523 product ATHEROS2 AR5523_3_NF 0x0006 AR5523 (no firmware) +product ATHEROS2 TG121N 0x1001 TG121N +product ATHEROS2 WN821NV2 0x1002 WN821NV2 +product ATHEROS2 3CRUSBN275 0x1010 3CRUSBN275 +product ATHEROS2 WN612 0x1011 WN612 +product ATHEROS2 AR9170 0x9170 AR9170 /* Atmel Comp. products */ product ATMEL STK541 0x2109 Zigbee Controller @@ -1241,6 +1249,9 @@ product AUTHENTEC AES1610 0x1600 AES1610 /* Avision products */ product AVISION 1200U 0x0268 1200U scanner +/* AVM products */ +product AVM FRITZWLAN 0x8401 FRITZ!WLAN N + /* Axesstel products */ product AXESSTEL DATAMODEM 0x1000 Data Modem @@ -1343,6 +1354,9 @@ product BROTHER MFC8600_9650 0x0100 MFC8 product BTC BTC6100 0x5550 6100C Keyboard product BTC BTC7932 0x6782 Keyboard with mouse port +/* CACE Technologies products */ +product CACE AIRPCAPNX 0x0300 AirPcap NX + /* Canon, Inc. products */ product CANON N656U 0x2206 CanoScan N656U product CANON N1220U 0x2207 CanoScan N1220U @@ -1603,6 +1617,7 @@ product DLINK DUBE100C1 0x1a02 DUB-E100 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E product DLINK DWA125D1 0x330f DWA-125 rev D1 +product DLINK DWA123D1 0x3310 DWA-123 rev D1 product DLINK DWL122 0x3700 DWL-122 product DLINK DWLG120 0x3701 DWL-G120 product DLINK DWL120F 0x3702 DWL-120 rev F @@ -1642,8 +1657,10 @@ product DLINK DWA131B 0x330d DWA-131 re product DLINK2 RTL8192SU_1 0x3300 RTL8192SU product DLINK2 RTL8192SU_2 0x3302 RTL8192SU product DLINK2 DWA131A1 0x3303 DWA-131 A1 +product DLINK2 DWA160A2 0x3a09 DWA-160 A2 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) +product DLINK2 DWA130D1 0x3a0f DWA-130 D1 product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 @@ -1654,12 +1671,35 @@ product DLINK2 RT3072_1 0x3c0b RT3072 product DLINK2 RT3070_1 0x3c0d RT3070 product DLINK2 RT3070_2 0x3c0e RT3070 product DLINK2 RT3070_3 0x3c0f RT3070 +product DLINK2 DWA160A1 0x3c10 DWA-160 A1 product DLINK2 RT2870_2 0x3c11 RT2870 product DLINK2 DWA130 0x3c13 DWA-130 product DLINK2 RT3070_4 0x3c15 RT3070 product DLINK2 RT3070_5 0x3c16 RT3070 product DLINK3 DWM652 0x3e04 DWM-652 +/* DisplayLink products */ +product DISPLAYLINK LCD4300U 0x01ba LCD-4300U +product DISPLAYLINK LCD8000U 0x01bb LCD-8000U +product DISPLAYLINK LD220 0x0100 Samsung LD220 +product DISPLAYLINK GUC2020 0x0059 IOGEAR DVI GUC2020 +product DISPLAYLINK VCUD60 0x0136 Rextron DVI +product DISPLAYLINK CONV 0x0138 StarTech CONV-USB2DVI +product DISPLAYLINK DLDVI 0x0141 DisplayLink DVI +product DISPLAYLINK VGA10 0x015a CMP-USBVGA10 +product DISPLAYLINK WSDVI 0x0198 WS Tech DVI +product DISPLAYLINK EC008 0x019b EasyCAP008 DVI +product DISPLAYLINK HPDOCK 0x01d4 HP USB Docking +product DISPLAYLINK NL571 0x01d7 HP USB DVI +product DISPLAYLINK M01061 0x01e2 Lenovo DVI +product DISPLAYLINK SWDVI 0x024c SUNWEIT DVI +product DISPLAYLINK NBDOCK 0x0215 VideoHome NBdock1920 +product DISPLAYLINK LUM70 0x02a9 Lilliput UM-70 +product DISPLAYLINK UM7X0 0x401a nanovision MiMo +product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 +product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock +product DISPLAYLINK PLUGABLE 0x0377 Plugable docking station + /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer product DMI DISK 0x2bcf Generic Disk @@ -1720,6 +1760,7 @@ product ELECOM MOUSE29UO 0x0002 mouse 29 product ELECOM LDUSBTX0 0x200c LD-USB/TX product ELECOM LDUSBTX1 0x4002 LD-USB/TX product ELECOM LDUSBLTX 0x4005 LD-USBL/TX +product ELECOM WDC150SU2M 0x4008 WDC-150SU2M product ELECOM LDUSBTX2 0x400b LD-USB/TX product ELECOM LDUSB20 0x4010 LD-USB20 product ELECOM UCSGT 0x5003 UC-SGT @@ -2448,6 +2489,7 @@ product IODATA USBETTXS 0x0913 USB ETTX product IODATA USBWNB11A 0x0919 USB WN-B11 product IODATA USBWNB11 0x0922 USB Airport WN-B11 product IODATA ETGUS2 0x0930 ETG-US2 +product IODATA WNGDNUS2 0x093f WN-GDN/US2 product IODATA RT3072_1 0x0944 RT3072 product IODATA RT3072_2 0x0945 RT3072 product IODATA RT3072_3 0x0947 RT3072 @@ -2613,6 +2655,7 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 product LEADTEK 9531 0x2101 9531 GPS /* Lenovo products */ +product LENOVO GIGALAN 0x304b USB 3.0 Ethernet product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet /* Lexar products */ @@ -3002,11 +3045,12 @@ product MELCO WLRUCG 0x0116 WLR-UC-G product MELCO WLRUCGAOSS 0x0119 WLR-UC-G-AOSS product MELCO WLIUCAG300N 0x012e WLI-UC-AG300N product MELCO WLIUCG 0x0137 WLI-UC-G -product MELCO RT2870_1 0x0148 RT2870 +product MELCO WLIUCG300HP 0x0148 WLI-UC-G300HP product MELCO RT2870_2 0x0150 RT2870 product MELCO WLIUCGN 0x015d WLI-UC-GN product MELCO WLIUCG301N 0x016f WLI-UC-G301N product MELCO WLIUCGNM 0x01a2 WLI-UC-GNM +product MELCO WLIUCG300HPV1 0x01a8 WLI-UC-G300HP-V1 product MELCO WLIUCGNM2 0x01ee WLI-UC-GNM2 /* Merlin products */ @@ -3029,6 +3073,11 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor product MEI S2000 0x1101 Series 2000 Combo Acceptor +/* Microdia / Sonix Techonology Co., Ltd. products */ +product CHICONY2 YUREX 0x1010 YUREX +product CHICONY2 CAM_1 0x62c0 CAM_1 +product CHICONY2 TEMPER 0x7401 TEMPer sensor + /* Micro Star International products */ product MSI BT_DONGLE 0x1967 Bluetooth USB dongle product MSI RT3070_1 0x3820 RT3070 @@ -3181,6 +3230,7 @@ product NATIONAL BEARPAW2400 0x1001 Bear /* NEC products */ product NEC HUB_0050 0x0050 USB 2.0 7-Port Hub product NEC HUB_005A 0x005a USB 2.0 4-Port Hub +product NEC WL300NUG 0x0249 WL300NU-G product NEC HUB 0x55aa hub product NEC HUB_B 0x55ab hub @@ -3208,12 +3258,17 @@ product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet product NETGEAR M4100 0x1100 M4100/M5300/M7100 series switch -product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN +product NETGEAR WG111V1_2 0x4240 PrismGT USB 2.0 WLAN product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U product NETGEAR WG111U_NF 0x4301 WG111U (no firmware) product NETGEAR WG111V2 0x6a00 WG111V2 +product NETGEAR WN111V2 0x9001 WN111V2 +product NETGEAR WNDA3100 0x9010 WNDA3100 +product NETGEAR WNDA4100 0x9012 WNDA4100 +product NETGEAR WNDA3200 0x9018 WNDA3200 product NETGEAR RTL8192CU 0x9021 RTL8192CU +product NETGEAR WNA1000 0x9040 WNA1000 product NETGEAR WNA1000M 0x9041 WNA1000M product NETGEAR2 MA101 0x4100 MA101 product NETGEAR2 MA101B 0x4102 MA101 Rev B @@ -3477,6 +3532,7 @@ product PLANEX GW_US11H 0x14ea GW-US11H product PLANEX2 RTL8188CUS 0x1201 RTL8188CUS product PLANEX2 GW_US11S 0x3220 GW-US11S WLAN product PLANEX2 GW_US54GXS 0x5303 GW-US54GXS WLAN +product PLANEX2 GW_US300 0x5304 GW-US300 product PLANEX2 RTL8188CU_1 0xab2a RTL8188CU product PLANEX2 RTL8188CU_2 0xed17 RTL8188CU product PLANEX2 RTL8188CU_3 0x4902 RTL8188CU @@ -3657,6 +3713,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC MF112 0x0103 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z @@ -3740,6 +3797,7 @@ product REALTEK RTL8188CU_1 0x817a RTL81 product REALTEK RTL8188CU_2 0x817b RTL8188CU product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter +product REALTEK RTL8188CU_3 0x8191 RTL8188CU product REALTEK RTL8196EU 0x8196 RTL8196EU product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter @@ -4013,7 +4071,8 @@ product SIERRA C22 0x6891 C22 product SIERRA E6892 0x6892 E6892 product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 -product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA +product SIERRA MC7354 0x68C0 MC7354 +product SIERRA MC7355 0x9041 MC7355 product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer @@ -4392,6 +4451,7 @@ product TREK THUMBDRIVE_8MB 0x9988 Thumb /* TRENDnet products */ product TRENDNET RTL8192CU 0x624d RTL8192CU +product TRENDNET TEW646UBH 0x646b TEW-646UBH product TRENDNET RTL8188CU 0x648b RTL8188CU /* Tripp-Lite products */ @@ -4545,8 +4605,10 @@ product WINBOND UH104 0x5518 4-port USB product WINMAXGROUP FLASH64MC 0x6660 USB Flash Disk 64M-C /* Wistron NeWeb products */ +product WISTRONNEWEB WNC0600 0x0326 WNC-0600USB product WISTRONNEWEB UR045G 0x0427 PrismGT USB 2.0 WLAN product WISTRONNEWEB UR055G 0x0711 UR055G +product WISTRONNEWEB O8494 0x0804 ORiNOCO 802.11n product WISTRONNEWEB AR5523_1 0x0826 AR5523 product WISTRONNEWEB AR5523_1_NF 0x0827 AR5523 (no firmware) product WISTRONNEWEB AR5523_2 0x082a AR5523 @@ -4595,7 +4657,9 @@ product ZCOM AR5523_NF 0x0013 AR5523 dr product ZCOM XM142 0x0015 XM-142 product ZCOM ZD1211B 0x001a ZD1211B product ZCOM RT2870_1 0x0022 RT2870 +product ZCOM UB81 0x0023 UB81 product ZCOM RT2870_2 0x0025 RT2870 +product ZCOM UB82 0x0026 UB82 /* Zinwell products */ product ZINWELL RT2570 0x0260 RT2570 @@ -4614,6 +4678,7 @@ product ZORAN EX20DSC 0x4343 Digital Ca /* Zydas Technology Corporation products */ product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg product ZYDAS ZD1211B 0x1215 ZD1211B +product ZYDAS ZD1221 0x1221 ZD1221 /* ZyXEL Communication Co. products */ product ZYXEL OMNI56K 0x1500 Omni 56K Plus @@ -4625,6 +4690,8 @@ product ZYXEL M202 0x340a M-202 product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 +product ZYXEL NWD271N 0x3417 NWD-271N +product ZYXEL NWD211AN 0x3418 NWD-211AN product ZYXEL RT2870_2 0x341a RT2870 product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Mon Dec 14 09:24:40 2015 (r292183) +++ stable/9/sys/dev/usb/wlan/if_run.c Mon Dec 14 09:42:39 2015 (r292184) @@ -223,13 +223,14 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, LANW300NU2), RUN_DEV(LOGITEC, LANW150NU2), RUN_DEV(LOGITEC, LANW300NU2S), - RUN_DEV(MELCO, RT2870_1), + RUN_DEV(MELCO, WLIUCG300HP), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), RUN_DEV(MELCO, WLIUCG300N), RUN_DEV(MELCO, WLIUCG301N), RUN_DEV(MELCO, WLIUCGN), RUN_DEV(MELCO, WLIUCGNM), + RUN_DEV(MELCO, WLIUCG300HPV1), RUN_DEV(MELCO, WLIUCGNM2), RUN_DEV(MOTOROLA4, RT2770), RUN_DEV(MOTOROLA4, RT3070), @@ -244,6 +245,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(MSI, RT3070_9), RUN_DEV(MSI, RT3070_10), RUN_DEV(MSI, RT3070_11), + RUN_DEV(NETGEAR, WNDA4100), RUN_DEV(OVISLINK, RT3072), RUN_DEV(PARA, RT3070), RUN_DEV(PEGATRON, RT2870), @@ -315,6 +317,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), + RUN_DEV(ZYXEL, RT3070), RUN_DEV_EJECT(ZYXEL, NWD2705), RUN_DEV_EJECT(RALINK, RT_STOR), #undef RUN_DEV_EJECT Modified: stable/9/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 14 09:24:40 2015 (r292183) +++ stable/9/sys/dev/usb/wlan/if_upgt.c Mon Dec 14 09:42:39 2015 (r292184) @@ -182,7 +182,7 @@ static const STRUCT_USB_HOST_ID upgt_dev UPGT_DEV(FSC, E5400), UPGT_DEV(GLOBESPAN, PRISM_GT_1), UPGT_DEV(GLOBESPAN, PRISM_GT_2), - UPGT_DEV(NETGEAR, WG111V2_2), + UPGT_DEV(NETGEAR, WG111V1_2), UPGT_DEV(INTERSIL, PRISM_GT), UPGT_DEV(SMC, 2862WG), UPGT_DEV(USR, USR5422), From owner-svn-src-all@freebsd.org Mon Dec 14 09:46:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17A43A43630; Mon, 14 Dec 2015 09:46:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D938E1410; Mon, 14 Dec 2015 09:46:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9klD8019055; Mon, 14 Dec 2015 09:46:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9kk6X019054; Mon, 14 Dec 2015 09:46:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140946.tBE9kk6X019054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:46: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: r292185 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:46:48 -0000 Author: hselasky Date: Mon Dec 14 09:46:46 2015 New Revision: 292185 URL: https://svnweb.freebsd.org/changeset/base/292185 Log: MFC r291953: When setting up VLANs on a Raspberry Pi ethernet port, the MTU drops from 1500 to 1496 bytes. The MTU should remain at 1500, extending the frame size as per IEEE 802.3. Adding IFCAP_VLAN_MTU to the if_capabilities field in the smsc driver solves the problem. The datasheet for the LAN9512 chip, section 3.2.3 states that the chip supports the extended frame. Submitted by: rpp@ci.com.au PR: 205050 Modified: stable/10/sys/dev/usb/net/if_smsc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/10/sys/dev/usb/net/if_smsc.c Mon Dec 14 09:42:39 2015 (r292184) +++ stable/10/sys/dev/usb/net/if_smsc.c Mon Dec 14 09:46:46 2015 (r292185) @@ -1686,7 +1686,7 @@ smsc_attach_post_sub(struct usb_ether *u /* The chip supports TCP/UDP checksum offloading on TX and RX paths, however * currently only RX checksum is supported in the driver (see top of file). */ - ifp->if_capabilities |= IFCAP_RXCSUM; + ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_VLAN_MTU; ifp->if_hwassist = 0; /* TX checksuming is disabled (for now?) From owner-svn-src-all@freebsd.org Mon Dec 14 09:52:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A40BA43A7A; Mon, 14 Dec 2015 09:52:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E31A1AAC; Mon, 14 Dec 2015 09:52:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9q9xh022523; Mon, 14 Dec 2015 09:52:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9q96V022522; Mon, 14 Dec 2015 09:52:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512140952.tBE9q96V022522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Dec 2015 09:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292186 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:52:10 -0000 Author: andrew Date: Mon Dec 14 09:52:09 2015 New Revision: 292186 URL: https://svnweb.freebsd.org/changeset/base/292186 Log: Split KNOWN_ARCHES so we have one per line to simplify merging future architectures. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Dec 14 09:46:46 2015 (r292185) +++ head/Makefile.inc1 Mon Dec 14 09:52:09 2015 (r292186) @@ -172,10 +172,24 @@ VERSION= FreeBSD ${REVISION}-${BRANCH:C/ .export VERSION .endif -KNOWN_ARCHES?= aarch64/arm64 amd64 arm armeb/arm armv6/arm armv6hf/arm \ - i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips \ - mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc \ - riscv64/riscv sparc64 +KNOWN_ARCHES?= aarch64/arm64 \ + amd64 \ + arm \ + armeb/arm \ + armv6/arm \ + armv6hf/arm \ + i386 \ + i386/pc98 \ + mips \ + mipsel/mips \ + mips64el/mips \ + mips64/mips \ + mipsn32el/mips \ + mipsn32/mips \ + powerpc \ + powerpc64/powerpc \ + riscv64/riscv \ + sparc64 .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} From owner-svn-src-all@freebsd.org Mon Dec 14 09:52:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE61AA43AAE; Mon, 14 Dec 2015 09:52:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 886E11B1D; Mon, 14 Dec 2015 09:52:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9qF5E022582; Mon, 14 Dec 2015 09:52:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9qFrf022581; Mon, 14 Dec 2015 09:52:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140952.tBE9qFrf022581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292187 - stable/10/etc/devd 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:52:16 -0000 Author: hselasky Date: Mon Dec 14 09:52:15 2015 New Revision: 292187 URL: https://svnweb.freebsd.org/changeset/base/292187 Log: MFC r291703: Regenerate usb.conf . Modified: stable/10/etc/devd/usb.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/devd/usb.conf ============================================================================== --- stable/10/etc/devd/usb.conf Mon Dec 14 09:52:09 2015 (r292186) +++ stable/10/etc/devd/usb.conf Mon Dec 14 09:52:15 2015 (r292187) @@ -145,7 +145,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee1 8|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed7 4|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -169,7 +169,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0409"; - match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + match "product" "(0x00d5|0x00d6|0x00d7)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "0x0249"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x8024|0x8025)"; action "kldload -n uipaq"; }; @@ -281,7 +297,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01ee)"; + match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01a8|0x01ee)"; action "kldload -n if_run"; }; @@ -521,6 +537,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04bb"; + match "product" "0x093f"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; match "product" "(0x0944|0x0945|0x0947|0x0948)"; action "kldload -n if_run"; }; @@ -1064,6 +1088,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x057c"; + match "product" "0x8401"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0584"; match "product" "0xb000"; action "kldload -n uplcom"; @@ -1089,7 +1121,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0586"; - match "product" "(0x3416|0x341a|0x341e)"; + match "product" "0x3416"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "0x3417"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x341a|0x341e)"; action "kldload -n if_run"; }; @@ -1153,7 +1201,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0290|0x0291|0x0292)"; + match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0272|0x0273|0x0274|0x0290|0x0291|0x0292)"; action "kldload -n wsp"; }; @@ -1193,7 +1241,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9204|0x9205)"; + match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9002|0x9204|0x9205)"; action "kldload -n u3g"; }; @@ -1721,6 +1769,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; + match "product" "0x3a09"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; match "product" "0x3a0c"; action "kldload -n if_uath"; }; @@ -1729,6 +1785,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; + match "product" "0x3a0f"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)"; action "kldload -n if_rum"; }; @@ -1737,7 +1801,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; - match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "0x3c10"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c11|0x3c13|0x3c15|0x3c16)"; action "kldload -n if_run"; }; @@ -1848,6 +1928,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0xf522"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0841"; match "product" "0x0001"; action "kldload -n urio"; @@ -1921,7 +2009,39 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; - match "product" "(0x9021|0x9041)"; + match "product" "(0x9001|0x9010)"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9012"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9021"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9040"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9041"; action "kldload -n if_urtwn"; }; @@ -2184,6 +2304,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0ace"; + match "product" "0x1221"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0af0"; match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701)"; action "kldload -n u3g"; @@ -2545,6 +2673,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; + match "product" "0x8152"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bda"; match "product" "0x8170"; action "kldload -n if_urtwn"; }; @@ -2561,7 +2697,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; + match "product" "(0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; action "kldload -n if_urtwn"; }; @@ -2577,7 +2713,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "0x818a"; + match "product" "(0x818a|0x8191)"; action "kldload -n if_urtwn"; }; @@ -2680,6 +2816,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0c45"; + match "product" "0x7401"; + action "kldload -n ugold"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0c52"; match "product" "(0x2101|0x2102|0x2103|0x2104|0x2211|0x2212|0x2213|0x2221|0x2222|0x2223|0x2411|0x2412|0x2413|0x2421|0x2422|0x2423|0x2431|0x2432|0x2433|0x2441|0x2442|0x2443|0x2811|0x2812|0x2813|0x2821|0x2822|0x2823|0x2831|0x2832|0x2833|0x2841|0x2842|0x2843|0x2851|0x2852|0x2853|0x2861|0x2862|0x2863|0x2871|0x2872|0x2873|0x2881|0x2882|0x2883|0x9020)"; action "kldload -n uftdi"; @@ -2785,13 +2929,37 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cde"; - match "product" "(0x0022|0x0025)"; + match "product" "0x0022"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0023"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0025"; action "kldload -n if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0026"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0cf3"; match "product" "(0x0001|0x0003|0x0005)"; action "kldload -n if_uath"; @@ -2801,7 +2969,31 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cf3"; - match "product" "(0x3002|0x3004|0x311d|0xe004|0xe019)"; + match "product" "(0x1001|0x1002|0x1010|0x1011)"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0x3002|0x3004|0x311d)"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "0x9170"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0xe004|0xe019)"; action "kldload -n ng_ubt"; }; @@ -3537,7 +3729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1199"; - match "product" "0x68aa"; + match "product" "(0x68aa|0x68c0|0x9041)"; action "kldload -n u3g"; }; @@ -3649,7 +3841,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1803|0x1c05|0x1c0b)"; + match "product" "(0x1573|0x1803|0x1c05|0x1c0b)"; action "kldload -n u3g"; }; @@ -3841,6 +4033,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; + match "product" "0x0326"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; match "product" "0x0427"; action "kldload -n if_upgt"; }; @@ -3857,6 +4057,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; + match "product" "0x0804"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; match "product" "(0x0826|0x082a)"; action "kldload -n if_uath"; }; @@ -4424,6 +4632,22 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17e9"; + match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x0377|0x03e0|0x401a)"; + action "kldload -n udl"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x304b"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17ef"; match "product" "0x7203"; action "kldload -n if_axe"; @@ -4505,7 +4729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x19d2"; - match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x1181|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0103|0x0117|0x1179|0x1181|0x1420|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; action "kldload -n u3g"; }; @@ -4785,7 +5009,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x7e12|0xa805)"; + match "product" "(0x7d02|0x7e12|0xa707|0xa805)"; action "kldload -n u3g"; }; @@ -4817,6 +5041,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2019"; + match "product" "0x5304"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; match "product" "0xab01"; action "kldload -n if_rum"; }; @@ -5288,6 +5520,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0xcace"; + match "product" "0x0300"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0xdaae"; match "product" "0xead6"; action "kldload -n uslcom"; @@ -5393,7 +5633,7 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "host"; + match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x00"; @@ -5402,7 +5642,7 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "host"; + match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x01"; @@ -5412,6 +5652,15 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x03"; match "intsubclass" "0x01"; match "intprotocol" "0x01"; @@ -5552,5 +5801,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2658 USB entries processed +# 2719 USB entries processed From owner-svn-src-all@freebsd.org Mon Dec 14 09:53:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F9CA43B72; Mon, 14 Dec 2015 09:53:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FB81DD5; Mon, 14 Dec 2015 09:53:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9rIqq022776; Mon, 14 Dec 2015 09:53:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9rIM9022775; Mon, 14 Dec 2015 09:53:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140953.tBE9rIM9022775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:53: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: r292188 - stable/9/etc/devd 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:53:19 -0000 Author: hselasky Date: Mon Dec 14 09:53:18 2015 New Revision: 292188 URL: https://svnweb.freebsd.org/changeset/base/292188 Log: MFC r291703: Regenerate usb.conf . Modified: stable/9/etc/devd/usb.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/devd/usb.conf ============================================================================== --- stable/9/etc/devd/usb.conf Mon Dec 14 09:52:15 2015 (r292187) +++ stable/9/etc/devd/usb.conf Mon Dec 14 09:53:18 2015 (r292188) @@ -145,7 +145,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee1 8|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed7 4|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -169,7 +169,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0409"; - match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + match "product" "(0x00d5|0x00d6|0x00d7)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "0x0249"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x8024|0x8025)"; action "kldload -n uipaq"; }; @@ -281,7 +297,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01ee)"; + match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01a8|0x01ee)"; action "kldload -n if_run"; }; @@ -521,6 +537,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04bb"; + match "product" "0x093f"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; match "product" "(0x0944|0x0945|0x0947|0x0948)"; action "kldload -n if_run"; }; @@ -1064,6 +1088,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x057c"; + match "product" "0x8401"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0584"; match "product" "0xb000"; action "kldload -n uplcom"; @@ -1089,7 +1121,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0586"; - match "product" "(0x3416|0x341a|0x341e)"; + match "product" "0x3416"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "0x3417"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x341a|0x341e)"; action "kldload -n if_run"; }; @@ -1153,7 +1201,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0290|0x0291|0x0292)"; + match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0272|0x0273|0x0274|0x0290|0x0291|0x0292)"; action "kldload -n wsp"; }; @@ -1193,7 +1241,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9204|0x9205)"; + match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9002|0x9204|0x9205)"; action "kldload -n u3g"; }; @@ -1721,6 +1769,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; + match "product" "0x3a09"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; match "product" "0x3a0c"; action "kldload -n if_uath"; }; @@ -1729,6 +1785,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; + match "product" "0x3a0f"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)"; action "kldload -n if_rum"; }; @@ -1737,7 +1801,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; - match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "0x3c10"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c11|0x3c13|0x3c15|0x3c16)"; action "kldload -n if_run"; }; @@ -1848,6 +1928,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0xf522"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0841"; match "product" "0x0001"; action "kldload -n urio"; @@ -1921,7 +2009,39 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; - match "product" "(0x9021|0x9041)"; + match "product" "(0x9001|0x9010)"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9012"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9021"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9040"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9041"; action "kldload -n if_urtwn"; }; @@ -2184,6 +2304,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0ace"; + match "product" "0x1221"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0af0"; match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701)"; action "kldload -n u3g"; @@ -2545,6 +2673,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; + match "product" "0x8152"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bda"; match "product" "0x8170"; action "kldload -n if_urtwn"; }; @@ -2561,7 +2697,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; + match "product" "(0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; action "kldload -n if_urtwn"; }; @@ -2577,7 +2713,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "0x818a"; + match "product" "(0x818a|0x8191)"; action "kldload -n if_urtwn"; }; @@ -2680,6 +2816,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0c45"; + match "product" "0x7401"; + action "kldload -n ugold"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0c52"; match "product" "(0x2101|0x2102|0x2103|0x2104|0x2211|0x2212|0x2213|0x2221|0x2222|0x2223|0x2411|0x2412|0x2413|0x2421|0x2422|0x2423|0x2431|0x2432|0x2433|0x2441|0x2442|0x2443|0x2811|0x2812|0x2813|0x2821|0x2822|0x2823|0x2831|0x2832|0x2833|0x2841|0x2842|0x2843|0x2851|0x2852|0x2853|0x2861|0x2862|0x2863|0x2871|0x2872|0x2873|0x2881|0x2882|0x2883|0x9020)"; action "kldload -n uftdi"; @@ -2785,13 +2929,37 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cde"; - match "product" "(0x0022|0x0025)"; + match "product" "0x0022"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0023"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0025"; action "kldload -n if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0026"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0cf3"; match "product" "(0x0001|0x0003|0x0005)"; action "kldload -n if_uath"; @@ -2801,7 +2969,31 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cf3"; - match "product" "(0x3002|0x3004|0x311d|0xe004|0xe019)"; + match "product" "(0x1001|0x1002|0x1010|0x1011)"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0x3002|0x3004|0x311d)"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "0x9170"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0xe004|0xe019)"; action "kldload -n ng_ubt"; }; @@ -3537,7 +3729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1199"; - match "product" "0x68aa"; + match "product" "(0x68aa|0x68c0|0x9041)"; action "kldload -n u3g"; }; @@ -3649,7 +3841,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1803|0x1c05|0x1c0b)"; + match "product" "(0x1573|0x1803|0x1c05|0x1c0b)"; action "kldload -n u3g"; }; @@ -3841,6 +4033,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; + match "product" "0x0326"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; match "product" "0x0427"; action "kldload -n if_upgt"; }; @@ -3857,6 +4057,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; + match "product" "0x0804"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; match "product" "(0x0826|0x082a)"; action "kldload -n if_uath"; }; @@ -4424,6 +4632,22 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17e9"; + match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x0377|0x03e0|0x401a)"; + action "kldload -n udl"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x304b"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17ef"; match "product" "0x7203"; action "kldload -n if_axe"; @@ -4505,7 +4729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x19d2"; - match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x1181|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0103|0x0117|0x1179|0x1181|0x1420|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; action "kldload -n u3g"; }; @@ -4785,7 +5009,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x7e12|0xa805)"; + match "product" "(0x7d02|0x7e12|0xa707|0xa805)"; action "kldload -n u3g"; }; @@ -4817,6 +5041,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2019"; + match "product" "0x5304"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; match "product" "0xab01"; action "kldload -n if_rum"; }; @@ -5288,6 +5520,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0xcace"; + match "product" "0x0300"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0xdaae"; match "product" "0xead6"; action "kldload -n uslcom"; @@ -5393,7 +5633,7 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "host"; + match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x00"; @@ -5402,7 +5642,7 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "host"; + match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x01"; @@ -5412,6 +5652,15 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x03"; match "intsubclass" "0x01"; match "intprotocol" "0x01"; @@ -5552,5 +5801,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2658 USB entries processed +# 2719 USB entries processed From owner-svn-src-all@freebsd.org Mon Dec 14 09:55:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2D0EA43D88; Mon, 14 Dec 2015 09:55:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34CE1FB0; Mon, 14 Dec 2015 09:55:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9tEE1023116; Mon, 14 Dec 2015 09:55:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9tEe2023115; Mon, 14 Dec 2015 09:55:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140955.tBE9tEe2023115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:55: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: r292189 - stable/10/share/man/man4 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:55:15 -0000 Author: hselasky Date: Mon Dec 14 09:55:14 2015 New Revision: 292189 URL: https://svnweb.freebsd.org/changeset/base/292189 Log: MFC r291684: Update the mlx5en(4) manual page. Submitted by: Mark Bloch Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4348 Modified: stable/10/share/man/man4/mlx5en.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/mlx5en.4 ============================================================================== --- stable/10/share/man/man4/mlx5en.4 Mon Dec 14 09:53:18 2015 (r292188) +++ stable/10/share/man/man4/mlx5en.4 Mon Dec 14 09:55:14 2015 (r292189) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2015 +.Dd December 3, 2015 .Dt mlx5en 4 .Os .Sh NAME @@ -40,6 +40,12 @@ kernel configuration file: .Cd "device mlx5en" .Ed .Pp +To load the driver as a module at run-time, +run the following command as root: +.Bd -literal -offset indent +kldload mlx5en +.Ed +.Pp To load the driver as a module at boot time, place the following lines in .Xr loader.conf 5 : From owner-svn-src-all@freebsd.org Mon Dec 14 09:57:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033D3A43F6F; Mon, 14 Dec 2015 09:57:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C76EB11AB; Mon, 14 Dec 2015 09:57:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9vgUi023493; Mon, 14 Dec 2015 09:57:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9vgfp023492; Mon, 14 Dec 2015 09:57:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140957.tBE9vgfp023492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292190 - stable/10/sys/dev/mlx5/mlx5_en 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:57:44 -0000 Author: hselasky Date: Mon Dec 14 09:57:42 2015 New Revision: 292190 URL: https://svnweb.freebsd.org/changeset/base/292190 Log: MFC r291931: The firmware no longer supports setting a port MTU of zero bytes. Set the port MTU and then query it and report if any problems instead. Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4408 Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:55:14 2015 (r292189) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:57:42 2015 (r292190) @@ -2005,32 +2005,15 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp struct mlx5e_priv *priv = ifp->if_softc; struct mlx5_core_dev *mdev = priv->mdev; int hw_mtu; - int min_mtu; int err; - /* - * Trying to set MTU to zero, in order - * to find out the FW's minimal MTU - */ - err = mlx5_set_port_mtu(mdev, 0); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &min_mtu); + err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { - if_printf(ifp, "Query port minimal MTU failed\n"); + if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", + __func__, sw_mtu, err); return (err); } - - if (sw_mtu < MLX5E_HW2SW_MTU(min_mtu)) { - ifp->if_mtu = sw_mtu; - return (0); - } - - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); if (!err) { ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu); From owner-svn-src-all@freebsd.org Mon Dec 14 09:59:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2838A43064; Mon, 14 Dec 2015 09:59:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9C13134D; Mon, 14 Dec 2015 09:59:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9xLYw023775; Mon, 14 Dec 2015 09:59:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9xLGm023772; Mon, 14 Dec 2015 09:59:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140959.tBE9xLGm023772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292191 - stable/10/sys/dev/mlx5/mlx5_en 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 09:59:23 -0000 Author: hselasky Date: Mon Dec 14 09:59:21 2015 New Revision: 292191 URL: https://svnweb.freebsd.org/changeset/base/292191 Log: MFC r291932: Add support for setting the TX moderation mode via a sysctl entry. TX completion events can be moderated in the same way like RX completion events. Expose this functionality by a sysctl variable. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4409 Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 09:57:42 2015 (r292190) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 09:59:21 2015 (r292191) @@ -356,6 +356,7 @@ struct mlx5e_params { u8 default_vlan_prio; u8 num_tc; u8 rx_cq_moderation_mode; + u8 tx_cq_moderation_mode; u16 rx_cq_moderation_usec; u16 rx_cq_moderation_pkts; u16 tx_cq_moderation_usec; @@ -381,6 +382,7 @@ struct mlx5e_params { m(+1, u64 rx_coalesce_mode, "rx_coalesce_mode", "0: EQE mode 1: CQE mode") \ m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ + m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Dec 14 09:57:42 2015 (r292190) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Dec 14 09:59:21 2015 (r292191) @@ -136,6 +136,11 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.rx_coalesce_mode = 1; priv->params.rx_cq_moderation_mode = priv->params_ethtool.rx_coalesce_mode; + /* import TX mode */ + if (priv->params_ethtool.tx_coalesce_mode != 0) + priv->params_ethtool.tx_coalesce_mode = 1; + priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; + /* import RX coal time */ if (priv->params_ethtool.rx_coalesce_usecs < 1) priv->params_ethtool.rx_coalesce_usecs = 0; @@ -460,6 +465,7 @@ mlx5e_create_ethtool(struct mlx5e_priv * priv->params_ethtool.rx_coalesce_mode = priv->params.rx_cq_moderation_mode; priv->params_ethtool.rx_coalesce_usecs = priv->params.rx_cq_moderation_usec; priv->params_ethtool.rx_coalesce_pkts = priv->params.rx_cq_moderation_pkts; + priv->params_ethtool.tx_coalesce_mode = priv->params.tx_cq_moderation_mode; priv->params_ethtool.tx_coalesce_usecs = priv->params.tx_cq_moderation_usec; priv->params_ethtool.tx_coalesce_pkts = priv->params.tx_cq_moderation_pkts; priv->params_ethtool.hw_lro = priv->params.hw_lro_en; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:57:42 2015 (r292190) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:59:21 2015 (r292191) @@ -1324,13 +1324,25 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { + u8 tx_moderation_mode; int err; int tc; + switch (c->priv->params.tx_cq_moderation_mode) { + case 0: + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + else + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + &mlx5e_tx_cq_comp, tx_moderation_mode); if (err) goto err_close_tx_cqs; } From owner-svn-src-all@freebsd.org Mon Dec 14 10:03:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 685C9A4338E; Mon, 14 Dec 2015 10:03:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35B571858; Mon, 14 Dec 2015 10:03:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEA34Y1026796; Mon, 14 Dec 2015 10:03:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEA348m026795; Mon, 14 Dec 2015 10:03:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141003.tBEA348m026795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:03: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: r292192 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 10:03:05 -0000 Author: hselasky Date: Mon Dec 14 10:03:04 2015 New Revision: 292192 URL: https://svnweb.freebsd.org/changeset/base/292192 Log: MFC r290003: Add support for binding IRQs to CPUs in the LinuxKPI. The new function added is for BSD only and does not exist in Linux. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/interrupt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/interrupt.h ============================================================================== --- stable/10/sys/ofed/include/linux/interrupt.h Mon Dec 14 09:59:21 2015 (r292191) +++ stable/10/sys/ofed/include/linux/interrupt.h Mon Dec 14 10:03:04 2015 (r292192) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,23 @@ request_irq(unsigned int irq, irq_handle return 0; } +static inline int +bind_irq_to_cpu(unsigned int irq, int cpu_id) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return (-ENOENT); + + irqe = _irq_ent(dev, irq); + if (irqe == NULL) + return (-ENOENT); + + return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); +} + static inline void free_irq(unsigned int irq, void *device) { From owner-svn-src-all@freebsd.org Mon Dec 14 10:04:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 278FCA434F0; Mon, 14 Dec 2015 10:04:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE5F01A2F; Mon, 14 Dec 2015 10:04:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEA4wAs027100; Mon, 14 Dec 2015 10:04:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEA4wd2027099; Mon, 14 Dec 2015 10:04:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141004.tBEA4wd2027099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:04:58 +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: r292193 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 10:04:59 -0000 Author: hselasky Date: Mon Dec 14 10:04:57 2015 New Revision: 292193 URL: https://svnweb.freebsd.org/changeset/base/292193 Log: MFC r290003: Add support for binding IRQs to CPUs in the LinuxKPI. The new function added is for BSD only and does not exist in Linux. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/include/linux/interrupt.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/interrupt.h ============================================================================== --- stable/9/sys/ofed/include/linux/interrupt.h Mon Dec 14 10:03:04 2015 (r292192) +++ stable/9/sys/ofed/include/linux/interrupt.h Mon Dec 14 10:04:57 2015 (r292193) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,23 @@ request_irq(unsigned int irq, irq_handle return 0; } +static inline int +bind_irq_to_cpu(unsigned int irq, int cpu_id) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return (-ENOENT); + + irqe = _irq_ent(dev, irq); + if (irqe == NULL) + return (-ENOENT); + + return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); +} + static inline void free_irq(unsigned int irq, void *device) { From owner-svn-src-all@freebsd.org Mon Dec 14 10:06:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57749A435C4; Mon, 14 Dec 2015 10:06:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 288131BB4; Mon, 14 Dec 2015 10:06:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEA6179027293; Mon, 14 Dec 2015 10:06:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEA61cP027292; Mon, 14 Dec 2015 10:06:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512141006.tBEA61cP027292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Dec 2015 10:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292194 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 10:06:02 -0000 Author: andrew Date: Mon Dec 14 10:06:01 2015 New Revision: 292194 URL: https://svnweb.freebsd.org/changeset/base/292194 Log: Skip restoring more registers when returning from an exception taken in the kernel. These registers are all callee saved, and as such will be restored before returning to the exception handler. Userland still needs these registers to be restored as they may be changed by the kernel and we don't currently track these places. Modified: head/sys/arm64/arm64/exception.S Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Mon Dec 14 10:04:57 2015 (r292193) +++ head/sys/arm64/arm64/exception.S Mon Dec 14 10:06:01 2015 (r292194) @@ -90,15 +90,19 @@ __FBSDID("$FreeBSD$"); ldp x14, x15, [sp, #(TF_X + 14 * 8)] ldp x16, x17, [sp, #(TF_X + 16 * 8)] .if \el == 0 + /* + * We only restore the callee saved registers when returning to + * userland as they may have been updated by a system call or signal. + */ ldp x18, x19, [sp, #(TF_X + 18 * 8)] -.else - ldr x19, [sp, #(TF_X + 19 * 8)] -.endif ldp x20, x21, [sp, #(TF_X + 20 * 8)] ldp x22, x23, [sp, #(TF_X + 22 * 8)] ldp x24, x25, [sp, #(TF_X + 24 * 8)] ldp x26, x27, [sp, #(TF_X + 26 * 8)] ldp x28, x29, [sp, #(TF_X + 28 * 8)] +.else + ldr x29, [sp, #(TF_X + 29 * 8)] +.endif .if \el == 0 add sp, sp, #(TF_SIZE + 16) .else From owner-svn-src-all@freebsd.org Mon Dec 14 10:18:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5217BA43E8F; Mon, 14 Dec 2015 10:18:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F82C1148; Mon, 14 Dec 2015 10:18:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEAI51P031536; Mon, 14 Dec 2015 10:18:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEAI4PS031530; Mon, 14 Dec 2015 10:18:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141018.tBEAI4PS031530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:18: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: r292195 - in stable/10/sys/dev/mlx5: mlx5_core mlx5_en 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 10:18:06 -0000 Author: hselasky Date: Mon Dec 14 10:18:04 2015 New Revision: 292195 URL: https://svnweb.freebsd.org/changeset/base/292195 Log: MFC r291938: Add full support for Receive Side Scaling, RSS, to the mlx5en driver. This includes binding all interrupt and worker threads according to the RSS configuration, setting up correct Toeplitz hashing keys as given by RSS and setting the correct mbuf hashtype for all received traffic. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4410 Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:18:04 2015 (r292195) @@ -31,6 +31,15 @@ #include #include "mlx5_core.h" +#if (__FreeBSD_version >= 1100000) +#include "opt_rss.h" +#endif + +#ifdef RSS +#include +#include +#endif + enum { MLX5_EQE_SIZE = sizeof(struct mlx5_eqe), MLX5_EQE_OWNER_INIT_VAL = 0x1, @@ -389,6 +398,18 @@ int mlx5_create_map_eq(struct mlx5_core_ priv->irq_info[vecidx].name, eq); if (err) goto err_eq; +#ifdef RSS + if (vecidx >= MLX5_EQ_VEC_COMP_BASE) { + u8 bucket = vecidx - MLX5_EQ_VEC_COMP_BASE; + err = bind_irq_to_cpu(priv->msix_arr[vecidx].vector, + rss_getcpu(bucket % rss_getnumbuckets())); + if (err) + goto err_irq; + } +#else + if (0) + goto err_irq; +#endif /* EQs are created in ARMED state @@ -398,6 +419,8 @@ int mlx5_create_map_eq(struct mlx5_core_ kvfree(in); return 0; +err_irq: + free_irq(priv->msix_arr[vecidx].vector, eq); err_eq: mlx5_cmd_destroy_eq(dev, eq->eqn); Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 10:18:04 2015 (r292195) @@ -50,6 +50,15 @@ #include #include +#if (__FreeBSD_version >= 1100000) +#include "opt_rss.h" +#endif + +#ifdef RSS +#include +#include +#endif + #include #ifdef HAVE_TURBO_LRO Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 10:18:04 2015 (r292195) @@ -931,6 +931,10 @@ mlx5e_create_sq(struct mlx5e_channel *c, void *sqc = param->sqc; void *sqc_wq = MLX5_ADDR_OF(sqc, sqc, wq); +#ifdef RSS + cpuset_t cpu_mask; + int cpu_id; +#endif int err; /* Create DMA descriptor TAG */ @@ -991,9 +995,15 @@ mlx5e_create_sq(struct mlx5e_channel *c, } TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, "%s tx sq", - c->ifp->if_xname); - +#ifdef RSS + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); +#else + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); +#endif snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1768,8 +1778,14 @@ mlx5e_open_rqt(struct mlx5e_priv *priv) MLX5_SET(rqtc, rqtc, rqt_max_size, sz); for (i = 0; i < sz; i++) { - int ix = i % priv->params.num_channels; - + int ix; +#ifdef RSS + ix = rss_get_indirection_to_bucket(i); +#else + ix = i; +#endif + /* ensure we don't overflow */ + ix %= priv->params.num_channels; MLX5_SET(rqtc, rqtc, rq_num[i], priv->channel[ix]->rq.rqn); } @@ -1834,6 +1850,8 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_CAP_ETH(priv->mdev, lro_timer_supported_periods[2])); } + + /* setup parameters for hashing TIR type, if any */ switch (tt) { case MLX5E_TT_ANY: MLX5_SET(tirc, tirc, disp_type, @@ -1848,8 +1866,16 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p priv->rqtn); MLX5_SET(tirc, tirc, rx_hash_fn, MLX5_TIRC_RX_HASH_FN_HASH_TOEPLITZ); - MLX5_SET(tirc, tirc, rx_hash_symmetric, 1); hkey = (__be32 *) MLX5_ADDR_OF(tirc, tirc, rx_hash_toeplitz_key); +#ifdef RSS + /* + * The FreeBSD RSS implementation does currently not + * support symmetric Toeplitz hashes: + */ + MLX5_SET(tirc, tirc, rx_hash_symmetric, 0); + rss_getkey((uint8_t *)hkey); +#else + MLX5_SET(tirc, tirc, rx_hash_symmetric, 1); hkey[0] = cpu_to_be32(0xD181C62C); hkey[1] = cpu_to_be32(0xF7F4DB5B); hkey[2] = cpu_to_be32(0x1983A2FC); @@ -1860,6 +1886,7 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p hkey[7] = cpu_to_be32(0x593D56D9); hkey[8] = cpu_to_be32(0xF3253C06); hkey[9] = cpu_to_be32(0x2ADC1FFC); +#endif break; } @@ -1869,6 +1896,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV4); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_TCP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV4)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1878,6 +1911,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV6); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_TCP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1887,6 +1926,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV4); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_UDP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1896,6 +1941,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV6); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_UDP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -2052,6 +2103,13 @@ mlx5e_open_locked(struct ifnet *ifp) if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) return (0); +#ifdef RSS + if (rss_getnumbuckets() > priv->params.num_channels) { + if_printf(ifp, "NOTE: There are more RSS buckets(%u) than " + "channels(%u) available\n", rss_getnumbuckets(), + priv->params.num_channels); + } +#endif err = mlx5e_open_tises(priv); if (err) { if_printf(ifp, "%s: mlx5e_open_tises failed, %d\n", Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Dec 14 10:18:04 2015 (r292195) @@ -192,12 +192,43 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *c mb->m_pkthdr.len = mb->m_len = cqe_bcnt; /* check if a Toeplitz hash was computed */ - if (cqe->rss_hash_type != 0) + if (cqe->rss_hash_type != 0) { mb->m_pkthdr.flowid = be32_to_cpu(cqe->rss_hash_result); - else +#ifdef RSS + /* decode the RSS hash type */ + switch (cqe->rss_hash_type & + (CQE_RSS_DST_HTYPE_L4 | CQE_RSS_DST_HTYPE_IP)) { + /* IPv4 */ + case (CQE_RSS_DST_HTYPE_TCP | CQE_RSS_DST_HTYPE_IPV4): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_TCP_IPV4); + break; + case (CQE_RSS_DST_HTYPE_UDP | CQE_RSS_DST_HTYPE_IPV4): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_UDP_IPV4); + break; + case CQE_RSS_DST_HTYPE_IPV4: + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV4); + break; + /* IPv6 */ + case (CQE_RSS_DST_HTYPE_TCP | CQE_RSS_DST_HTYPE_IPV6): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_TCP_IPV6); + break; + case (CQE_RSS_DST_HTYPE_UDP | CQE_RSS_DST_HTYPE_IPV6): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_UDP_IPV6); + break; + case CQE_RSS_DST_HTYPE_IPV6: + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV6); + break; + default: /* Other */ + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + break; + } +#else + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); +#endif + } else { mb->m_pkthdr.flowid = rq->ix; - - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + } mb->m_pkthdr.rcvif = ifp; if (likely(ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) && Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Dec 14 10:18:04 2015 (r292195) @@ -85,7 +85,15 @@ mlx5e_select_queue(struct ifnet *ifp, st /* check if flowid is set */ if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE) { - ch = (mb->m_pkthdr.flowid % 128) % ch; +#ifdef RSS + u32 temp; + + if (rss_hash2bucket(mb->m_pkthdr.flowid, + M_HASHTYPE_GET(mb), &temp) == 0) + ch = temp % ch; + else +#endif + ch = (mb->m_pkthdr.flowid % 128) % ch; } else { #if (__FreeBSD_version >= 1100000) ch = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 | From owner-svn-src-all@freebsd.org Mon Dec 14 10:31:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 374BCA448CB; Mon, 14 Dec 2015 10:31:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03B701A8E; Mon, 14 Dec 2015 10:31:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEAV4hh036552; Mon, 14 Dec 2015 10:31:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEAV3al036539; Mon, 14 Dec 2015 10:31:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141031.tBEAV3al036539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292196 - in stable/10/sys: dev/mlx5 dev/mlx5/mlx5_core modules/mlx5 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 10:31:05 -0000 Author: hselasky Date: Mon Dec 14 10:31:03 2015 New Revision: 292196 URL: https://svnweb.freebsd.org/changeset/base/292196 Log: MFC r291939: Update the mlx5 shared driver code to the latest version, which include the following list of changes: - Added eswitch ACL table management Introduce API for managing ACL table. This API include the following features: 1) vlan filter - for VST/VGT+ support. 2) spoofcheck. 3) robust functionality to allow/drop general untagged/tagged traffic. 4) support for both ingress and egress ACL types. - Added loopback filter to the vacl table. - Added multicast list set in the vPort context - Added promiscuous mode set in the vPort context - Set the vlan list in vPort context 1) Check caps if VLAN list is not longer than FW supports 2) Set MODIFY_NIC_VPORT_CONTEXT command - Changed MLX5_EEPROM_MAX_BYTES from 48 to 32 so that a single EEPROM reading cannot cross the 128-byte boundary. Previously reading the MCIA register was done in batches of 48 bytes. The third reading would then by-pass the 127th byte, which means that part of the low page and part of the high page would be read at the same time, which created a bug: 1st: 0-47 bytes 2nd: 48-95 bytes 3rd: 96-143 bytes Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4411 Added: stable/10/sys/dev/mlx5/eswitch_vacl.h - copied unchanged from r291939, head/sys/dev/mlx5/eswitch_vacl.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c - copied, changed from r291939, head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/10/sys/dev/mlx5/vport.h stable/10/sys/modules/mlx5/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/device.h Mon Dec 14 10:31:03 2015 (r292196) @@ -1023,6 +1023,25 @@ enum { MLX5_MODIFY_ESW_VPORT_CONTEXT_FIELD_SELECT_CVLAN_INSERT = 1 << 3 }; +enum { + MLX5_UC_ADDR_CHANGE = (1 << 0), + MLX5_MC_ADDR_CHANGE = (1 << 1), + MLX5_VLAN_CHANGE = (1 << 2), + MLX5_PROMISC_CHANGE = (1 << 3), + MLX5_MTU_CHANGE = (1 << 4), +}; + +enum mlx5_list_type { + MLX5_NIC_VPORT_LIST_TYPE_UC = 0x0, + MLX5_NIC_VPORT_LIST_TYPE_MC = 0x1, + MLX5_NIC_VPORT_LIST_TYPE_VLAN = 0x2, +}; + +enum { + MLX5_ESW_VPORT_ADMIN_STATE_DOWN = 0x0, + MLX5_ESW_VPORT_ADMIN_STATE_UP = 0x1, + MLX5_ESW_VPORT_ADMIN_STATE_AUTO = 0x2, +}; /* MLX5 DEV CAPs */ /* TODO: EAT.ME */ @@ -1087,6 +1106,22 @@ enum mlx5_cap_type { MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_max[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) +#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(dev, \ + flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ + flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(dev, \ + flow_table_properties_esw_acl_ingress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ + flow_table_properties_esw_acl_ingress.cap) + #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ mdev->hca_caps_cur[MLX5_CAP_ESWITCH], cap) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/driver.h Mon Dec 14 10:31:03 2015 (r292196) @@ -934,7 +934,7 @@ struct mlx5_profile { }; -#define MLX5_EEPROM_MAX_BYTES 48 +#define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff #define MLX5_EEPROM_REVISION_ID_BYTE_MASK 0x0000ff00 #define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK 0x00040000 Copied: stable/10/sys/dev/mlx5/eswitch_vacl.h (from r291939, head/sys/dev/mlx5/eswitch_vacl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/eswitch_vacl.h Mon Dec 14 10:31:03 2015 (r292196, copy of r291939, head/sys/dev/mlx5/eswitch_vacl.h) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * 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 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 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 MLX5_ESWITCH_VACL_TABLE_H +#define MLX5_ESWITCH_VACL_TABLE_H + +#include + +void *mlx5_vacl_table_create(struct mlx5_core_dev *dev, + u16 vport, bool is_egress); +void mlx5_vacl_table_cleanup(void *acl_t); +int mlx5_vacl_table_add_vlan(void *acl_t, u16 vlan); +void mlx5_vacl_table_del_vlan(void *acl_t, u16 vlan); +int mlx5_vacl_table_enable_vlan_filter(void *acl_t); +void mlx5_vacl_table_disable_vlan_filter(void *acl_t); +int mlx5_vacl_table_drop_untagged(void *acl_t); +int mlx5_vacl_table_allow_untagged(void *acl_t); +int mlx5_vacl_table_drop_unknown_vlan(void *acl_t); +int mlx5_vacl_table_allow_unknown_vlan(void *acl_t); +int mlx5_vacl_table_set_spoofchk(void *acl_t, bool spoofchk, u8 *vport_mac); + +#endif /* MLX5_ESWITCH_VACL_TABLE_H */ Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:31:03 2015 (r292196) @@ -64,7 +64,6 @@ enum { (1ull << MLX5_EVENT_TYPE_WQ_INVAL_REQ_ERROR) | \ (1ull << MLX5_EVENT_TYPE_WQ_ACCESS_ERROR) | \ (1ull << MLX5_EVENT_TYPE_PORT_CHANGE) | \ - (1ull << MLX5_EVENT_TYPE_NIC_VPORT_CHANGE) | \ (1ull << MLX5_EVENT_TYPE_SRQ_CATAS_ERROR) | \ (1ull << MLX5_EVENT_TYPE_SRQ_LAST_WQE) | \ (1ull << MLX5_EVENT_TYPE_SRQ_RQ_LIMIT)) @@ -475,6 +474,10 @@ int mlx5_start_eqs(struct mlx5_core_dev async_event_mask |= (1ull << MLX5_EVENT_TYPE_CODING_PORT_MODULE_EVENT); + if (MLX5_CAP_GEN(dev, nic_vport_change_event)) + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_NIC_VPORT_CHANGE); + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); Copied and modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c (from r291939, head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c) ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Mon Dec 7 13:16:48 2015 (r291939, copy source) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Mon Dec 14 10:31:03 2015 (r292196) @@ -25,6 +25,7 @@ * $FreeBSD$ */ +#include #include #include #include Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c Mon Dec 14 10:31:03 2015 (r292196) @@ -328,7 +328,8 @@ int mlx5_set_nic_vport_current_mac(struc MLX5_SET(modify_nic_vport_context_in, in, field_select.addresses_list, 1); MLX5_SET(modify_nic_vport_context_in, in, - nic_vport_context.allowed_list_type, 0); + nic_vport_context.allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_UC); MLX5_SET(modify_nic_vport_context_in, in, nic_vport_context.allowed_list_size, 1); @@ -345,6 +346,131 @@ int mlx5_set_nic_vport_current_mac(struc return err; } EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_current_mac); + +int mlx5_set_nic_vport_vlan_list(struct mlx5_core_dev *dev, u32 vport, + u16 *vlan_list, int list_len) +{ + void *in, *ctx; + int i, err; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + MLX5_ST_SZ_BYTES(vlan_layout) * (int)list_len; + + int max_list_size = 1 << MLX5_CAP_GEN_MAX(dev, log_max_vlan_list); + + if (list_len > max_list_size) { + mlx5_core_warn(dev, "Requested list size (%d) > (%d) max_list_size\n", + list_len, max_list_size); + return -ENOSPC; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(dev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, nic_vport_context); + + MLX5_SET(nic_vport_context, ctx, allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_VLAN); + MLX5_SET(nic_vport_context, ctx, allowed_list_size, list_len); + + for (i = 0; i < list_len; i++) { + u8 *vlan_lout = MLX5_ADDR_OF(nic_vport_context, ctx, + current_uc_mac_address[i]); + MLX5_SET(vlan_layout, vlan_lout, vlan, vlan_list[i]); + } + + err = mlx5_modify_nic_vport_context(dev, in, inlen); + + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_vlan_list); + +int mlx5_set_nic_vport_mc_list(struct mlx5_core_dev *mdev, int vport, + u64 *addr_list, size_t addr_list_len) +{ + void *in, *ctx; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + MLX5_ST_SZ_BYTES(mac_address_layout) * (int)addr_list_len; + int err; + size_t i; + int max_list_sz = 1 << MLX5_CAP_GEN_MAX(mdev, log_max_current_mc_list); + + if ((int)addr_list_len > max_list_sz) { + mlx5_core_warn(mdev, "Requested list size (%d) > (%d) max_list_size\n", + (int)addr_list_len, max_list_sz); + return -ENOSPC; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(mdev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, nic_vport_context); + + MLX5_SET(nic_vport_context, ctx, allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_MC); + MLX5_SET(nic_vport_context, ctx, allowed_list_size, addr_list_len); + + for (i = 0; i < addr_list_len; i++) { + u8 *mac_lout = (u8 *)MLX5_ADDR_OF(nic_vport_context, ctx, + current_uc_mac_address[i]); + u8 *mac_ptr = (u8 *)MLX5_ADDR_OF(mac_address_layout, mac_lout, + mac_addr_47_32); + ether_addr_copy(mac_ptr, (u8 *)&addr_list[i]); + } + + err = mlx5_modify_nic_vport_context(mdev, in, inlen); + + kvfree(in); + + return err; +} +EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_mc_list); + +int mlx5_set_nic_vport_promisc(struct mlx5_core_dev *mdev, int vport, + bool promisc_mc, bool promisc_uc, + bool promisc_all) +{ + u8 in[MLX5_ST_SZ_BYTES(modify_nic_vport_context_in)]; + u8 *ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, + nic_vport_context); + + memset(in, 0, MLX5_ST_SZ_BYTES(modify_nic_vport_context_in)); + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, field_select.promisc, 1); + if (promisc_mc) + MLX5_SET(nic_vport_context, ctx, promisc_mc, 1); + if (promisc_uc) + MLX5_SET(nic_vport_context, ctx, promisc_uc, 1); + if (promisc_all) + MLX5_SET(nic_vport_context, ctx, promisc_all, 1); + + return mlx5_modify_nic_vport_context(mdev, in, sizeof(in)); +} +EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_promisc); int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, u8 *addr) { Modified: stable/10/sys/dev/mlx5/vport.h ============================================================================== --- stable/10/sys/dev/mlx5/vport.h Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/vport.h Mon Dec 14 10:31:03 2015 (r292196) @@ -42,6 +42,13 @@ int mlx5_query_nic_vport_mac_address(str u32 vport, u8 *addr); int mlx5_set_nic_vport_current_mac(struct mlx5_core_dev *mdev, int vport, bool other_vport, u8 *addr); +int mlx5_set_nic_vport_vlan_list(struct mlx5_core_dev *dev, u32 vport, + u16 *vlan_list, int list_len); +int mlx5_set_nic_vport_mc_list(struct mlx5_core_dev *mdev, int vport, + u64 *addr_list, size_t addr_list_len); +int mlx5_set_nic_vport_promisc(struct mlx5_core_dev *mdev, int vport, + bool promisc_mc, bool promisc_uc, + bool promisc_all); int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, u8 *addr); int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); Modified: stable/10/sys/modules/mlx5/Makefile ============================================================================== --- stable/10/sys/modules/mlx5/Makefile Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/modules/mlx5/Makefile Mon Dec 14 10:31:03 2015 (r292196) @@ -7,6 +7,7 @@ mlx5_alloc.c \ mlx5_cmd.c \ mlx5_cq.c \ mlx5_eq.c \ +mlx5_eswitch_vacl.c \ mlx5_flow_table.c \ mlx5_fw.c \ mlx5_health.c \ From owner-svn-src-all@freebsd.org Mon Dec 14 11:13:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EEBAA437D4; Mon, 14 Dec 2015 11:13:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF521989; Mon, 14 Dec 2015 11:13:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBDpgW054984; Mon, 14 Dec 2015 11:13:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBDpZV054983; Mon, 14 Dec 2015 11:13:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512141113.tBEBDpZV054983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Dec 2015 11:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292197 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 11:13:52 -0000 Author: andrew Date: Mon Dec 14 11:13:50 2015 New Revision: 292197 URL: https://svnweb.freebsd.org/changeset/base/292197 Log: When exiting two-finger scroll the Synaptics device may report a jump in absolute position. This seems to be correlated with only removing a single finger. To work around this report no movement on from the first packet when the user exits scrolling. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon Dec 14 10:31:03 2015 (r292196) +++ head/sys/dev/atkbdc/psm.c Mon Dec 14 11:13:50 2015 (r292197) @@ -2841,6 +2841,7 @@ proc_synaptics(struct psm_softc *sc, pac int two_finger_scroll; int len, weight_prev_x, weight_prev_y; int div_max_x, div_max_y, div_x, div_y; + int exiting_scroll; /* Read sysctl. */ /* XXX Verify values? */ @@ -2867,6 +2868,8 @@ proc_synaptics(struct psm_softc *sc, pac vscroll_ver_area = sc->syninfo.vscroll_ver_area; two_finger_scroll = sc->syninfo.two_finger_scroll; + exiting_scroll = 0; + /* Palm detection. */ if (!( ((sc->synhw.capMultiFinger || @@ -3068,8 +3071,10 @@ proc_synaptics(struct psm_softc *sc, pac * Reset two finger scrolling when the number of fingers * is different from two. */ - if (two_finger_scroll && w != 0) + if (two_finger_scroll && w != 0 && synaction->in_vscroll != 0) { synaction->in_vscroll = 0; + exiting_scroll = 1; + } VLOG(5, (LOG_DEBUG, "synaptics: virtual scrolling: %s " @@ -3177,6 +3182,10 @@ proc_synaptics(struct psm_softc *sc, pac /* The pointer is not moved. */ *x = *y = 0; } else { + /* On exit the x/y pos may jump, ignore this */ + if (exiting_scroll) + *x = *y = 0; + VLOG(3, (LOG_DEBUG, "synaptics: [%d, %d] -> [%d, %d]\n", dx, dy, *x, *y)); } From owner-svn-src-all@freebsd.org Mon Dec 14 11:28:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA3EA4408A; Mon, 14 Dec 2015 11:28:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8D01FCE; Mon, 14 Dec 2015 11:28:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBSGRI058565; Mon, 14 Dec 2015 11:28:16 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBSGqx058564; Mon, 14 Dec 2015 11:28:16 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141128.tBEBSGqx058564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:28:16 +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: r292198 - stable/10/share/examples/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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 11:28:17 -0000 Author: brueffer Date: Mon Dec 14 11:28:16 2015 New Revision: 292198 URL: https://svnweb.freebsd.org/changeset/base/292198 Log: MFH: r291950 Fix a typo in the CPUTYPE list. PR: 205099 Submitted by: xxjack12xx@gmail.com Modified: stable/10/share/examples/etc/make.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/etc/make.conf ============================================================================== --- stable/10/share/examples/etc/make.conf Mon Dec 14 11:13:50 2015 (r292197) +++ stable/10/share/examples/etc/make.conf Mon Dec 14 11:28:16 2015 (r292198) @@ -32,7 +32,7 @@ # Intel x86 architecture: # (AMD CPUs) amdfam10, opteron-sse3, athlon64-sse3, k8-sse3, # opteron, athlon64, athlon-fx, k8, athlon-mp, -# athlen-xp, athlon-4, athlon-tbird, athlon, k7, +# athlon-xp, athlon-4, athlon-tbird, athlon, k7, # geode, k6-3, k6-2, k6 # (Intel CPUs) core2, core, nocona, pentium4m, pentium4, prescott, # pentium3m, pentium3, pentium-m, pentium2, From owner-svn-src-all@freebsd.org Mon Dec 14 11:34:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134A4A444BD; Mon, 14 Dec 2015 11:34:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D839114FF; Mon, 14 Dec 2015 11:34:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBY0cF061390; Mon, 14 Dec 2015 11:34:00 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBY0NU061389; Mon, 14 Dec 2015 11:34:00 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141134.tBEBY0NU061389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292199 - stable/10/share/man/man9 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 11:34:02 -0000 Author: brueffer Date: Mon Dec 14 11:34:00 2015 New Revision: 292199 URL: https://svnweb.freebsd.org/changeset/base/292199 Log: MFH: r291954 Add an MLINK for m_collapse. PR: 204205 Submitted by: avos Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Mon Dec 14 11:28:16 2015 (r292198) +++ stable/10/share/man/man9/Makefile Mon Dec 14 11:34:00 2015 (r292199) @@ -889,6 +889,7 @@ MLINKS+=\ mbuf.9 m_cat.9 \ mbuf.9 MCHTYPE.9 \ mbuf.9 MCLGET.9 \ + mbuf.9 m_collapse.9 \ mbuf.9 m_copyback.9 \ mbuf.9 m_copydata.9 \ mbuf.9 m_copym.9 \ From owner-svn-src-all@freebsd.org Mon Dec 14 11:36:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2027A44610; Mon, 14 Dec 2015 11:36:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9861785; Mon, 14 Dec 2015 11:36:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBa1V7061665; Mon, 14 Dec 2015 11:36:01 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBa1YF061664; Mon, 14 Dec 2015 11:36:01 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141136.tBEBa1YF061664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:36:01 +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: r292200 - stable/9/share/man/man9 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 11:36:02 -0000 Author: brueffer Date: Mon Dec 14 11:36:01 2015 New Revision: 292200 URL: https://svnweb.freebsd.org/changeset/base/292200 Log: MFH: r291954 Add an MLINK for m_collapse. PR: 204205 Submitted by: avos Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Dec 14 11:34:00 2015 (r292199) +++ stable/9/share/man/man9/Makefile Mon Dec 14 11:36:01 2015 (r292200) @@ -857,6 +857,7 @@ MLINKS+=\ mbuf.9 m_cat.9 \ mbuf.9 MCHTYPE.9 \ mbuf.9 MCLGET.9 \ + mbuf.9 m_collapse.9 \ mbuf.9 m_copyback.9 \ mbuf.9 m_copydata.9 \ mbuf.9 m_copym.9 \ From owner-svn-src-all@freebsd.org Mon Dec 14 11:38:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E932DA447D6; Mon, 14 Dec 2015 11:38:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCA681A91; Mon, 14 Dec 2015 11:38:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBchWE061810; Mon, 14 Dec 2015 11:38:43 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBcho3061809; Mon, 14 Dec 2015 11:38:43 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141138.tBEBcho3061809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292201 - stable/10/share/man/man9 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 11:38:45 -0000 Author: brueffer Date: Mon Dec 14 11:38:43 2015 New Revision: 292201 URL: https://svnweb.freebsd.org/changeset/base/292201 Log: MFH: r291957 Fix a comment typo in the code example. PR: 203497 Submitted by: chadf@triularity.org Modified: stable/10/share/man/man9/g_bio.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/g_bio.9 ============================================================================== --- stable/10/share/man/man9/g_bio.9 Mon Dec 14 11:36:01 2015 (r292200) +++ stable/10/share/man/man9/g_bio.9 Mon Dec 14 11:38:43 2015 (r292201) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd December 7, 2015 .Dt G_BIO 9 .Os .Sh NAME @@ -253,7 +253,7 @@ example_start(struct bio *bp) /* Ok, schedule it down. */ /* * The consumer can be obtained from - * LIST_FIRST(&bp->bio_to->geom->consumers) as well, + * LIST_FIRST(&bp->bio_to->geom->consumer) as well, * if there is only one in our geom. */ g_io_request(cbp, sc->ex_consumer); From owner-svn-src-all@freebsd.org Mon Dec 14 11:39:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 925E6A44938; Mon, 14 Dec 2015 11:39:47 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 633291D59; Mon, 14 Dec 2015 11:39:47 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBdkix062080; Mon, 14 Dec 2015 11:39:46 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBdkXb062079; Mon, 14 Dec 2015 11:39:46 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141139.tBEBdkXb062079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292202 - stable/9/share/man/man9 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 11:39:47 -0000 Author: brueffer Date: Mon Dec 14 11:39:46 2015 New Revision: 292202 URL: https://svnweb.freebsd.org/changeset/base/292202 Log: MFH: r291957 Fix a comment typo in the code example. PR: 203497 Submitted by: chadf@triularity.org Modified: stable/9/share/man/man9/g_bio.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/g_bio.9 ============================================================================== --- stable/9/share/man/man9/g_bio.9 Mon Dec 14 11:38:43 2015 (r292201) +++ stable/9/share/man/man9/g_bio.9 Mon Dec 14 11:39:46 2015 (r292202) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd December 7, 2015 .Dt G_BIO 9 .Os .Sh NAME @@ -253,7 +253,7 @@ example_start(struct bio *bp) /* Ok, schedule it down. */ /* * The consumer can be obtained from - * LIST_FIRST(&bp->bio_to->geom->consumers) as well, + * LIST_FIRST(&bp->bio_to->geom->consumer) as well, * if there is only one in our geom. */ g_io_request(cbp, sc->ex_consumer); From owner-svn-src-all@freebsd.org Mon Dec 14 12:36:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAE0DA42272; Mon, 14 Dec 2015 12:36:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9479D1DB7; Mon, 14 Dec 2015 12:36:11 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBECaAwh079693; Mon, 14 Dec 2015 12:36:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBECaAtN079691; Mon, 14 Dec 2015 12:36:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512141236.tBECaAtN079691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 14 Dec 2015 12:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292203 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 12:36:11 -0000 Author: avos Date: Mon Dec 14 12:36:10 2015 New Revision: 292203 URL: https://svnweb.freebsd.org/changeset/base/292203 Log: urtwn: add TSF field into RX radiotap header. Tested with RTL8188EU, MONITOR/STA modes. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3831 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Dec 14 11:39:46 2015 (r292202) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Dec 14 12:36:10 2015 (r292203) @@ -259,6 +259,7 @@ static int urtwn_key_delete(struct ieee static void urtwn_tsf_task_adhoc(void *, int); static void urtwn_tsf_sync_enable(struct urtwn_softc *, struct ieee80211vap *); +static void urtwn_get_tsf(struct urtwn_softc *, uint64_t *); static void urtwn_set_led(struct urtwn_softc *, int, int); static void urtwn_set_mode(struct urtwn_softc *, uint8_t); static void urtwn_ibss_recv_mgmt(struct ieee80211_node *, @@ -784,6 +785,16 @@ urtwn_rx_frame(struct urtwn_softc *sc, u struct urtwn_rx_radiotap_header *tap = &sc->sc_rxtap; tap->wr_flags = 0; + + urtwn_get_tsf(sc, &tap->wr_tsft); + if (__predict_false(le32toh((uint32_t)tap->wr_tsft) < + le32toh(stat->rxdw5))) { + tap->wr_tsft = le32toh(tap->wr_tsft >> 32) - 1; + tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32; + } else + tap->wr_tsft &= 0xffffffff00000000; + tap->wr_tsft += stat->rxdw5; + /* Map HW rate index to 802.11 rate. */ if (!(rxdw3 & R92C_RXDW3_HT)) { tap->wr_rate = ridx2rate[rate]; @@ -2110,6 +2121,12 @@ urtwn_tsf_sync_enable(struct urtwn_softc } static void +urtwn_get_tsf(struct urtwn_softc *sc, uint64_t *buf) +{ + urtwn_read_region_1(sc, R92C_TSFTR, (uint8_t *)buf, sizeof(*buf)); +} + +static void urtwn_set_led(struct urtwn_softc *sc, int led, int on) { uint8_t reg; @@ -2162,7 +2179,6 @@ urtwn_ibss_recv_mgmt(struct ieee80211_no (subtype == IEEE80211_FC0_SUBTYPE_BEACON || subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { ni_tstamp = le64toh(ni->ni_tstamp.tsf); -#ifdef D3831 URTWN_LOCK(sc); urtwn_get_tsf(sc, &curr_tstamp); URTWN_UNLOCK(sc); @@ -2170,10 +2186,6 @@ urtwn_ibss_recv_mgmt(struct ieee80211_no if (ni_tstamp >= curr_tstamp) (void) ieee80211_ibss_merge(ni); -#else - (void) sc; - (void) curr_tstamp; -#endif } } Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Mon Dec 14 11:39:46 2015 (r292202) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Mon Dec 14 12:36:10 2015 (r292203) @@ -33,6 +33,7 @@ struct urtwn_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; + uint64_t wr_tsft; uint8_t wr_flags; uint8_t wr_rate; uint16_t wr_chan_freq; @@ -42,7 +43,8 @@ struct urtwn_rx_radiotap_header { } __packed __aligned(8); #define URTWN_RX_RADIOTAP_PRESENT \ - (1 << IEEE80211_RADIOTAP_FLAGS | \ + (1 << IEEE80211_RADIOTAP_TSFT | \ + 1 << IEEE80211_RADIOTAP_FLAGS | \ 1 << IEEE80211_RADIOTAP_RATE | \ 1 << IEEE80211_RADIOTAP_CHANNEL | \ 1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL | \ From owner-svn-src-all@freebsd.org Mon Dec 14 12:37:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50076A42344; Mon, 14 Dec 2015 12:37:07 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB401F3B; Mon, 14 Dec 2015 12:37:07 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBECb6fp079765; Mon, 14 Dec 2015 12:37:06 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBECb67p079764; Mon, 14 Dec 2015 12:37:06 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141237.tBECb67p079764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 12:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292204 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 12:37:07 -0000 Author: brueffer Date: Mon Dec 14 12:37:06 2015 New Revision: 292204 URL: https://svnweb.freebsd.org/changeset/base/292204 Log: Non-exhaustive mdoc/spelling/style cleanup. PR: 202716, 204301 (both spelling) Submitted by: Richard Farr, madpilot Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Mon Dec 14 12:36:10 2015 (r292203) +++ head/share/man/man4/netmap.4 Mon Dec 14 12:37:06 2015 (r292204) @@ -27,16 +27,16 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd December 14, 2015 .Dt NETMAP 4 .Os .Sh NAME .Nm netmap .Nd a framework for fast packet I/O -.br +.Pp .Nm VALE .Nd a fast VirtuAl Local Ethernet using the netmap API -.br +.Pp .Nm netmap pipes .Nd a shared memory packet transport channel .Sh SYNOPSIS @@ -45,8 +45,9 @@ .Nm is a framework for extremely fast and efficient packet I/O for both userspace and kernel clients. -It runs on FreeBSD and Linux, -and includes +It runs on +.Fx +and Linux, and includes .Nm VALE , a very fast and modular in-kernel software switch/dataplane, and @@ -54,7 +55,8 @@ and a shared memory packet transport channel. All these are accessed interchangeably with the same API. .Pp -.Nm , VALE +.Nm , +.Nm VALE and .Nm netmap pipes are at least one order of magnitude faster than @@ -78,13 +80,14 @@ providing high speed packet I/O between virtual machines, NICs and the host stack. .Pp .Nm -suports both non-blocking I/O through -.Xr ioctls() , +supports both non-blocking I/O through +.Xr ioctl 2 , synchronization and blocking I/O through a file descriptor and standard OS mechanisms such as .Xr select 2 , .Xr poll 2 , .Xr epoll 2 , +and .Xr kqueue 2 . .Nm VALE and @@ -131,7 +134,7 @@ All NICs operating in .Nm mode use the same memory region, accessible to all processes who own -.Nm /dev/netmap +.Pa /dev/netmap file descriptors bound to NICs. Independent .Nm VALE @@ -184,7 +187,7 @@ and the number, size and location of all data structures, which can be accessed by mmapping the memory .Dl char *mem = mmap(0, arg.nr_memsize, fd); .Pp -Non blocking I/O is done with special +Non-blocking I/O is done with special .Xr ioctl 2 .Xr select 2 and @@ -210,10 +213,11 @@ and returns the NIC to normal mode (reco to the host stack), or destroys the virtual port. .Sh DATA STRUCTURES The data structures in the mmapped memory region are detailed in -.Xr sys/net/netmap.h , +.In sys/net/netmap.h , which is the ultimate reference for the .Nm -API. The main structures and fields are indicated below: +API. +The main structures and fields are indicated below: .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) .Bd -literal @@ -242,7 +246,9 @@ to be used as temporary storage for pack contains the index of the first of these free rings, which are connected in a list (the first uint32_t of each buffer being the index of the next buffer in the list). -A 0 indicates the end of the list. +A +.Dv 0 +indicates the end of the list. .It Dv struct netmap_ring (one per ring) .Bd -literal struct netmap_ring { @@ -262,8 +268,8 @@ struct netmap_ring { .Ed .Pp Implements transmit and receive rings, with read/write -pointers, metadata and and an array of -.Pa slots +pointers, metadata and an array of +.Em slots describing the buffers. .It Dv struct netmap_slot (one per buffer) .Bd -literal @@ -286,10 +292,11 @@ The offset of the in the mmapped region is indicated by the .Pa nr_offset field in the structure returned by -.Pa NIOCREGIF . +.Dv NIOCREGIF . From there, all other objects are reachable through relative references (offsets or indexes). -Macros and functions in +Macros and functions in +.In net/netmap_user.h help converting them into actual pointers: .Pp .Dl struct netmap_if *nifp = NETMAP_IF(mem, arg.nr_offset); @@ -322,7 +329,9 @@ passes .Va tail is the first slot reserved to the kernel. .Pp -Slot indexes MUST only move forward; +Slot indexes +.Em must +only move forward; for convenience, the function .Dl nm_ring_next(ring, index) returns the next index modulo the ring size. @@ -385,7 +394,10 @@ Below is an example of the evolution of TX [..........aaaaaaaaaaa........] .Ed .Pp -select() and poll() wlll block if there is no space in the ring, i.e. +.Fn select +and +.Fn poll +will block if there is no space in the ring, i.e. .Dl ring->cur == ring->tail and return when new slots have become available. .Pp @@ -448,7 +460,10 @@ One packet is fully contained in a singl The following flags affect slot and buffer processing: .Bl -tag -width XXX .It NS_BUF_CHANGED -it MUST be used when the buf_idx in the slot is changed. +.Em must +be used when the +.Va buf_idx +in the slot is changed. This can be used to implement zero-copy forwarding, see .Sx ZERO-COPY FORWARDING . @@ -457,19 +472,20 @@ reports when this buffer has been transm Normally, .Nm notifies transmit completions in batches, hence signals -can be delayed indefinitely. This flag helps detecting -when packets have been send and a file descriptor can be closed. +can be delayed indefinitely. +This flag helps detect +when packets have been sent and a file descriptor can be closed. .It NS_FORWARD When a ring is in 'transparent' mode (see .Sx TRANSPARENT MODE ) , -packets marked with this flags are forwarded to the other endpoint +packets marked with this flag are forwarded to the other endpoint at the next system call, thus restoring (in a selective way) the connection between a NIC and the host stack. .It NS_NO_LEARN -tells the forwarding code that the SRC MAC address for this +tells the forwarding code that the source MAC address for this packet must not be used in the learning bridge code. .It NS_INDIRECT -indicates that the packet's payload is in a user-supplied buffer, +indicates that the packet's payload is in a user-supplied buffer whose user virtual address is in the 'ptr' field of the slot. The size can reach 65535 bytes. .br @@ -502,7 +518,8 @@ Slots with a value greater than 1 also h .Sh IOCTLS .Nm uses two ioctls (NIOCTXSYNC, NIOCRXSYNC) -for non-blocking I/O. They take no argument. +for non-blocking I/O. +They take no argument. Two more ioctls (NIOCGINFO, NIOCREGIF) are used to query and configure ports, with the following argument: .Bd -literal @@ -514,7 +531,7 @@ struct nmreq { uint32_t nr_tx_slots; /* (i/o) slots in tx rings */ uint32_t nr_rx_slots; /* (i/o) slots in rx rings */ uint16_t nr_tx_rings; /* (i/o) number of tx rings */ - uint16_t nr_rx_rings; /* (i/o) number of tx rings */ + uint16_t nr_rx_rings; /* (i/o) number of rx rings */ uint16_t nr_ringid; /* (i/o) ring(s) we care about */ uint16_t nr_cmd; /* (i) special command */ uint16_t nr_arg1; /* (i/o) extra arguments */ @@ -540,7 +557,8 @@ interface is actually put in netmap mode .It Pa nr_memsize indicates the size of the .Nm -memory region. NICs in +memory region. +NICs in .Nm mode all share the same memory region, whereas @@ -559,7 +577,8 @@ using interface-specific functions (e.g. .It Dv NIOCREGIF binds the port named in .Va nr_name -to the file descriptor. For a physical device this also switches it into +to the file descriptor. +For a physical device this also switches it into .Nm mode, disconnecting it from the host stack. @@ -615,9 +634,11 @@ the slave side of the netmap pipe whose .Pa nr_ringid . .Pp The identifier of a pipe must be thought as part of the pipe name, -and does not need to be sequential. On return the pipe +and does not need to be sequential. +On return the pipe will only have a single ring pair with index 0, -irrespective of the value of i. +irrespective of the value of +.Va i. .El .Pp By default, a @@ -667,13 +688,22 @@ are supported too. .Pp Packets in transmit rings are normally pushed out (and buffers reclaimed) even without -requesting write events. Passing the NETMAP_NO_TX_POLL flag to +requesting write events. +Passing the +.Dv NETMAP_NO_TX_POLL +flag to .Em NIOCREGIF disables this feature. By default, receive rings are processed only if read -events are requested. Passing the NETMAP_DO_RX_POLL flag to +events are requested. +Passing the +.Dv NETMAP_DO_RX_POLL +flag to .Em NIOCREGIF updates receive rings even without read events. -Note that on epoll and kqueue, NETMAP_NO_TX_POLL and NETMAP_DO_RX_POLL +Note that on epoll and kqueue, +.Dv NETMAP_NO_TX_POLL +and +.Dv NETMAP_DO_RX_POLL only have an effect when some event is posted for the file descriptor. .Sh LIBRARIES The @@ -681,12 +711,13 @@ The API is supposed to be used directly, both because of its simplicity and for efficient integration with applications. .Pp -For conveniency, the -.Va +For convenience, the +.In net/netmap_user.h header provides a few macros and functions to ease creating a file descriptor and doing I/O with a .Nm -port. These are loosely modeled after the +port. +These are loosely modeled after the .Xr pcap 3 API, to ease porting of libpcap-based applications to .Nm . @@ -760,7 +791,8 @@ On Linux .Pp NICs without native support can still be used in .Nm -mode through emulation. Performance is inferior to native netmap +mode through emulation. +Performance is inferior to native netmap mode but still significantly higher than sockets, and approaching that of in-kernel solutions such as Linux's .Xr pktgen . @@ -806,7 +838,8 @@ Verbose kernel messages .It Va dev.netmap.if_num: 100 .It Va dev.netmap.if_size: 1024 Sizes and number of objects (netmap_if, netmap_ring, buffers) -for the global memory region. The only parameter worth modifying is +for the global memory region. +The only parameter worth modifying is .Va dev.netmap.buf_num as it impacts the total amount of memory used by netmap. .It Va dev.netmap.buf_curr_num: 0 @@ -819,7 +852,8 @@ Actual values in use. .It Va dev.netmap.bridge_batch: 1024 Batch size used when moving packets across a .Nm VALE -switch. Values above 64 generally guarantee good +switch. +Values above 64 generally guarantee good performance. .El .Sh SYSTEM CALLS @@ -850,12 +884,14 @@ may be of use. comes with a few programs that can be used for testing or simple applications. See the -.Va examples/ +.Pa examples/ directory in .Nm distributions, or -.Va tools/tools/netmap/ -directory in FreeBSD distributions. +.Pa tools/tools/netmap/ +directory in +.Fx +distributions. .Pp .Xr pkt-gen is a general purpose traffic source/sink. @@ -875,7 +911,8 @@ rates, and use multiple send/receive thr .Xr bridge is another test program which interconnects two .Nm -ports. It can be used for transparent forwarding between +ports. +It can be used for transparent forwarding between interfaces, as in .Dl bridge -i ix0 -i ix1 or even connect the NIC to the host stack using netmap @@ -942,7 +979,8 @@ void receiver(void) .Ss ZERO-COPY FORWARDING Since physical interfaces share the same memory region, it is possible to do packet forwarding between ports -swapping buffers. The buffer from the transmit ring is used +swapping buffers. +The buffer from the transmit ring is used to replenish the receive ring: .Bd -literal -compact uint32_t tmp; @@ -1014,6 +1052,7 @@ and further extended with help from .An Matteo Landi , .An Gaetano Catalli , .An Giuseppe Lettieri , +and .An Vincenzo Maffione . .Pp .Nm @@ -1026,7 +1065,8 @@ No matter how fast the CPU and OS are, achieving line rate on 10G and faster interfaces requires hardware with sufficient performance. Several NICs are unable to sustain line rate with -small packet sizes. Insufficient PCIe or memory bandwidth +small packet sizes. +Insufficient PCIe or memory bandwidth can also cause reduced performance. .Pp Another frequent reason for low performance is the use @@ -1034,7 +1074,6 @@ of flow control on the link: a slow rece the transmit speed. Be sure to disable flow control when running high speed experiments. -.Pp .Ss SPECIAL NIC FEATURES .Nm is orthogonal to some NIC features such as @@ -1054,6 +1093,6 @@ and filtering of incoming traffic. features such as .Em checksum offloading , TCP segmentation offloading , .Em encryption , VLAN encapsulation/decapsulation , -etc. . +etc. When using netmap to exchange packets with the host stack, make sure to disable these features. From owner-svn-src-all@freebsd.org Mon Dec 14 13:01:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2DD3A43AB7; Mon, 14 Dec 2015 13:01:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92252114A; Mon, 14 Dec 2015 13:01:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBED1aB7087636; Mon, 14 Dec 2015 13:01:36 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBED1aQ9087631; Mon, 14 Dec 2015 13:01:36 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141301.tBED1aQ9087631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 13:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292205 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 13:01:38 -0000 Author: brueffer Date: Mon Dec 14 13:01:36 2015 New Revision: 292205 URL: https://svnweb.freebsd.org/changeset/base/292205 Log: Clean up issues reported by mandoc -Tlint Modified: head/share/man/man4/blackhole.4 head/share/man/man4/ioat.4 head/share/man/man4/mlx5en.4 head/share/man/man4/pass.4 Modified: head/share/man/man4/blackhole.4 ============================================================================== --- head/share/man/man4/blackhole.4 Mon Dec 14 12:37:06 2015 (r292204) +++ head/share/man/man4/blackhole.4 Mon Dec 14 13:01:36 2015 (r292205) @@ -87,8 +87,8 @@ MIBs first appeared in .Fx 4.0 . .Pp -The SCTP -.Nm +The SCTP +.Nm MIB first appeared in .Fx 9.1 . .Sh AUTHORS Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Mon Dec 14 12:37:06 2015 (r292204) +++ head/share/man/man4/ioat.4 Mon Dec 14 13:01:36 2015 (r292205) @@ -188,7 +188,7 @@ unload. For an example of usage, see .Pa src/sys/dev/ioat/ioat_test.c . .Sh FILES -.Bl -tag -compat +.Bl -tag .It Pa /dev/ioat_test test device for .Xr ioatcontrol 8 Modified: head/share/man/man4/mlx5en.4 ============================================================================== --- head/share/man/man4/mlx5en.4 Mon Dec 14 12:37:06 2015 (r292204) +++ head/share/man/man4/mlx5en.4 Mon Dec 14 13:01:36 2015 (r292205) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd December 3, 2015 -.Dt mlx5en 4 +.Dt MLX5EN 4 .Os .Sh NAME .Nm mlx5en Modified: head/share/man/man4/pass.4 ============================================================================== --- head/share/man/man4/pass.4 Mon Dec 14 12:37:06 2015 (r292204) +++ head/share/man/man4/pass.4 Mon Dec 14 13:01:36 2015 (r292205) @@ -102,7 +102,7 @@ Queue a CCB to the driver to be executed asynchronously. The caller may use .Xr select 2 , -.Xr poll 2 +.Xr poll 2 or .Xr kevent 2 to receive notification when the CCB has completed. @@ -120,11 +120,11 @@ Although the .Dv CAMIOQUEUE ioctl is not defined to take an argument, it does require a pointer to a union ccb. -It is not defined to take an argument to avoid an extra malloc and copy -inside the generic +It is not defined to take an argument to avoid an extra malloc and copy +inside the generic .Xr ioctl 2 handler. -.pp +.Pp The completed CCB will be returned via the .Dv CAMIOGET ioctl. @@ -171,7 +171,7 @@ ioctl if the driver fails to copy data to the user process or if there are no completed CCBs available to retrieve. If no CCBs are available to retrieve, -errno will be set to +errno will be set to .Dv ENOENT . .Pp All other errors will be reported as standard CAM CCB status errors. @@ -180,14 +180,14 @@ Although the .Dv CAMIOGET ioctl is not defined to take an argument, it does require a pointer to a union ccb. -It is not defined to take an argument to avoid an extra malloc and copy -inside the generic +It is not defined to take an argument to avoid an extra malloc and copy +inside the generic .Xr ioctl 2 handler. .Pp The pass driver will report via .Xr select 2 , -.Xr poll 2 +.Xr poll 2 or .Xr kevent 2 when a CCB has completed. From owner-svn-src-all@freebsd.org Mon Dec 14 13:01:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C4CCA43B11; Mon, 14 Dec 2015 13:01:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08CFA1304; Mon, 14 Dec 2015 13:01:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBED1rix088007; Mon, 14 Dec 2015 13:01:53 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBED1pnR087993; Mon, 14 Dec 2015 13:01:51 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512141301.tBED1pnR087993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 14 Dec 2015 13:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292206 - in head/contrib/unbound: . compat daemon dns64 dnstap doc iterator libunbound libunbound/python libunbound/python/doc libunbound/python/doc/modules libunbound/python/examples ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 13:01:54 -0000 Author: des Date: Mon Dec 14 13:01:51 2015 New Revision: 292206 URL: https://svnweb.freebsd.org/changeset/base/292206 Log: Upgrade to Unbound 1.5.7. Added: head/contrib/unbound/.gitignore - copied unchanged from r292133, vendor/unbound/dist/.gitignore head/contrib/unbound/compat/isblank.c - copied unchanged from r292133, vendor/unbound/dist/compat/isblank.c Modified: head/contrib/unbound/Makefile.in head/contrib/unbound/acx_nlnetlabs.m4 head/contrib/unbound/compat/arc4random.c head/contrib/unbound/compat/getentropy_linux.c head/contrib/unbound/compat/getentropy_solaris.c head/contrib/unbound/compat/reallocarray.c head/contrib/unbound/compat/sha512.c head/contrib/unbound/compat/snprintf.c head/contrib/unbound/config.h head/contrib/unbound/config.h.in head/contrib/unbound/configure head/contrib/unbound/configure.ac head/contrib/unbound/daemon/remote.c head/contrib/unbound/daemon/unbound.c head/contrib/unbound/daemon/worker.c head/contrib/unbound/dns64/dns64.c head/contrib/unbound/dnstap/dnstap.proto head/contrib/unbound/doc/Changelog head/contrib/unbound/doc/README head/contrib/unbound/doc/example.conf head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/libunbound.3 head/contrib/unbound/doc/libunbound.3.in head/contrib/unbound/doc/unbound-anchor.8 head/contrib/unbound/doc/unbound-anchor.8.in head/contrib/unbound/doc/unbound-checkconf.8 head/contrib/unbound/doc/unbound-checkconf.8.in head/contrib/unbound/doc/unbound-control.8 head/contrib/unbound/doc/unbound-control.8.in head/contrib/unbound/doc/unbound-host.1 head/contrib/unbound/doc/unbound-host.1.in head/contrib/unbound/doc/unbound.8 head/contrib/unbound/doc/unbound.8.in head/contrib/unbound/doc/unbound.conf.5 head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/iterator/iter_scrub.c head/contrib/unbound/iterator/iter_utils.c head/contrib/unbound/iterator/iterator.c head/contrib/unbound/iterator/iterator.h head/contrib/unbound/libunbound/libunbound.c head/contrib/unbound/libunbound/python/Makefile head/contrib/unbound/libunbound/python/doc/install.rst head/contrib/unbound/libunbound/python/doc/modules/unbound.rst head/contrib/unbound/libunbound/python/examples/dnssec-valid.py head/contrib/unbound/libunbound/python/libunbound.i head/contrib/unbound/ltmain.sh head/contrib/unbound/services/cache/dns.c head/contrib/unbound/services/cache/rrset.c head/contrib/unbound/sldns/parseutil.h head/contrib/unbound/sldns/wire2str.c head/contrib/unbound/smallapp/unbound-anchor.c head/contrib/unbound/smallapp/unbound-checkconf.c head/contrib/unbound/smallapp/unbound-control-setup.sh head/contrib/unbound/smallapp/unbound-control-setup.sh.in head/contrib/unbound/smallapp/unbound-control.c head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.y head/contrib/unbound/util/iana_ports.inc head/contrib/unbound/util/locks.c head/contrib/unbound/util/net_help.c head/contrib/unbound/util/random.c head/contrib/unbound/util/rbtree.c head/contrib/unbound/util/rtt.h head/contrib/unbound/util/storage/lookup3.c head/contrib/unbound/util/tube.h head/contrib/unbound/util/winsock_event.h head/contrib/unbound/validator/autotrust.c head/contrib/unbound/validator/val_neg.c head/contrib/unbound/validator/val_neg.h head/contrib/unbound/validator/val_nsec.c head/contrib/unbound/validator/val_nsec.h head/contrib/unbound/validator/val_nsec3.c head/contrib/unbound/validator/val_nsec3.h head/contrib/unbound/validator/val_secalgo.c head/contrib/unbound/validator/val_secalgo.h head/contrib/unbound/validator/val_sigcrypt.c head/contrib/unbound/validator/val_utils.h head/contrib/unbound/validator/validator.c Directory Properties: head/contrib/unbound/ (props changed) Copied: head/contrib/unbound/.gitignore (from r292133, vendor/unbound/dist/.gitignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/unbound/.gitignore Mon Dec 14 13:01:51 2015 (r292206, copy of r292133, vendor/unbound/dist/.gitignore) @@ -0,0 +1,38 @@ +*.lo +*.o +/.libs/ +/Makefile +/autom4te.cache/ +/config.h +/config.log +/config.status +/dnstap/dnstap_config.h +/doc/example.conf +/doc/libunbound.3 +/doc/unbound-anchor.8 +/doc/unbound-checkconf.8 +/doc/unbound-control.8 +/doc/unbound-host.1 +/doc/unbound.8 +/doc/unbound.conf.5 +/libtool +/libunbound.la +/smallapp/unbound-control-setup.sh +/unbound +/unbound-anchor +/unbound-checkconf +/unbound-control +/unbound-control-setup +/unbound-host +/unbound.h +/asynclook +/delayer +/lock-verify +/memstats +/perf +/petal +/pktview +/streamtcp +/testbound +/unittest + Modified: head/contrib/unbound/Makefile.in ============================================================================== --- head/contrib/unbound/Makefile.in Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/Makefile.in Mon Dec 14 13:01:51 2015 (r292206) @@ -38,6 +38,7 @@ UNBOUND_VERSION_MINOR=@UNBOUND_VERSION_M UNBOUND_VERSION_MICRO=@UNBOUND_VERSION_MICRO@ ALLTARGET=@ALLTARGET@ INSTALLTARGET=@INSTALLTARGET@ +SSLLIB=@SSLLIB@ # _unbound.la if pyunbound enabled. PYUNBOUND_TARGET=@PYUNBOUND_TARGET@ @@ -132,7 +133,7 @@ compat/memcmp.c compat/memmove.c compat/ compat/strlcpy.c compat/strptime.c compat/getentropy_linux.c \ compat/getentropy_osx.c compat/getentropy_solaris.c compat/getentropy_win.c \ compat/explicit_bzero.c compat/arc4random.c compat/arc4random_uniform.c \ -compat/arc4_lock.c compat/sha512.c compat/reallocarray.c +compat/arc4_lock.c compat/sha512.c compat/reallocarray.c compat/isblank.c COMPAT_OBJ=$(LIBOBJS:.o=.lo) COMPAT_OBJ_WITHOUT_CTIME=$(LIBOBJ_WITHOUT_CTIME:.o=.lo) COMPAT_OBJ_WITHOUT_CTIMEARC4=$(LIBOBJ_WITHOUT_CTIMEARC4:.o=.lo) @@ -295,22 +296,22 @@ longtest: tests lib: libunbound.la unbound.h libunbound.la: $(LIBUNBOUND_OBJ_LINK) - $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) -lssl $(LIBS) + $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) $(SSLLIB) $(LIBS) unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS) + $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS) + $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS) + $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unbound-anchor$(EXEEXT): $(UBANCHOR_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(UBANCHOR_OBJ_LINK) -L. -L.libs -lunbound -lexpat -lssl $(LIBS) + $(LINK) -o $@ $(UBANCHOR_OBJ_LINK) -L. -L.libs -lunbound -lexpat $(SSLLIB) $(LIBS) unbound-service-install$(EXEEXT): $(SVCINST_OBJ_LINK) $(LINK) -o $@ $(SVCINST_OBJ_LINK) $(LIBS) @@ -322,37 +323,37 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ $(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unittest$(EXEEXT): $(UNITTEST_OBJ_LINK) - $(LINK) -o $@ $(UNITTEST_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK) - $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK) - $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) petal$(EXEEXT): $(PETAL_OBJ_LINK) - $(LINK) -o $@ $(PETAL_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS) pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK) - $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK) - $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) $(LIBS) -L. -L.libs -lunbound streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) - $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) perf$(EXEEXT): $(PERF_OBJ_LINK) - $(LINK) -o $@ $(PERF_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) delayer$(EXEEXT): $(DELAYER_OBJ_LINK) - $(LINK) -o $@ $(DELAYER_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) signit$(EXEEXT): testcode/signit.c - $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns -lssl $(LIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS) unbound.h: $(srcdir)/libunbound/unbound.h sed -e 's/@''UNBOUND_VERSION_MAJOR@/$(UNBOUND_VERSION_MAJOR)/' -e 's/@''UNBOUND_VERSION_MINOR@/$(UNBOUND_VERSION_MINOR)/' -e 's/@''UNBOUND_VERSION_MICRO@/$(UNBOUND_VERSION_MICRO)/' < $(srcdir)/libunbound/unbound.h > $@ @@ -644,7 +645,7 @@ iterator.lo iterator.o: $(srcdir)/iterat $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \ $(srcdir)/util/log.h $(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h \ @@ -727,8 +728,7 @@ outside_network.lo outside_network.o: $( $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h \ - + $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -776,14 +776,12 @@ netevent.lo netevent.o: $(srcdir)/util/n $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/wire2str.h random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ @@ -818,8 +816,7 @@ autotrust.lo autotrust.o: $(srcdir)/vali $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/services/modstack.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \ @@ -844,18 +841,16 @@ val_kcache.lo val_kcache.o: $(srcdir)/va val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ - $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ - $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h -val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/validator.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h +val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h \ @@ -867,17 +862,15 @@ val_nsec.lo val_nsec.o: $(srcdir)/valida $(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h \ - + $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/sbuffer.h val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -895,11 +888,6 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64. $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/testcode/checklocks.h -dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/dnstap/dnstap.pb-c.h -dnstap.pb-c.lo dnstap.pb-c.o: $(srcdir)/dnstap/dnstap.pb-c.c $(srcdir)/dnstap/dnstap.pb-c.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -908,8 +896,7 @@ unitdname.lo unitdname.o: $(srcdir)/test $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ @@ -947,38 +934,35 @@ unitldns.lo unitldns.o: $(srcdir)/testco acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h \ +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ + $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h \ $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1002,35 +986,33 @@ stats.lo stats.o: $(srcdir)/daemon/stats $(srcdir)/util/rtt.h $(srcdir)/validator/val_kcache.h unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h \ - $(srcdir)/util/rbtree.h + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/libworker.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ + $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1046,12 +1028,12 @@ worker.lo worker.o: $(srcdir)/daemon/wor $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \ @@ -1059,14 +1041,13 @@ worker.lo worker.o: $(srcdir)/daemon/wor acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h \ @@ -1141,19 +1122,18 @@ libunbound.lo libunbound.o: $(srcdir)/li $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/services/localzone.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/sldns/sbuffer.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/netevent.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h +libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h \ + $(srcdir)/util/random.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ @@ -1164,21 +1144,18 @@ streamtcp.lo streamtcp.o: $(srcdir)/test $(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h perf.lo perf.o: $(srcdir)/testcode/perf.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h -unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \ - $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h +unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h $(srcdir)/util/log.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ - -petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \ - + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h +petal.lo petal.o: $(srcdir)/testcode/petal.c config.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ @@ -1191,8 +1168,7 @@ win_svc.lo win_svc.o: $(srcdir)/winrc/wi $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \ $(srcdir)/winrc/w_inst.h @@ -1200,14 +1176,11 @@ unbound-service-remove.lo unbound-servic $(srcdir)/winrc/w_inst.h anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h -keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/rrdef.h \ - +keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/rrdef.h sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/sldns/keyraw.h parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/sldns/sbuffer.h parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h @@ -1227,8 +1200,7 @@ snprintf.lo snprintf.o: $(srcdir)/compat strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h -getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \ - +getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c config.h getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c @@ -1238,3 +1210,4 @@ arc4random_uniform.lo arc4random_uniform arc4_lock.lo arc4_lock.o: $(srcdir)/compat/arc4_lock.c config.h $(srcdir)/util/locks.h sha512.lo sha512.o: $(srcdir)/compat/sha512.c config.h reallocarray.lo reallocarray.o: $(srcdir)/compat/reallocarray.c config.h +isblank.lo isblank.o: $(srcdir)/compat/isblank.c config.h Modified: head/contrib/unbound/acx_nlnetlabs.m4 ============================================================================== --- head/contrib/unbound/acx_nlnetlabs.m4 Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/acx_nlnetlabs.m4 Mon Dec 14 13:01:51 2015 (r292206) @@ -2,7 +2,9 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 28 +# Version 30 +# 2015-11-18 spelling check fix. +# 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly. # 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added. # 2015-03-17 AHX_CONFIG_REALLOCARRAY added # 2013-09-19 FLTO help text improved. @@ -24,7 +26,7 @@ # 2010-07-02 Add check for ss_family (for minix). # 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS. # 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end. -# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl +# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl # 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN # 2010-01-20 added AHX_COONFIG_STRLCAT # 2009-07-14 U_CHAR detection improved for windows crosscompile. @@ -715,12 +717,6 @@ AC_DEFUN([ACX_SSL_CHECKS], [ fi AC_SUBST(HAVE_SSL) AC_SUBST(RUNTIME_PATH) - # openssl engine functionality needs dlopen(). - BAKLIBS="$LIBS" - AC_SEARCH_LIBS([dlopen], [dl]) - if test "$LIBS" != "$BAKLIBS"; then - LIBSSL_LIBS="$LIBSSL_LIBS -ldl" - fi fi AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT]) Modified: head/contrib/unbound/compat/arc4random.c ============================================================================== --- head/contrib/unbound/compat/arc4random.c Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/compat/arc4random.c Mon Dec 14 13:01:51 2015 (r292206) @@ -26,7 +26,9 @@ #include #include #include +#ifdef HAVE_STDINT_H #include +#endif #include #include #include Modified: head/contrib/unbound/compat/getentropy_linux.c ============================================================================== --- head/contrib/unbound/compat/getentropy_linux.c Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/compat/getentropy_linux.c Mon Dec 14 13:01:51 2015 (r292206) @@ -46,7 +46,12 @@ #include #include #include + +#if defined(HAVE_SSL) #include +#elif defined(HAVE_NETTLE) +#include +#endif #include #include @@ -67,9 +72,21 @@ HD(b); \ } while (0) +#if defined(HAVE_SSL) +#define CRYPTO_SHA512_CTX SHA512_CTX +#define CRYPTO_SHA512_INIT(x) SHA512_Init(x) +#define CRYPTO_SHA512_FINAL(r, c) SHA512_Final(r, c) #define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l))) #define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x))) #define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*))) +#elif defined(HAVE_NETTLE) +#define CRYPTO_SHA512_CTX struct sha512_ctx +#define CRYPTO_SHA512_INIT(x) sha512_init(x) +#define CRYPTO_SHA512_FINAL(r, c) sha512_digest(c, SHA512_DIGEST_SIZE, r) +#define HR(x, l) (sha512_update(&ctx, (l), (uint8_t *)(x))) +#define HD(x) (sha512_update(&ctx, sizeof (x), (uint8_t *)&(x))) +#define HF(x) (sha512_update(&ctx, sizeof (void*), (uint8_t *)&(x))) +#endif int getentropy(void *buf, size_t len); @@ -122,7 +139,7 @@ getentropy(void *buf, size_t len) * Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID. * sysctl is a failsafe API, so it guarantees a result. This * should work inside a chroot, or when file descriptors are - * exhuasted. + * exhausted. * * However this can fail if the Linux kernel removes support * for sysctl. Starting in 2007, there have been efforts to @@ -337,7 +354,7 @@ getentropy_fallback(void *buf, size_t le struct rusage ru; sigset_t sigset; struct stat st; - SHA512_CTX ctx; + CRYPTO_SHA512_CTX ctx; static pid_t lastpid; pid_t pid; size_t i, ii, m; @@ -354,7 +371,7 @@ getentropy_fallback(void *buf, size_t le } for (i = 0; i < len; ) { int j; - SHA512_Init(&ctx); + CRYPTO_SHA512_INIT(&ctx); for (j = 0; j < repeat; j++) { HX((e = gettimeofday(&tv, NULL)) == -1, tv); if (e != -1) { @@ -526,7 +543,7 @@ getentropy_fallback(void *buf, size_t le # endif #endif /* HAVE_GETAUXVAL */ - SHA512_Final(results, &ctx); + CRYPTO_SHA512_FINAL(results, &ctx); memcpy((char*)buf + i, results, min(sizeof(results), len - i)); i += min(sizeof(results), len - i); } Modified: head/contrib/unbound/compat/getentropy_solaris.c ============================================================================== --- head/contrib/unbound/compat/getentropy_solaris.c Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/compat/getentropy_solaris.c Mon Dec 14 13:01:51 2015 (r292206) @@ -30,7 +30,9 @@ #include #include #include +#ifdef HAVE_STDINT_H #include +#endif #include #include #include @@ -39,10 +41,14 @@ #include #include #include +#ifdef HAVE_SYS_SHA2_H #include #define SHA512_Init SHA512Init #define SHA512_Update SHA512Update #define SHA512_Final SHA512Final +#else +#include "openssl/sha.h" +#endif #include #include Copied: head/contrib/unbound/compat/isblank.c (from r292133, vendor/unbound/dist/compat/isblank.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/unbound/compat/isblank.c Mon Dec 14 13:01:51 2015 (r292206, copy of r292133, vendor/unbound/dist/compat/isblank.c) @@ -0,0 +1,45 @@ +/* isblank - compatibility implementation of isblank + * + * Copyright (c) 2015, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * 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. + */ + +#include "config.h" + +/* return true for a blank character: space or tab */ +int isblank(int c); + +/* implementation of isblank. unsigned char is the argument */ +int +isblank(int c) +{ + return (c==' ' || c=='\t'); +} Modified: head/contrib/unbound/compat/reallocarray.c ============================================================================== --- head/contrib/unbound/compat/reallocarray.c Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/compat/reallocarray.c Mon Dec 14 13:01:51 2015 (r292206) @@ -18,7 +18,10 @@ #include "config.h" #include #include +#ifdef HAVE_STDINT_H #include +#endif +#include #include /* Modified: head/contrib/unbound/compat/sha512.c ============================================================================== --- head/contrib/unbound/compat/sha512.c Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/compat/sha512.c Mon Dec 14 13:01:51 2015 (r292206) @@ -70,7 +70,7 @@ unsigned char *SHA512(void *data, unsign * Please make sure that your system defines BYTE_ORDER. If your * architecture is little-endian, make sure it also defines * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are - * equivilent. + * equivalent. * * If your system does not define the above, then you can do so by * hand like this: Modified: head/contrib/unbound/compat/snprintf.c ============================================================================== --- head/contrib/unbound/compat/snprintf.c Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/compat/snprintf.c Mon Dec 14 13:01:51 2015 (r292206) @@ -42,6 +42,7 @@ #ifdef HAVE_STDINT_H #include #endif +#include /* for test */ /* #define SNPRINTF_TEST 1 */ @@ -428,7 +429,7 @@ print_num_llp(char** at, size_t* left, i char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); -#if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX) +#if defined(SIZE_MAX) && defined(UINT32_MAX) && (UINT32_MAX == SIZE_MAX || INT32_MAX == SIZE_MAX) /* avoid warning about upcast on 32bit systems */ unsigned long long llvalue = (unsigned long)value; #else Modified: head/contrib/unbound/config.h ============================================================================== --- head/contrib/unbound/config.h Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/config.h Mon Dec 14 13:01:51 2015 (r292206) @@ -85,7 +85,7 @@ /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to 0 if you don't. */ -#define HAVE_DECL_SSL_CTX_SET_ECDH_AUTO 0 +#define HAVE_DECL_SSL_CTX_SET_ECDH_AUTO 1 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you don't. */ @@ -95,6 +95,10 @@ don't. */ /* #undef HAVE_DECL_STRLCPY */ +/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if + you don't. */ +#define HAVE_DECL_XML_STOPPARSER 1 + /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 @@ -152,6 +156,9 @@ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #define HAVE_FSEEKO 1 +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + /* Whether getaddrinfo is available */ #define HAVE_GETADDRINFO 1 @@ -206,6 +213,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_IPHLPAPI_H */ +/* Define to 1 if you have the `isblank' function. */ +#define HAVE_ISBLANK 1 + /* Define to 1 if you have the `kill' function. */ #define HAVE_KILL 1 @@ -233,6 +243,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 +/* Use libnettle for crypto */ +/* #undef HAVE_NETTLE */ + /* Use libnss for crypto */ /* #undef HAVE_NSS */ @@ -497,7 +510,7 @@ #define PACKAGE_NAME "unbound" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "unbound 1.5.5" +#define PACKAGE_STRING "unbound 1.5.7" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "unbound" @@ -506,7 +519,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.5.5" +#define PACKAGE_VERSION "1.5.7" /* default pidfile location */ #define PIDFILE "/var/unbound/unbound.pid" @@ -525,7 +538,7 @@ #define ROOT_CERT_FILE "/var/unbound/icannbundle.pem" /* version number for resource files */ -#define RSRC_PACKAGE_VERSION 1,5,5,0 +#define RSRC_PACKAGE_VERSION 1,5,7,0 /* Directory to chdir to */ #define RUN_DIR "/var/unbound" @@ -536,6 +549,9 @@ /* The size of `time_t', as computed by sizeof. */ #define SIZEOF_TIME_T 8 +/* define if (v)snprintf does not return length needed, (but length used) */ +/* #undef SNPRINTF_RET_BROKEN */ + /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -570,7 +586,7 @@ /* #undef USE_ECDSA_EVP_WORKAROUND */ /* Define this to enable GOST support. */ -/* #undef USE_GOST */ +#define USE_GOST 1 /* Define if you want to use internal select based events */ #define USE_MINI_EVENT 1 @@ -849,15 +865,13 @@ #define MAXHOSTNAMELEN 256 #endif - -#ifndef HAVE_SNPRINTF +#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN) #define snprintf snprintf_unbound #define vsnprintf vsnprintf_unbound #include int snprintf (char *str, size_t count, const char *fmt, ...); int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); -#endif /* HAVE_SNPRINTF */ - +#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */ #ifndef HAVE_INET_PTON #define inet_pton inet_pton_unbound @@ -953,6 +967,11 @@ int memcmp(const void *x, const void *y, char *ctime_r(const time_t *timep, char *buf); #endif +#ifndef HAVE_ISBLANK +#define isblank unbound_isblank +int isblank(int c); +#endif + #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS) #define strptime unbound_strptime struct tm; Modified: head/contrib/unbound/config.h.in ============================================================================== --- head/contrib/unbound/config.h.in Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/config.h.in Mon Dec 14 13:01:51 2015 (r292206) @@ -94,6 +94,10 @@ don't. */ #undef HAVE_DECL_STRLCPY +/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if + you don't. */ +#undef HAVE_DECL_XML_STOPPARSER + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -151,6 +155,9 @@ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if you have the `fsync' function. */ +#undef HAVE_FSYNC + /* Whether getaddrinfo is available */ #undef HAVE_GETADDRINFO @@ -205,6 +212,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IPHLPAPI_H +/* Define to 1 if you have the `isblank' function. */ +#undef HAVE_ISBLANK + /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -232,6 +242,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Use libnettle for crypto */ +#undef HAVE_NETTLE + /* Use libnss for crypto */ #undef HAVE_NSS @@ -535,6 +548,9 @@ /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T +/* define if (v)snprintf does not return length needed, (but length used) */ +#undef SNPRINTF_RET_BROKEN + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -848,15 +864,13 @@ #define MAXHOSTNAMELEN 256 #endif - -#ifndef HAVE_SNPRINTF +#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN) #define snprintf snprintf_unbound #define vsnprintf vsnprintf_unbound #include int snprintf (char *str, size_t count, const char *fmt, ...); int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); -#endif /* HAVE_SNPRINTF */ - +#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */ #ifndef HAVE_INET_PTON #define inet_pton inet_pton_unbound @@ -952,6 +966,11 @@ int memcmp(const void *x, const void *y, char *ctime_r(const time_t *timep, char *buf); #endif +#ifndef HAVE_ISBLANK +#define isblank unbound_isblank +int isblank(int c); +#endif + #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS) #define strptime unbound_strptime struct tm; Modified: head/contrib/unbound/configure ============================================================================== --- head/contrib/unbound/configure Mon Dec 14 13:01:36 2015 (r292205) +++ head/contrib/unbound/configure Mon Dec 14 13:01:51 2015 (r292206) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for unbound 1.5.5. +# Generated by GNU Autoconf 2.69 for unbound 1.5.7. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.5.5' -PACKAGE_STRING='unbound 1.5.5' +PACKAGE_VERSION='1.5.7' +PACKAGE_STRING='unbound 1.5.7' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl' PACKAGE_URL='' @@ -661,6 +661,7 @@ CHECKLOCK_OBJ staticexe UNBOUND_EVENT_UNINSTALL UNBOUND_EVENT_INSTALL +SSLLIB HAVE_SSL CONFIG_DATE NETBSD_LINTFLAGS @@ -823,6 +824,7 @@ with_solaris_threads with_pyunbound with_pythonmodule with_nss +with_nettle with_ssl enable_sha2 enable_gost @@ -1391,7 +1393,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 14 13:05:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBF63A43DF8; Mon, 14 Dec 2015 13:05:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CF0C1822; Mon, 14 Dec 2015 13:05:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBED5GXJ088462; Mon, 14 Dec 2015 13:05:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBED5Ggg088461; Mon, 14 Dec 2015 13:05:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512141305.tBED5Ggg088461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 14 Dec 2015 13:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292207 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 13:05:17 -0000 Author: avos Date: Mon Dec 14 13:05:16 2015 New Revision: 292207 URL: https://svnweb.freebsd.org/changeset/base/292207 Log: urtwn: fix frame processing in the Rx path. Currently, in case when npkts >= 2, RSSI and Rx radiotap fields will be overridden by the next packet. As a result, every packet from this chain will use the same RSSI / radiotap data. After this change, RSSI and radiotap structure will be filled for every frame right before ieee80211_input() call. Tested with RTL8188EU / RTL8188CUS, STA and MONITOR modes. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4487 Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Dec 14 13:01:51 2015 (r292206) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Dec 14 13:05:16 2015 (r292207) @@ -182,14 +182,15 @@ static struct ieee80211vap *urtwn_vap_cr const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void urtwn_vap_delete(struct ieee80211vap *); -static struct mbuf * urtwn_rx_frame(struct urtwn_softc *, uint8_t *, int, - int *); -static struct mbuf * urtwn_report_intr(struct usb_xfer *, struct urtwn_data *, - int *, int8_t *); -static struct mbuf * urtwn_rxeof(struct urtwn_softc *, uint8_t *, int, - int *, int8_t *); +static struct mbuf * urtwn_rx_copy_to_mbuf(struct urtwn_softc *, + struct r92c_rx_stat *, int); +static struct mbuf * urtwn_report_intr(struct usb_xfer *, + struct urtwn_data *); +static struct mbuf * urtwn_rxeof(struct urtwn_softc *, uint8_t *, int); static void urtwn_r88e_ratectl_tx_complete(struct urtwn_softc *, void *); +static struct ieee80211_node *urtwn_rx_frame(struct urtwn_softc *, + struct mbuf *, int8_t *); static void urtwn_txeof(struct urtwn_softc *, struct urtwn_data *, int); static int urtwn_alloc_list(struct urtwn_softc *, @@ -715,16 +716,13 @@ urtwn_vap_delete(struct ieee80211vap *va } static struct mbuf * -urtwn_rx_frame(struct urtwn_softc *sc, uint8_t *buf, int pktlen, int *rssi_p) +urtwn_rx_copy_to_mbuf(struct urtwn_softc *sc, struct r92c_rx_stat *stat, + int totlen) { struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; struct mbuf *m; - struct r92c_rx_stat *stat; - uint32_t rxdw0, rxdw3; - uint8_t rate, cipher; - int8_t rssi = 0; - int infosz; + uint32_t rxdw0; + int pktlen; /* * don't pass packets to the ieee80211 framework if the driver isn't @@ -733,87 +731,49 @@ urtwn_rx_frame(struct urtwn_softc *sc, u if (!(sc->sc_flags & URTWN_RUNNING)) return (NULL); - stat = (struct r92c_rx_stat *)buf; rxdw0 = le32toh(stat->rxdw0); - rxdw3 = le32toh(stat->rxdw3); - if (rxdw0 & (R92C_RXDW0_CRCERR | R92C_RXDW0_ICVERR)) { /* * This should not happen since we setup our Rx filter * to not receive these frames. */ - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } - if (pktlen < sizeof(struct ieee80211_frame_ack) || - pktlen > MCLBYTES) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); + DPRINTFN(6, "RX flags error (%s)\n", + rxdw0 & R92C_RXDW0_CRCERR ? "CRC" : "ICV"); + goto fail; } - rate = MS(rxdw3, R92C_RXDW3_RATE); - cipher = MS(rxdw0, R92C_RXDW0_CIPHER); - infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8; + pktlen = MS(rxdw0, R92C_RXDW0_PKTLEN); + if (pktlen < sizeof(struct ieee80211_frame_ack)) { + DPRINTFN(6, "frame too short: %d\n", pktlen); + goto fail; + } - /* Get RSSI from PHY status descriptor if present. */ - if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { - if (sc->chip & URTWN_CHIP_88E) - rssi = urtwn_r88e_get_rssi(sc, rate, &stat[1]); - else - rssi = urtwn_get_rssi(sc, rate, &stat[1]); - /* Update our average RSSI. */ - urtwn_update_avgrssi(sc, rate, rssi); + if (__predict_false(totlen > MCLBYTES)) { + /* convert to m_getjcl if this happens */ + device_printf(sc->sc_dev, "%s: frame too long: %d (%d)\n", + __func__, pktlen, totlen); + goto fail; } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) { - device_printf(sc->sc_dev, "could not create RX mbuf\n"); - return (NULL); + if (__predict_false(m == NULL)) { + device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", + __func__); + goto fail; } /* Finalize mbuf. */ - memcpy(mtod(m, uint8_t *), (uint8_t *)&stat[1] + infosz, pktlen); - m->m_pkthdr.len = m->m_len = pktlen; - wh = mtod(m, struct ieee80211_frame *); - - if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && - cipher != R92C_CAM_ALGO_NONE) { - m->m_flags |= M_WEP; - } - - if (ieee80211_radiotap_active(ic)) { - struct urtwn_rx_radiotap_header *tap = &sc->sc_rxtap; - - tap->wr_flags = 0; - - urtwn_get_tsf(sc, &tap->wr_tsft); - if (__predict_false(le32toh((uint32_t)tap->wr_tsft) < - le32toh(stat->rxdw5))) { - tap->wr_tsft = le32toh(tap->wr_tsft >> 32) - 1; - tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32; - } else - tap->wr_tsft &= 0xffffffff00000000; - tap->wr_tsft += stat->rxdw5; - - /* Map HW rate index to 802.11 rate. */ - if (!(rxdw3 & R92C_RXDW3_HT)) { - tap->wr_rate = ridx2rate[rate]; - } else if (rate >= 12) { /* MCS0~15. */ - /* Bit 7 set means HT MCS instead of rate. */ - tap->wr_rate = 0x80 | (rate - 12); - } - tap->wr_dbm_antsignal = rssi; - tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR; - } - - *rssi_p = rssi; - + memcpy(mtod(m, uint8_t *), (uint8_t *)stat, totlen); + m->m_pkthdr.len = m->m_len = totlen; + return (m); +fail: + counter_u64_add(ic->ic_ierrors, 1); + return (NULL); } static struct mbuf * -urtwn_report_intr(struct usb_xfer *xfer, struct urtwn_data *data, int *rssi, - int8_t *nf) +urtwn_report_intr(struct usb_xfer *xfer, struct urtwn_data *data) { struct urtwn_softc *sc = data->sc; struct ieee80211com *ic = &sc->sc_ic; @@ -836,7 +796,7 @@ urtwn_report_intr(struct usb_xfer *xfer, switch (report_sel) { case R88E_RXDW3_RPT_RX: - return (urtwn_rxeof(sc, buf, len, rssi, nf)); + return (urtwn_rxeof(sc, buf, len)); case R88E_RXDW3_RPT_TX1: urtwn_r88e_ratectl_tx_complete(sc, &stat[1]); break; @@ -845,14 +805,13 @@ urtwn_report_intr(struct usb_xfer *xfer, break; } } else - return (urtwn_rxeof(sc, buf, len, rssi, nf)); + return (urtwn_rxeof(sc, buf, len)); return (NULL); } static struct mbuf * -urtwn_rxeof(struct urtwn_softc *sc, uint8_t *buf, int len, int *rssi, - int8_t *nf) +urtwn_rxeof(struct urtwn_softc *sc, uint8_t *buf, int len) { struct r92c_rx_stat *stat; struct mbuf *m, *m0 = NULL, *prevm = NULL; @@ -882,7 +841,7 @@ urtwn_rxeof(struct urtwn_softc *sc, uint if (totlen > len) break; - m = urtwn_rx_frame(sc, buf, pktlen, rssi); + m = urtwn_rx_copy_to_mbuf(sc, stat, totlen); if (m0 == NULL) m0 = m; if (prevm == NULL) @@ -930,17 +889,86 @@ urtwn_r88e_ratectl_tx_complete(struct ur URTWN_NT_UNLOCK(sc); } +static struct ieee80211_node * +urtwn_rx_frame(struct urtwn_softc *sc, struct mbuf *m, int8_t *rssi_p) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_frame_min *wh; + struct r92c_rx_stat *stat; + uint32_t rxdw0, rxdw3; + uint8_t rate, cipher; + int8_t rssi = URTWN_NOISE_FLOOR + 1; + int infosz; + + stat = mtod(m, struct r92c_rx_stat *); + rxdw0 = le32toh(stat->rxdw0); + rxdw3 = le32toh(stat->rxdw3); + + rate = MS(rxdw3, R92C_RXDW3_RATE); + cipher = MS(rxdw0, R92C_RXDW0_CIPHER); + infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8; + + /* Get RSSI from PHY status descriptor if present. */ + if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { + if (sc->chip & URTWN_CHIP_88E) + rssi = urtwn_r88e_get_rssi(sc, rate, &stat[1]); + else + rssi = urtwn_get_rssi(sc, rate, &stat[1]); + /* Update our average RSSI. */ + urtwn_update_avgrssi(sc, rate, rssi); + } + + if (ieee80211_radiotap_active(ic)) { + struct urtwn_rx_radiotap_header *tap = &sc->sc_rxtap; + + tap->wr_flags = 0; + + urtwn_get_tsf(sc, &tap->wr_tsft); + if (__predict_false(le32toh((uint32_t)tap->wr_tsft) < + le32toh(stat->rxdw5))) { + tap->wr_tsft = le32toh(tap->wr_tsft >> 32) - 1; + tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32; + } else + tap->wr_tsft &= 0xffffffff00000000; + tap->wr_tsft += stat->rxdw5; + + /* Map HW rate index to 802.11 rate. */ + if (!(rxdw3 & R92C_RXDW3_HT)) { + tap->wr_rate = ridx2rate[rate]; + } else if (rate >= 12) { /* MCS0~15. */ + /* Bit 7 set means HT MCS instead of rate. */ + tap->wr_rate = 0x80 | (rate - 12); + } + tap->wr_dbm_antsignal = rssi; + tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR; + } + + *rssi_p = rssi; + + /* Drop descriptor. */ + m_adj(m, sizeof(*stat) + infosz); + wh = mtod(m, struct ieee80211_frame_min *); + + if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && + cipher != R92C_CAM_ALGO_NONE) { + m->m_flags |= M_WEP; + } + + if (m->m_len >= sizeof(*wh)) + return (ieee80211_find_rxnode(ic, wh)); + + return (NULL); +} + static void urtwn_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) { struct urtwn_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame_min *wh; struct ieee80211_node *ni; struct mbuf *m = NULL, *next; struct urtwn_data *data; - int8_t nf; - int rssi = 1; + int8_t nf, rssi; URTWN_ASSERT_LOCKED(sc); @@ -950,7 +978,7 @@ urtwn_bulk_rx_callback(struct usb_xfer * if (data == NULL) goto tr_setup; STAILQ_REMOVE_HEAD(&sc->sc_rx_active, next); - m = urtwn_report_intr(xfer, data, &rssi, &nf); + m = urtwn_report_intr(xfer, data); STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); /* FALLTHROUGH */ case USB_ST_SETUP: @@ -971,15 +999,13 @@ tr_setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ - URTWN_UNLOCK(sc); while (m != NULL) { next = m->m_next; m->m_next = NULL; - wh = mtod(m, struct ieee80211_frame_min *); - if (m->m_len >= sizeof(*wh)) - ni = ieee80211_find_rxnode(ic, wh); - else - ni = NULL; + + ni = urtwn_rx_frame(sc, m, &rssi); + URTWN_UNLOCK(sc); + nf = URTWN_NOISE_FLOOR; if (ni != NULL) { (void)ieee80211_input(ni, m, rssi - nf, nf); @@ -988,9 +1014,10 @@ tr_setup: (void)ieee80211_input_all(ic, m, rssi - nf, nf); } + + URTWN_LOCK(sc); m = next; } - URTWN_LOCK(sc); break; default: /* needs it to the inactive queue due to a error. */ From owner-svn-src-all@freebsd.org Mon Dec 14 13:38:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC2EA479AC; Mon, 14 Dec 2015 13:38:07 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 006241CC4; Mon, 14 Dec 2015 13:38:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEDc627097584; Mon, 14 Dec 2015 13:38:06 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEDc67Q097583; Mon, 14 Dec 2015 13:38:06 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141338.tBEDc67Q097583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 13:38: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: r292209 - stable/8/sys/security/audit 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 13:38:07 -0000 Author: brueffer Date: Mon Dec 14 13:38:05 2015 New Revision: 292209 URL: https://svnweb.freebsd.org/changeset/base/292209 Log: MFH: r207615 by csjp Add a case to make sure that internal audit records get converted to BSM format for lpathconf(2) events. PR: 157946 Modified: stable/8/sys/security/audit/audit_bsm.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/security/ (props changed) Modified: stable/8/sys/security/audit/audit_bsm.c ============================================================================== --- stable/8/sys/security/audit/audit_bsm.c Mon Dec 14 13:26:22 2015 (r292208) +++ stable/8/sys/security/audit/audit_bsm.c Mon Dec 14 13:38:05 2015 (r292209) @@ -740,6 +740,7 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_LUTIMES: case AUE_NFS_GETFH: case AUE_LSTAT: + case AUE_LPATHCONF: case AUE_PATHCONF: case AUE_READLINK: case AUE_REVOKE: From owner-svn-src-all@freebsd.org Mon Dec 14 13:51:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F2ABA435FD; Mon, 14 Dec 2015 13:51:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 305401611; Mon, 14 Dec 2015 13:51:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEDpED8000870; Mon, 14 Dec 2015 13:51:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEDpE8H000869; Mon, 14 Dec 2015 13:51:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201512141351.tBEDpE8H000869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Dec 2015 13:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292210 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 13:51:15 -0000 Author: trasz Date: Mon Dec 14 13:51:14 2015 New Revision: 292210 URL: https://svnweb.freebsd.org/changeset/base/292210 Log: Fix kernel build with "options GEOM_MOUNTVER". Previously it was only working as a kernel module. PR: 205026 Submitted by: Eugene Grosbein MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Dec 14 13:38:05 2015 (r292209) +++ head/sys/conf/options Mon Dec 14 13:51:14 2015 (r292210) @@ -112,6 +112,7 @@ GEOM_LINUX_LVM opt_geom.h GEOM_MAP opt_geom.h GEOM_MBR opt_geom.h GEOM_MIRROR opt_geom.h +GEOM_MOUNTVER opt_geom.h GEOM_MULTIPATH opt_geom.h GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h From owner-svn-src-all@freebsd.org Mon Dec 14 14:44:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61B03A426D2; Mon, 14 Dec 2015 14:44:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E70F18A3; Mon, 14 Dec 2015 14:44:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEEiNSZ018405; Mon, 14 Dec 2015 14:44:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEEiNVS018404; Mon, 14 Dec 2015 14:44:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512141444.tBEEiNVS018404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 14 Dec 2015 14:44: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: r292211 - stable/10/sys/dev/netmap 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 14:44:24 -0000 Author: ngie Date: Mon Dec 14 14:44:23 2015 New Revision: 292211 URL: https://svnweb.freebsd.org/changeset/base/292211 Log: Unbreak the powerpc/powerpc64 tinderbox PR: 198805 Submitted by: sbruno MFC r280430: r280430 (by bz): Make ix_crcstrip a public symbol for the moment; it probably is not the right solution but I will leave it to experts to untangle this problem to properly stop the build failures. At the moment only if_ix.c includes dev/netmap/ixgbe_netmap.h which is good as ixgbe_netmap.h defines a couple of (file) static variables--thus local to if_ix.c. static int ix_crcstrip however now also got checked from ix_txrx.c (as an extern) and should not be visible there. In fact we do see powerpc and powerpc64 build failures because of this. It is unclear to me why on other (clang built?) architectures this does not lead to a reference of an undefined symbol and similar build breakage. Modified: stable/10/sys/dev/netmap/ixgbe_netmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- stable/10/sys/dev/netmap/ixgbe_netmap.h Mon Dec 14 13:51:14 2015 (r292210) +++ stable/10/sys/dev/netmap/ixgbe_netmap.h Mon Dec 14 14:44:23 2015 (r292211) @@ -61,7 +61,8 @@ * count packets that might be missed due to lost interrupts. */ SYSCTL_DECL(_dev_netmap); -static int ix_rx_miss, ix_rx_miss_bufs, ix_crcstrip; +static int ix_rx_miss, ix_rx_miss_bufs; +int ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss, From owner-svn-src-all@freebsd.org Mon Dec 14 15:44:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60FC4A47D32; Mon, 14 Dec 2015 15:44:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 332821B23; Mon, 14 Dec 2015 15:44:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEFiYVx035687; Mon, 14 Dec 2015 15:44:34 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEFiYE0035686; Mon, 14 Dec 2015 15:44:34 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141544.tBEFiYE0035686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 15:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292212 - head/usr.sbin/ctm/ctm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 15:44:35 -0000 Author: brueffer Date: Mon Dec 14 15:44:34 2015 New Revision: 292212 URL: https://svnweb.freebsd.org/changeset/base/292212 Log: Flesh out the SEE ALSO section. PR: 202929 Submitted by: jhs@berklix.com MFC after: 1 week Modified: head/usr.sbin/ctm/ctm/ctm.1 Modified: head/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- head/usr.sbin/ctm/ctm/ctm.1 Mon Dec 14 14:44:23 2015 (r292211) +++ head/usr.sbin/ctm/ctm/ctm.1 Mon Dec 14 15:44:34 2015 (r292212) @@ -12,7 +12,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 1995 +.Dd December 14, 2015 .Dt CTM 1 .Os .Sh NAME @@ -303,8 +303,19 @@ and .Fl V options. .Sh SEE ALSO +.Xr ctm_dequeue 1 , .Xr ctm_rmail 1 , +.Xr ctm_smail 1 , .Xr ctm 5 +.Rs +.%B "The FreeBSD Handbook" +.%T "Using CTM" +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ctm.html +.Re +.Rs +.%T "Miscellaneous CTM on FreeBSD Resources" +.%U http://ctm.berklix.org +.Re .Sh HISTORY Initial trials were run during the work on .Fx 1.1.5 , From owner-svn-src-all@freebsd.org Mon Dec 14 15:45:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2FEEA47E67; Mon, 14 Dec 2015 15:45:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C01961E34; Mon, 14 Dec 2015 15:45:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEFjBqR035773; Mon, 14 Dec 2015 15:45:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEFjBYj035772; Mon, 14 Dec 2015 15:45:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141545.tBEFjBYj035772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 15:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292213 - stable/10/sys/i386/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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 15:45:13 -0000 Author: hselasky Date: Mon Dec 14 15:45:11 2015 New Revision: 292213 URL: https://svnweb.freebsd.org/changeset/base/292213 Log: Fix the XEN build by disabling the mlx5 and mlx5en modules when XEN is enabled. This is a direct commit to stable/10. Sponsored by: Mellanox Technologies Modified: stable/10/sys/i386/conf/XEN Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Mon Dec 14 15:44:34 2015 (r292212) +++ stable/10/sys/i386/conf/XEN Mon Dec 14 15:45:11 2015 (r292213) @@ -14,6 +14,9 @@ makeoptions WITHOUT_MODULES="ctl cxgb dp # The following drivers don't work with PAE enabled. makeoptions WITHOUT_MODULES+="asr ncr pst" +# The following drivers don't build with XEN enabled. +makeoptions WITHOUT_MODULES+="mlx5 mlx5en" + options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption From owner-svn-src-all@freebsd.org Mon Dec 14 16:07:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF78FA43E78; Mon, 14 Dec 2015 16:07:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8941C1B9B; Mon, 14 Dec 2015 16:07:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEG7Kud041633; Mon, 14 Dec 2015 16:07:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEG7KpJ041632; Mon, 14 Dec 2015 16:07:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512141607.tBEG7KpJ041632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Dec 2015 16:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292214 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 16:07:21 -0000 Author: andrew Date: Mon Dec 14 16:07:20 2015 New Revision: 292214 URL: https://svnweb.freebsd.org/changeset/base/292214 Log: Add support for MSI interrupts to the gicv2m controller. The allocation is still quite simplistic, it just increments a counter to use the next interrupt. Obtained from: ABT Systems Ltd Sponsored by: SoftIron Inc Modified: head/sys/arm64/arm64/gic.c Modified: head/sys/arm64/arm64/gic.c ============================================================================== --- head/sys/arm64/arm64/gic.c Mon Dec 14 15:45:11 2015 (r292213) +++ head/sys/arm64/arm64/gic.c Mon Dec 14 16:07:20 2015 (r292214) @@ -432,6 +432,39 @@ gicv2m_alloc_msix(device_t dev, device_t } static int +gicv2m_alloc_msi(device_t dev, device_t pci_dev, int count, int *irqs) +{ + struct arm_gic_softc *psc; + struct gicv2m_softc *sc; + uint32_t reg; + int i, irq; + + psc = device_get_softc(device_get_parent(dev)); + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + KASSERT(sc->sc_spi_offset + count <= sc->sc_spi_count, + ("No free SPIs for %d MSI interrupts", count)); + + /* Find an unused interrupt */ + for (i = 0; i < count; i++) { + irq = sc->sc_spi_start + sc->sc_spi_offset; + sc->sc_spi_offset++; + + /* Interrupts need to be edge triggered, set this */ + reg = gic_d_read_4(psc, GICD_ICFGR(irq >> 4)); + reg |= (GICD_ICFGR_TRIG_EDGE | GICD_ICFGR_POL_HIGH) << + ((irq & 0xf) * 2); + gic_d_write_4(psc, GICD_ICFGR(irq >> 4), reg); + + irqs[i] = irq; + } + mtx_unlock(&sc->sc_mutex); + + return (0); +} + +static int gicv2m_map_msi(device_t dev, device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) { @@ -448,8 +481,9 @@ static device_method_t arm_gicv2m_method DEVMETHOD(device_probe, gicv2m_probe), DEVMETHOD(device_attach, gicv2m_attach), - /* MSI-X */ + /* MSI/MSI-X */ DEVMETHOD(pic_alloc_msix, gicv2m_alloc_msix), + DEVMETHOD(pic_alloc_msi, gicv2m_alloc_msi), DEVMETHOD(pic_map_msi, gicv2m_map_msi), { 0, 0 } From owner-svn-src-all@freebsd.org Mon Dec 14 17:08:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0E7A4417E; Mon, 14 Dec 2015 17:08:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F471B71; Mon, 14 Dec 2015 17:08:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEH8eI0059048; Mon, 14 Dec 2015 17:08:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEH8e1D059047; Mon, 14 Dec 2015 17:08:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512141708.tBEH8e1D059047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Dec 2015 17:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292215 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 17:08:41 -0000 Author: andrew Date: Mon Dec 14 17:08:40 2015 New Revision: 292215 URL: https://svnweb.freebsd.org/changeset/base/292215 Log: Update the handling of interrupts on the generic PCIe driver: * Use the interrupt-map property to route interrupts * Remove the IRQ rman, it's now unneeded * Support MSI/MSI-X interrupts With this I'm able to use the two NICs I've tested (em and msk), however while I can boot with an AHCI devie attached it fails when any drives are connected. Obtained from: ABT Systems Ltd Sponsored by: SoftIron Inc Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Dec 14 16:07:20 2015 (r292214) +++ head/sys/dev/pci/pci_host_generic.c Mon Dec 14 17:08:40 2015 (r292215) @@ -43,12 +43,15 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include +#include #include #include #include + #include #include #include @@ -75,8 +78,6 @@ __FBSDID("$FreeBSD$"); #define MIN_RANGES_TUPLES 2 #define PCI_IO_WINDOW_OFFSET 0x1000 -#define PCI_IRQ_START 32 -#define PCI_IRQ_END (PCI_IRQ_START + 4) #define SPACE_CODE_SHIFT 24 #define SPACE_CODE_MASK 0x3 @@ -98,7 +99,6 @@ struct generic_pcie_softc { int nranges; struct rman mem_rman; struct rman io_rman; - struct rman irq_rman; struct resource *res; struct resource *res1; int ecam; @@ -106,6 +106,7 @@ struct generic_pcie_softc { bus_space_handle_t bsh; device_t dev; bus_space_handle_t ioh; + struct ofw_bus_iinfo pci_iinfo; }; /* Forward prototypes */ @@ -216,14 +217,9 @@ generic_pcie_attach(device_t dev) } } - /* TODO: get IRQ numbers from FDT */ - sc->irq_rman.rm_type = RMAN_ARRAY; - sc->irq_rman.rm_descr = "Generic PCIe IRQs"; - if (rman_init(&sc->irq_rman) != 0 || - rman_manage_region(&sc->irq_rman, PCI_IRQ_START, - PCI_IRQ_END) != 0) { - panic("Generic PCI: failed to set up IRQ rman"); - } + ofw_bus_setup_iinfo(ofw_bus_get_node(dev), &sc->pci_iinfo, + sizeof(cell_t)); + device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); @@ -341,10 +337,6 @@ generic_pcie_read_config(device_t dev, u return (~0U); } - if (reg == PCIR_INTLINE) { - data += PCI_IRQ_START; - } - return (data); } @@ -390,6 +382,37 @@ generic_pcie_maxslots(device_t dev) } static int +generic_pcie_route_interrupt(device_t bus, device_t dev, int pin) +{ + struct generic_pcie_softc *sc; + struct ofw_pci_register reg; + uint32_t pintr, mintr[2]; + phandle_t iparent; + int intrcells; + + sc = device_get_softc(bus); + pintr = pin; + + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), + &sc->pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), + mintr, sizeof(mintr), &iparent); + if (intrcells) { + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); + return (pintr); + } + + device_printf(bus, "could not route pin %d for device %d.%d\n", + pin, pci_get_slot(dev), pci_get_function(dev)); + return (PCI_INVALID_IRQ); +} + + +static int generic_pcie_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) { @@ -432,8 +455,6 @@ generic_pcie_rman(struct generic_pcie_so return (&sc->io_rman); case SYS_RES_MEMORY: return (&sc->mem_rman); - case SYS_RES_IRQ: - return (&sc->irq_rman); default: break; } @@ -606,9 +627,20 @@ static device_method_t generic_pcie_meth DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + /* pcib interface */ DEVMETHOD(pcib_maxslots, generic_pcie_maxslots), + DEVMETHOD(pcib_route_interrupt, generic_pcie_route_interrupt), DEVMETHOD(pcib_read_config, generic_pcie_read_config), DEVMETHOD(pcib_write_config, generic_pcie_write_config), +#if defined(__aarch64__) + DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), + DEVMETHOD(pcib_release_msi, arm_release_msi), + DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), + DEVMETHOD(pcib_release_msix, arm_release_msix), + DEVMETHOD(pcib_map_msi, arm_map_msi), +#endif + DEVMETHOD_END }; From owner-svn-src-all@freebsd.org Mon Dec 14 17:21:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D25CA44A12; Mon, 14 Dec 2015 17:21:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35B781537; Mon, 14 Dec 2015 17:21:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEHL7lt064683; Mon, 14 Dec 2015 17:21:07 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEHL6jb064679; Mon, 14 Dec 2015 17:21:06 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512141721.tBEHL6jb064679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 14 Dec 2015 17:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292216 - in head: include lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 17:21:08 -0000 Author: vangyzen Date: Mon Dec 14 17:21:06 2015 New Revision: 292216 URL: https://svnweb.freebsd.org/changeset/base/292216 Log: resolver: preserve binary compatibility; reduce header pollution In r289315, I added new fields to res_state. This broke binary backward compatibility. It also broke some ports (and possibly other code) by requiring the definition of time_t and struct timespec. Fix these problems by moving the new fields into __res_state_ext. Suggested by: ume Reviewed by: ume MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D4472 Modified: head/include/resolv.h head/lib/libc/resolv/res_init.c head/lib/libc/resolv/res_private.h head/lib/libc/resolv/res_state.c Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Mon Dec 14 17:08:40 2015 (r292215) +++ head/include/resolv.h Mon Dec 14 17:21:06 2015 (r292216) @@ -57,7 +57,6 @@ #include #include #include -#include #include #include @@ -177,8 +176,7 @@ struct __res_state { int res_h_errno; /*%< last one set for this context */ int _vcsock; /*%< PRIVATE: for res_send VC i/o */ u_int _flags; /*%< PRIVATE: see below */ - u_short reload_period; /*%< seconds between stat(resolv.conf)*/ - u_short _pad; /*%< make _u 64 bit aligned */ + u_int _pad; /*%< make _u 64 bit aligned */ union { /* On an 32-bit arch this means 512b total. */ char pad[72 - 4*sizeof (int) - 3*sizeof (void *)]; @@ -190,8 +188,6 @@ struct __res_state { } _ext; } _u; u_char *_rnd; /*%< PRIVATE: random state */ - struct timespec conf_mtim; /*%< mod time of loaded resolv.conf */ - time_t conf_stat; /*%< time of last stat(resolv.conf) */ }; typedef struct __res_state *res_state; Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Mon Dec 14 17:08:40 2015 (r292215) +++ head/lib/libc/resolv/res_init.c Mon Dec 14 17:21:06 2015 (r292216) @@ -228,7 +228,6 @@ __res_vinit(res_state statp, int preinit statp->pfcode = 0; statp->_vcsock = -1; statp->_flags = 0; - statp->reload_period = 2; statp->qhook = NULL; statp->rhook = NULL; statp->_u._ext.nscount = 0; @@ -238,6 +237,7 @@ __res_vinit(res_state statp, int preinit statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr; strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa"); strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int"); + statp->_u._ext.ext->reload_period = 2; } else { /* * Historically res_init() rarely, if at all, failed. @@ -326,17 +326,13 @@ __res_vinit(res_state statp, int preinit struct stat sb; struct timespec now; - if (_fstat(fileno(fp), &sb) == 0) { - statp->conf_mtim = sb.st_mtim; - if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) == 0) { - statp->conf_stat = now.tv_sec; - } else { - statp->conf_stat = 0; - } - } else { - statp->conf_mtim.tv_sec = 0; - statp->conf_mtim.tv_nsec = 0; - statp->conf_stat = 0; + if (statp->_u._ext.ext != NULL) { + if (_fstat(fileno(fp), &sb) == 0) { + statp->_u._ext.ext->conf_mtim = sb.st_mtim; + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) == 0) { + statp->_u._ext.ext->conf_stat = now.tv_sec; + } + } } /* read the config file */ @@ -599,9 +595,7 @@ res_setoptions(res_state statp, const ch { const char *cp = options; int i; -#ifndef _LIBC struct __res_state_ext *ext = statp->_u._ext.ext; -#endif #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -686,8 +680,10 @@ res_setoptions(res_state statp, const ch statp->options |= RES_NOCHECKNAME; } else if (!strncmp(cp, "reload-period:", sizeof("reload-period:") - 1)) { - statp->reload_period = (u_short) - atoi(cp + sizeof("reload-period:") - 1); + if (ext != NULL) { + ext->reload_period = (u_short) + atoi(cp + sizeof("reload-period:") - 1); + } } #ifdef RES_USE_EDNS0 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { Modified: head/lib/libc/resolv/res_private.h ============================================================================== --- head/lib/libc/resolv/res_private.h Mon Dec 14 17:08:40 2015 (r292215) +++ head/lib/libc/resolv/res_private.h Mon Dec 14 17:21:06 2015 (r292216) @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + #ifndef res_private_h #define res_private_h @@ -12,6 +14,9 @@ struct __res_state_ext { } sort_list[MAXRESOLVSORT]; char nsuffix[64]; char nsuffix2[64]; + struct timespec conf_mtim; /* mod time of loaded resolv.conf */ + time_t conf_stat; /* time of last stat(resolv.conf) */ + u_short reload_period; /* seconds between stat(resolv.conf) */ }; extern int Modified: head/lib/libc/resolv/res_state.c ============================================================================== --- head/lib/libc/resolv/res_state.c Mon Dec 14 17:08:40 2015 (r292215) +++ head/lib/libc/resolv/res_state.c Mon Dec 14 17:21:06 2015 (r292216) @@ -37,6 +37,8 @@ #include "reentrant.h" #include "un-namespace.h" +#include "res_private.h" + #undef _res struct __res_state _res; @@ -66,20 +68,26 @@ res_check_reload(res_state statp) { struct timespec now; struct stat sb; + struct __res_state_ext *ext; + + if ((statp->options & RES_INIT) == 0) { + return (statp); + } - if ((statp->options & RES_INIT) == 0 || statp->reload_period == 0) { + ext = statp->_u._ext.ext; + if (ext == NULL || ext->reload_period == 0) { return (statp); } if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) != 0 || - (now.tv_sec - statp->conf_stat) < statp->reload_period) { + (now.tv_sec - ext->conf_stat) < ext->reload_period) { return (statp); } - statp->conf_stat = now.tv_sec; + ext->conf_stat = now.tv_sec; if (stat(_PATH_RESCONF, &sb) == 0 && - (sb.st_mtim.tv_sec != statp->conf_mtim.tv_sec || - sb.st_mtim.tv_nsec != statp->conf_mtim.tv_nsec)) { + (sb.st_mtim.tv_sec != ext->conf_mtim.tv_sec || + sb.st_mtim.tv_nsec != ext->conf_mtim.tv_nsec)) { statp->options &= ~RES_INIT; } From owner-svn-src-all@freebsd.org Mon Dec 14 18:02:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29424A1407C; Mon, 14 Dec 2015 18:02:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A9431A68; Mon, 14 Dec 2015 18:02:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E365AB93E; Mon, 14 Dec 2015 13:02:36 -0500 (EST) From: John Baldwin To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292214 - head/sys/arm64/arm64 Date: Mon, 14 Dec 2015 10:00:10 -0800 Message-ID: <2514466.bN9s7sMlTf@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512141607.tBEG7KpJ041632@repo.freebsd.org> References: <201512141607.tBEG7KpJ041632@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 14 Dec 2015 13:02:37 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 18:02:38 -0000 On Monday, December 14, 2015 04:07:20 PM Andrew Turner wrote: > Author: andrew > Date: Mon Dec 14 16:07:20 2015 > New Revision: 292214 > URL: https://svnweb.freebsd.org/changeset/base/292214 > > Log: > Add support for MSI interrupts to the gicv2m controller. The allocation > is still quite simplistic, it just increments a counter to use the next > interrupt. > > Obtained from: ABT Systems Ltd > Sponsored by: SoftIron Inc Does this work for a count > 1? With MSI (but not MSI-X) when you have a count > 1, you typically need an aligned, contiguous block of vectors. In particular, for MSI you can only request a power of 2 number of messages. The low N bits (where N == log base 2 of 'count') of the resulting 'data' register value (from PCIB_MAP_MSI()) must be zero for the first message in the block. When the PCI function wants to send a message, it stores the message index (i.e. which MSI message) in the low N bits). On x86 the low 8 bits of the data message are the IDT vector, so this means that MSI message blocks require an aligned, contiguous block of IDT vectors on the destination CPU. MSI-X avoids this need by providing separate address/data register pairs for each message, so each message can use an arbitrary vector. You do seem to use a contiguous block of vectors, but it's not clear they are aligned? -- John Baldwin From owner-svn-src-all@freebsd.org Mon Dec 14 18:40:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500DBA43AEA; Mon, 14 Dec 2015 18:40:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F4781B16; Mon, 14 Dec 2015 18:40:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E2D99B93E; Mon, 14 Dec 2015 13:40:26 -0500 (EST) From: John Baldwin To: Ian Lepore Cc: Alexey Dokuchaev , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292058 - head/sbin/geom/class/part Date: Mon, 14 Dec 2015 10:39:12 -0800 Message-ID: <1982430.YSjTPepPxF@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <1449940829.1358.154.camel@freebsd.org> References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 14 Dec 2015 13:40:27 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 18:40:28 -0000 On Saturday, December 12, 2015 10:20:29 AM Ian Lepore wrote: > On Sat, 2015-12-12 at 12:12 +0000, Alexey Dokuchaev wrote: > > On Thu, Dec 10, 2015 at 08:42:01PM +0300, Andrey V. Elsukov wrote: > > > On 10.12.15 20:05, Ian Lepore wrote: > > > > On Thu, 2015-12-10 at 10:37 +0000, Andrey V. Elsukov wrote: > > > > > Author: ae > > > > > Date: Thu Dec 10 10:37:12 2015 > > > > > New Revision: 292058 > > > > > URL: https://svnweb.freebsd.org/changeset/base/292058 > > > > > > > > > > Log: > > > > > Remove a note about damaged PMBR. Now GPT will be detected > > > > > automatically > > > > > with such corruption. > > > > > > > > > > MFC after: 1 month > > > > > > > > Will all of these changes add up to it being impossible to make a > > > > device NOT be recognized as gpt once it has had gpt on it? > > > > It's typical to dd some zeroes to the start of a volume to clean > > > > out > > > > old info, but if geom is going to aggressively ressurect a > > > > purposely > > > > -nuked GPT based on the backup info (which is hard to find and dd > > > > over > > > > by hand) this is going to add up to a lot of frustration for > > > > those of > > > > us who have to frequently work with regenerating sdcard and CF > > > > images. > > > > +1, I'm also used to "dd'ing zeros" trick. > > > > > If you want to make device to not be recognized as GPT, you should > > > use > > > 'gpart destroy -F ' this will destroy first two sectors > > > where > > > PMBR and primary GPT header are located, also it will destroy the > > > last > > > sector with backup GPT. > > > > While this' technically more accurate, "geom destroy" never worked > > for me > > without googling or reading the manpage because of missing -F switch, > > I > > think. Filling first few sectors with zeros worked for so many years > > and > > people got used to that. Would it perhaps make sense to add debug > > message > > when backup GPT is being used? > > > > I spent much of the last week fighting with "geom destroy" and trying > to prevent the ressurection of old geoms during the creation of new > ones. It's a Big Mess and it doesn't really work well at all. I came > to the conclusion that it's not geom destroy that needs a force flag so > much as geom create, where it would mean "it is okay to replace any > existing geom with the new one." > > For example if you have a freebsd slice da0s1 that contains freebsd > partitions within it, and you geom destroy -F da0 then that slice and > the partitions within it disappear. Then as soon as you create a new > geom for the device and add a slice that happens to fall on the same > sector that da0s1 used to live at, suddenly that whole geom tree comes > back to life and your next command to create a new geom da0s1 fails > because it already exists. > > With a task like formatting and populating an sd card with a script, > you have to deal with whatever data is on the sd card when it's first > inserted. You don't know where existing geoms might be, and it's quite > burdensome to write script code to figure that out and do a recursive > destroy -F. (Actually, a "geom destroy -R -F" to recursively clean > everything would be quite nice.) > > I eventually worked around the problem by using the no-commit feature > to do all the work in the sort of virtual space that creates, then > commit everything after the whole volume is laid out. That process is > another Big Mess, because it turns out you have to commit each geom > individually. > > Just committing the top level doesn't recurse and that creates insanity > because now you've got uncommitted nested geoms that are somehow locked > such that anything you try to do results in permission errors with no > clue why root doesn't have permission to do commands that usually work > fine. (I literally had to add printfs to sys/geom code and reboot with > that kernel to figure out what was wrong.) > > Maybe it shouldn't be possible to commit an outer geom if it contains > uncommitted nested geoms. Or maybe commit should have a -R flag to > recurse automatically as well (but that would have to be implemented on > the kernel side, unless there's some way to query from userland about > whether a geom is committed or not). A big +1 to this. At ${JOB--} we had a wonky script that tried gpart destroy -F but then still had to dd zero's at both the start and end of the disk to cope with various edge cases. All we really wanted was a 'gpart create -f' that would work reliably. The reason this commit triggered this message is paranoia that the more aggressive recovery here would now resurrect a GPT "mid-flight" when partitioning a disk causing the process to fail. Part of the problem is that partioning a disk is not atomic. You almost want a way to detach all consumers from a provider and then disable tasting (except for adding explicitly created objects) until you are done creating the new layout. Something like: gpart start_relayout foo # implies destroy -F gpart create -s bar foo gpart add blah blah ... gpart end_relayout foo (Yes, those command names are ugly, but you hopefully get the idea.) -- John Baldwin From owner-svn-src-all@freebsd.org Mon Dec 14 19:20:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82F2BA4789B; Mon, 14 Dec 2015 19:20:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51A181BF8; Mon, 14 Dec 2015 19:20:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEJKIf8099426; Mon, 14 Dec 2015 19:20:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEJKIii099425; Mon, 14 Dec 2015 19:20:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512141920.tBEJKIii099425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 14 Dec 2015 19:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292217 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 19:20:19 -0000 Author: emaste Date: Mon Dec 14 19:20:18 2015 New Revision: 292217 URL: https://svnweb.freebsd.org/changeset/base/292217 Log: Update advice on obj disk space requirements The Makefile is not the best place for this information, but at least it is now less out of date. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Dec 14 17:21:06 2015 (r292216) +++ head/Makefile Mon Dec 14 19:20:18 2015 (r292217) @@ -57,8 +57,8 @@ # Makefile.inc1. The exceptions are universe, tinderbox and targets. # # If you want to build your system from source be sure that /usr/obj has -# at least 1GB of diskspace available. A complete 'universe' build requires -# about 15GB of space. +# at least 6GB of diskspace available. A complete 'universe' build requires +# about 100GB of space. # # For individuals wanting to build from the sources currently on their # system, the simple instructions are: From owner-svn-src-all@freebsd.org Mon Dec 14 19:37:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95569A437F2; Mon, 14 Dec 2015 19:37:21 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 805EF151D; Mon, 14 Dec 2015 19:37:21 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0NZD00HOJ5626B00@mr11p00im-asmtp003.me.com>; Mon, 14 Dec 2015 19:37:15 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-14_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1512140326 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Mon, 14 Dec 2015 11:37:12 -0800 Subject: Re: svn commit: r292058 - head/sbin/geom/class/part From: Ravi Pokala Sender: "Pokala, Ravi" To: Ian Lepore , Alexey Dokuchaev , "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <7C4EDA10-2CB9-4311-A3DB-952ED68E34E9@panasas.com> Thread-topic: svn commit: r292058 - head/sbin/geom/class/part References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> In-reply-to: <1449940829.1358.154.camel@freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 19:37:21 -0000 -----Original Message----- From: on behalf of Ian Lepore Date: 2015-12-12, Saturday at 09:20 To: Alexey Dokuchaev , "Andrey V. Elsukov" Cc: , , Subject: Re: svn commit: r292058 - head/sbin/geom/class/part >I spent much of the last week fighting with "geom destroy" and trying >to prevent the ressurection of old geoms during the creation of new >ones. It's a Big Mess and it doesn't really work well at all. I came >to the conclusion that it's not geom destroy that needs a force flag so >much as geom create, where it would mean "it is okay to replace any >existing geom with the new one." > >For example if you have a freebsd slice da0s1 that contains freebsd >partitions within it, and you geom destroy -F da0 then that slice and >the partitions within it disappear. Then as soon as you create a new >geom for the device and add a slice that happens to fall on the same >sector that da0s1 used to live at, suddenly that whole geom tree comes >back to life and your next command to create a new geom da0s1 fails >because it already exists. At work, we frequently boot from LAN and do automated installs. The partitioning ~never changes, so we run into exactly the scenario you described. I ended up doing a horrible hack which parses the existing partition table (both slice/label and GPT), and zeros out the first and last few sectors of each partition. AND parse the partitioning info we're passing to the installer, and zeroing out the first and last sectors of the partitions we're ABOUT TO create. It's a medium-sized PITA, but it works. -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Mon Dec 14 19:40:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62A2A43A46; Mon, 14 Dec 2015 19:40:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9236A1871; Mon, 14 Dec 2015 19:40:48 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEJelJS005326; Mon, 14 Dec 2015 19:40:47 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEJelsq005324; Mon, 14 Dec 2015 19:40:47 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201512141940.tBEJelsq005324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 14 Dec 2015 19:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292218 - in head/sys/dev: mpr mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 19:40:48 -0000 Author: asomers Date: Mon Dec 14 19:40:47 2015 New Revision: 292218 URL: https://svnweb.freebsd.org/changeset/base/292218 Log: Don't retry SAS commands in response to protocol errors sys/dev/mpr/mpr_sas_lsi.c sys/dev/mps/mps_sas_lsi.c When mp[rs]sas_get_sata_identify returns MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR, don't bother retrying. Protocol errors aren't likely to be fixed by sleeping. Without this change, a system that generated may protocol errors due to signal integrity issues was taking more than an hour to boot, due to all the retries. Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4553 Modified: head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon Dec 14 19:20:18 2015 (r292217) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon Dec 14 19:40:47 2015 (r292218) @@ -885,7 +885,13 @@ mprsas_get_sas_address_for_sata_disk(str ioc_status = le16toh(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK; sas_status = mpi_reply.SASStatus; - if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { + switch (ioc_status) { + case MPI2_IOCSTATUS_SUCCESS: + break; + case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: + /* No sense sleeping. this error won't get better */ + break; + default: if (sc->spinup_wait_time > 0) { mpr_dprint(sc, MPR_INFO, "Sleeping %d seconds " "after SATA ID error to wait for spinup\n", @@ -894,8 +900,10 @@ mprsas_get_sas_address_for_sata_disk(str "mprid", sc->spinup_wait_time * hz); } } - } while (((rc && (rc != EWOULDBLOCK)) || ioc_status || sas_status) && - (try_count < 5)); + } while (((rc && (rc != EWOULDBLOCK)) || + (ioc_status && + (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR)) + || sas_status) && (try_count < 5)); if (rc == 0 && !ioc_status && !sas_status) { mpr_dprint(sc, MPR_MAPPING, "%s: got SATA identify " Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Dec 14 19:20:18 2015 (r292217) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Dec 14 19:40:47 2015 (r292218) @@ -794,7 +794,13 @@ mpssas_get_sas_address_for_sata_disk(str ioc_status = le16toh(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK; sas_status = mpi_reply.SASStatus; - if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { + switch (ioc_status) { + case MPI2_IOCSTATUS_SUCCESS: + break; + case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: + /* No sense sleeping. this error won't get better */ + break; + default: if (sc->spinup_wait_time > 0) { mps_dprint(sc, MPS_INFO, "Sleeping %d seconds " "after SATA ID error to wait for spinup\n", @@ -803,8 +809,10 @@ mpssas_get_sas_address_for_sata_disk(str "mpsid", sc->spinup_wait_time * hz); } } - } while (((rc && (rc != EWOULDBLOCK)) || ioc_status || sas_status) && - (try_count < 5)); + } while (((rc && (rc != EWOULDBLOCK)) || + (ioc_status && + (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR)) + || sas_status) && (try_count < 5)); if (rc == 0 && !ioc_status && !sas_status) { mps_dprint(sc, MPS_MAPPING, "%s: got SATA identify " From owner-svn-src-all@freebsd.org Mon Dec 14 19:44:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D3AA43D6C; Mon, 14 Dec 2015 19:44:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 503B31C78; Mon, 14 Dec 2015 19:44:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEJinMc008067; Mon, 14 Dec 2015 19:44:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEJinv9008065; Mon, 14 Dec 2015 19:44:49 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512141944.tBEJinv9008065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 14 Dec 2015 19:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292219 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 19:44:50 -0000 Author: kp Date: Mon Dec 14 19:44:49 2015 New Revision: 292219 URL: https://svnweb.freebsd.org/changeset/base/292219 Log: inet6: Do not assume every interface has ip6 enabled. Certain interfaces (e.g. pfsync0) do not have ip6 addresses (in other words, ifp->if_afdata[AF_INET6] is NULL). Ensure we don't panic when the MTU is updated. pfsync interfaces will never have ip6 support, because it's explicitly disabled in in6_domifattach(). PR: 205194 Reviewed by: melifaro, hrs Differential Revision: https://reviews.freebsd.org/D4522 Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Dec 14 19:40:47 2015 (r292218) +++ head/sys/netinet6/in6.c Mon Dec 14 19:44:49 2015 (r292219) @@ -2432,6 +2432,8 @@ in6_domifattach(struct ifnet *ifp) int in6_domifmtu(struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return ifp->if_mtu; return (IN6_LINKMTU(ifp)); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Dec 14 19:40:47 2015 (r292218) +++ head/sys/netinet6/nd6.c Mon Dec 14 19:44:49 2015 (r292219) @@ -285,6 +285,8 @@ nd6_ifdetach(struct nd_ifinfo *nd) void nd6_setmtu(struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return; nd6_setmtu0(ifp, ND_IFINFO(ifp)); } From owner-svn-src-all@freebsd.org Mon Dec 14 20:29:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6693EA43585; Mon, 14 Dec 2015 20:29:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35542134E; Mon, 14 Dec 2015 20:29:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEKTVdq019867; Mon, 14 Dec 2015 20:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEKTVwp019866; Mon, 14 Dec 2015 20:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142029.tBEKTVwp019866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 20:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292220 - stable/10/bin/freebsd-version 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 20:29:32 -0000 Author: bdrewery Date: Mon Dec 14 20:29:31 2015 New Revision: 292220 URL: https://svnweb.freebsd.org/changeset/base/292220 Log: MFC r291942: Add missing CLEANFILES. Modified: stable/10/bin/freebsd-version/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/freebsd-version/Makefile ============================================================================== --- stable/10/bin/freebsd-version/Makefile Mon Dec 14 19:44:49 2015 (r292219) +++ stable/10/bin/freebsd-version/Makefile Mon Dec 14 20:29:31 2015 (r292220) @@ -2,7 +2,7 @@ SCRIPTS = freebsd-version MAN = freebsd-version.1 -CLEANFILES = freebsd-version.sh +CLEANFILES = freebsd-version freebsd-version.sh NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS} From owner-svn-src-all@freebsd.org Mon Dec 14 20:39:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF6B2A43D99; Mon, 14 Dec 2015 20:39:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6121B9E; Mon, 14 Dec 2015 20:39:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEKdcYp022982; Mon, 14 Dec 2015 20:39:38 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEKdcLO022981; Mon, 14 Dec 2015 20:39:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512142039.tBEKdcLO022981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 14 Dec 2015 20:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292221 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 20:39:40 -0000 Author: avos Date: Mon Dec 14 20:39:38 2015 New Revision: 292221 URL: https://svnweb.freebsd.org/changeset/base/292221 Log: urtwn: add raw Tx path. Tested with RTL8188EU and RTL8188CUS in STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4523 Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon Dec 14 20:29:31 2015 (r292220) +++ head/sys/dev/usb/wlan/if_urtwn.c Mon Dec 14 20:39:38 2015 (r292221) @@ -275,6 +275,10 @@ static int8_t urtwn_r88e_get_rssi(struc static int urtwn_tx_data(struct urtwn_softc *, struct ieee80211_node *, struct mbuf *, struct urtwn_data *); +static int urtwn_tx_raw(struct urtwn_softc *, + struct ieee80211_node *, struct mbuf *, + struct urtwn_data *, + const struct ieee80211_bpf_params *); static void urtwn_tx_start(struct urtwn_softc *, struct mbuf *, uint8_t, struct urtwn_data *); static int urtwn_transmit(struct ieee80211com *, struct mbuf *); @@ -2729,6 +2733,107 @@ urtwn_tx_data(struct urtwn_softc *sc, st return (0); } +static int +urtwn_tx_raw(struct urtwn_softc *sc, struct ieee80211_node *ni, + struct mbuf *m, struct urtwn_data *data, + const struct ieee80211_bpf_params *params) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_key *k = NULL; + struct ieee80211_frame *wh; + struct r92c_tx_desc *txd; + uint8_t cipher, ridx, type; + + /* Encrypt the frame if need be. */ + cipher = R92C_TXDW1_CIPHER_NONE; + if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { + /* Retrieve key for TX. */ + k = ieee80211_crypto_encap(ni, m); + if (k == NULL) + return (ENOBUFS); + + if (!(k->wk_flags & IEEE80211_KEY_SWCRYPT)) { + switch (k->wk_cipher->ic_cipher) { + case IEEE80211_CIPHER_WEP: + case IEEE80211_CIPHER_TKIP: + cipher = R92C_TXDW1_CIPHER_RC4; + break; + case IEEE80211_CIPHER_AES_CCM: + cipher = R92C_TXDW1_CIPHER_AES; + break; + default: + device_printf(sc->sc_dev, + "%s: unknown cipher %d\n", + __func__, k->wk_cipher->ic_cipher); + return (EINVAL); + } + } + } + + wh = mtod(m, struct ieee80211_frame *); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + + /* Fill Tx descriptor. */ + txd = (struct r92c_tx_desc *)data->buf; + memset(txd, 0, sizeof(*txd)); + + txd->txdw0 |= htole32( + SM(R92C_TXDW0_OFFSET, sizeof(*txd)) | + R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); + + if (params->ibp_flags & IEEE80211_BPF_RTS) + txd->txdw4 |= htole32(R92C_TXDW4_RTSEN); + if (params->ibp_flags & IEEE80211_BPF_CTS) + txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF); + if (txd->txdw4 & htole32(R92C_TXDW4_RTSEN | R92C_TXDW4_CTS2SELF)) { + txd->txdw4 |= htole32(R92C_TXDW4_HWRTSEN); + txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, + URTWN_RIDX_OFDM24)); + } + + if (sc->chip & URTWN_CHIP_88E) + txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, URTWN_MACID_BC)); + else + txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, URTWN_MACID_BC)); + + txd->txdw1 |= htole32(SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT)); + txd->txdw1 |= htole32(SM(R92C_TXDW1_CIPHER, cipher)); + + /* Choose a TX rate index. */ + ridx = rate2ridx(params->ibp_rate0); + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); + txd->txdw5 |= htole32(0x0001ff00); + txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); + + if (!IEEE80211_QOS_HAS_SEQ(wh)) { + /* Use HW sequence numbering for non-QoS frames. */ + if (sc->chip & URTWN_CHIP_88E) + txd->txdseq = htole16(R88E_TXDSEQ_HWSEQ_EN); + else + txd->txdw4 |= htole32(R92C_TXDW4_HWSEQ_EN); + } else { + /* Set sequence number. */ + txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); + } + + if (ieee80211_radiotap_active_vap(vap)) { + struct urtwn_tx_radiotap_header *tap = &sc->sc_txtap; + + tap->wt_flags = 0; + if (k != NULL) + tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; + ieee80211_radiotap_tx(vap, m); + } + + data->ni = ni; + + urtwn_tx_start(sc, m, type, data); + + return (0); +} + static void urtwn_tx_start(struct urtwn_softc *sc, struct mbuf *m, uint8_t type, struct urtwn_data *data) @@ -4631,7 +4736,20 @@ urtwn_raw_xmit(struct ieee80211_node *ni goto end; } - if ((error = urtwn_tx_data(sc, ni, m, bf)) != 0) { + if (params == NULL) { + /* + * Legacy path; interpret frame contents to decide + * precisely how to send the frame. + */ + error = urtwn_tx_data(sc, ni, m, bf); + } else { + /* + * Caller supplied explicit parameters to use in + * sending the frame. + */ + error = urtwn_tx_raw(sc, ni, m, bf, params); + } + if (error != 0) { STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); goto end; } From owner-svn-src-all@freebsd.org Mon Dec 14 21:00:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7213A44BBF; Mon, 14 Dec 2015 21:00:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9503A1B83; Mon, 14 Dec 2015 21:00:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEL001S029036; Mon, 14 Dec 2015 21:00:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEL00sv029035; Mon, 14 Dec 2015 21:00:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142100.tBEL00sv029035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 21:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292222 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 21:00:01 -0000 Author: bdrewery Date: Mon Dec 14 21:00:00 2015 New Revision: 292222 URL: https://svnweb.freebsd.org/changeset/base/292222 Log: Let termcap be used in LIBADD. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon Dec 14 20:39:38 2015 (r292221) +++ head/share/mk/src.libnames.mk Mon Dec 14 21:00:00 2015 (r292222) @@ -149,6 +149,7 @@ _LIBRARIES= \ stdthreads \ supcplusplus \ tacplus \ + termcap \ termcapw \ ufs \ ugidfw \ From owner-svn-src-all@freebsd.org Mon Dec 14 21:21:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC527A436E8; Mon, 14 Dec 2015 21:21:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADDB41B67; Mon, 14 Dec 2015 21:21:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBELLhIw035198; Mon, 14 Dec 2015 21:21:43 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBELLh71035193; Mon, 14 Dec 2015 21:21:43 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142121.tBELLh71035193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 21:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292223 - in stable/10/sys: fs/nfs fs/nfsserver nfs 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 21:21:45 -0000 Author: rmacklem Date: Mon Dec 14 21:21:43 2015 New Revision: 292223 URL: https://svnweb.freebsd.org/changeset/base/292223 Log: MFC: r291527 Add kernel support to the NFS server for the "-manage-gids" option that will be added to the nfsuserd daemon in a future commit. It modifies the cache used by NFSv4 for name<-->id translation (both username/uid and group/gid) to support this. When "-manage-gids" is set, the server looks up each uid for the RPC and uses the list of groups cached in the server instead of the list of groups provided in the RPC request. The cached group list is acquired for the cache by the nfsuserd daemon via getgrouplist(3). This avoids the 16 groups limit for the list in the RPC request. Since the cache is now used for every RPC when "-manage-gids" is enabled, the code also modifies the cache to use a separate mutex for each hash list instead of a single global mutex. Modified: stable/10/sys/fs/nfs/nfs.h stable/10/sys/fs/nfs/nfs_commonport.c stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfs/nfsrvstate.h stable/10/sys/fs/nfsserver/nfs_nfsdport.c stable/10/sys/nfs/nfssvc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs.h ============================================================================== --- stable/10/sys/fs/nfs/nfs.h Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs.h Mon Dec 14 21:21:43 2015 (r292223) @@ -96,12 +96,6 @@ #define NFSSESSIONHASHSIZE 20 /* Size of server session hash table */ #endif #define NFSSTATEHASHSIZE 10 /* Size of server stateid hash table */ -#ifndef NFSUSERHASHSIZE -#define NFSUSERHASHSIZE 30 /* Size of user id hash table */ -#endif -#ifndef NFSGROUPHASHSIZE -#define NFSGROUPHASHSIZE 5 /* Size of group id hash table */ -#endif #ifndef NFSCLDELEGHIGHWATER #define NFSCLDELEGHIGHWATER 10000 /* limit for client delegations */ #endif @@ -204,6 +198,18 @@ struct nfsd_idargs { int nid_usertimeout;/* User name timeout (minutes) */ u_char *nid_name; /* Name */ int nid_namelen; /* and its length */ + gid_t *nid_grps; /* and the list */ + int nid_ngroup; /* Size of groups list */ +}; + +struct nfsd_oidargs { + int nid_flag; /* Flags (see below) */ + uid_t nid_uid; /* user/group id */ + gid_t nid_gid; + int nid_usermax; /* Upper bound on user name cache */ + int nid_usertimeout;/* User name timeout (minutes) */ + u_char *nid_name; /* Name */ + int nid_namelen; /* and its length */ }; struct nfsd_clid { Modified: stable/10/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonport.c Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs_commonport.c Mon Dec 14 21:21:43 2015 (r292223) @@ -63,6 +63,7 @@ int nfs_numnfscbd = 0; int nfscl_debuglevel = 0; char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; struct callout newnfsd_callout; +int nfsrv_lughashsize = 100; void (*nfsd_call_servertimer)(void) = NULL; void (*ncl_call_invalcaches)(struct vnode *) = NULL; @@ -79,6 +80,9 @@ SYSCTL_STRING(_vfs_nfs, OID_AUTO, callba "NFSv4 callback addr for server to use"); SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nfscl_debuglevel, 0, "Debug level for new nfs client"); +TUNABLE_INT("vfs.nfs.userhashsize", &nfsrv_lughashsize); +SYSCTL_INT(_vfs_nfs, OID_AUTO, userhashsize, CTLFLAG_RDTUN, &nfsrv_lughashsize, + 0, "Size of hash tables for uid/name mapping"); /* * Defines for malloc @@ -445,9 +449,25 @@ nfssvc_call(struct thread *p, struct nfs { int error = EINVAL; struct nfsd_idargs nid; + struct nfsd_oidargs onid; if (uap->flag & NFSSVC_IDNAME) { - error = copyin(uap->argp, (caddr_t)&nid, sizeof (nid)); + if ((uap->flag & NFSSVC_NEWSTRUCT) != 0) + error = copyin(uap->argp, &nid, sizeof(nid)); + else { + error = copyin(uap->argp, &onid, sizeof(onid)); + if (error == 0) { + nid.nid_flag = onid.nid_flag; + nid.nid_uid = onid.nid_uid; + nid.nid_gid = onid.nid_gid; + nid.nid_usermax = onid.nid_usermax; + nid.nid_usertimeout = onid.nid_usertimeout; + nid.nid_name = onid.nid_name; + nid.nid_namelen = onid.nid_namelen; + nid.nid_ngroup = 0; + nid.nid_grps = NULL; + } + } if (error) goto out; error = nfssvc_idname(&nid); Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Mon Dec 14 21:21:43 2015 (r292223) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include +#include + /* * Data items converted to xdr at startup, since they are constant * This is kinda hokey, but may save a little time doing byte swaps @@ -68,6 +70,7 @@ int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; +extern int nfsrv_lughashsize; /* * This array of structures indicates, for V4: @@ -154,11 +157,14 @@ static int nfsrv_usercnt = 0; static int nfsrv_dnsnamelen; static u_char *nfsrv_dnsname = NULL; static int nfsrv_usermax = 999999999; -static struct nfsuserhashhead nfsuserhash[NFSUSERHASHSIZE]; -static struct nfsuserhashhead nfsusernamehash[NFSUSERHASHSIZE]; -static struct nfsuserhashhead nfsgrouphash[NFSGROUPHASHSIZE]; -static struct nfsuserhashhead nfsgroupnamehash[NFSGROUPHASHSIZE]; -static struct nfsuserlruhead nfsuserlruhead; +struct nfsrv_lughash { + struct mtx mtx; + struct nfsuserhashhead lughead; +}; +static struct nfsrv_lughash *nfsuserhash; +static struct nfsrv_lughash *nfsusernamehash; +static struct nfsrv_lughash *nfsgrouphash; +static struct nfsrv_lughash *nfsgroupnamehash; /* * This static array indicates whether or not the RPC generates a large @@ -177,7 +183,7 @@ static void nfsv4_wanted(struct nfsv4loc static int nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len); static int nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char *name, NFSPROC_T *p); -static void nfsrv_removeuser(struct nfsusrgrp *usrp); +static void nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser); static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **, int *, int *); static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *); @@ -2541,18 +2547,17 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, u_char *cp = *cpp; uid_t tmp; int cnt, hasampersand, len = NFSV4_SMALLSTR, ret; + struct nfsrv_lughash *hp; cnt = 0; tryagain: - NFSLOCKNAMEID(); - if (nfsrv_dnsname) { + if (nfsrv_dnsnamelen > 0) { /* * Always map nfsrv_defaultuid to "nobody". */ if (uid == nfsrv_defaultuid) { i = nfsrv_dnsnamelen + 7; if (i > len) { - NFSUNLOCKNAMEID(); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2564,11 +2569,12 @@ tryagain: NFSBCOPY("nobody@", cp, 7); cp += 7; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); - NFSUNLOCKNAMEID(); return; } hasampersand = 0; - LIST_FOREACH(usrp, NFSUSERHASH(uid), lug_numhash) { + hp = NFSUSERHASH(uid); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { if (usrp->lug_uid == uid) { if (usrp->lug_expiry < NFSD_MONOSEC) break; @@ -2588,7 +2594,7 @@ tryagain: i = usrp->lug_namelen + nfsrv_dnsnamelen + 1; if (i > len) { - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2603,20 +2609,19 @@ tryagain: *cp++ = '@'; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); } - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp->lughead, usrp, + lug_numhash); + mtx_unlock(&hp->mtx); return; } } - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); cnt++; ret = nfsrv_getuser(RPCNFSUSERD_GETUID, uid, (gid_t)0, NULL, p); if (ret == 0 && cnt < 2) goto tryagain; - } else { - NFSUNLOCKNAMEID(); } /* @@ -2640,6 +2645,52 @@ tryagain: } /* + * Get a credential for the uid with the server's group list. + * If none is found, just return the credential passed in after + * logging a warning message. + */ +struct ucred * +nfsrv_getgrpscred(struct ucred *oldcred) +{ + struct nfsusrgrp *usrp; + struct ucred *newcred; + int cnt, ret; + uid_t uid; + struct nfsrv_lughash *hp; + + cnt = 0; + uid = oldcred->cr_uid; +tryagain: + if (nfsrv_dnsnamelen > 0) { + hp = NFSUSERHASH(uid); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { + if (usrp->lug_uid == uid) { + if (usrp->lug_expiry < NFSD_MONOSEC) + break; + if (usrp->lug_cred != NULL) { + newcred = crhold(usrp->lug_cred); + crfree(oldcred); + } else + newcred = oldcred; + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp->lughead, usrp, + lug_numhash); + mtx_unlock(&hp->mtx); + return (newcred); + } + } + mtx_unlock(&hp->mtx); + cnt++; + ret = nfsrv_getuser(RPCNFSUSERD_GETUID, uid, (gid_t)0, + NULL, curthread); + if (ret == 0 && cnt < 2) + goto tryagain; + } + return (oldcred); +} + +/* * Convert a string to a uid. * If no conversion is possible return NFSERR_BADOWNER, otherwise * return 0. @@ -2657,6 +2708,7 @@ nfsv4_strtouid(struct nfsrv_descript *nd int cnt, ret; int error = 0; uid_t tuid; + struct nfsrv_lughash *hp, *hp2; if (len == 0) { error = NFSERR_BADOWNER; @@ -2686,49 +2738,55 @@ nfsv4_strtouid(struct nfsrv_descript *nd cnt = 0; tryagain: - NFSLOCKNAMEID(); - /* - * If an '@' is found and the domain name matches, search for the name - * with dns stripped off. - * Mixed case alpahbetics will match for the domain name, but all - * upper case will not. - */ - if (cnt == 0 && i < len && i > 0 && nfsrv_dnsname && - (len - 1 - i) == nfsrv_dnsnamelen && - !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { - len -= (nfsrv_dnsnamelen + 1); - *(cp - 1) = '\0'; - } - - /* - * Check for the special case of "nobody". - */ - if (len == 6 && !NFSBCMP(str, "nobody", 6)) { - *uidp = nfsrv_defaultuid; - NFSUNLOCKNAMEID(); - error = 0; - goto out; - } - - LIST_FOREACH(usrp, NFSUSERNAMEHASH(str, len), lug_namehash) { - if (usrp->lug_namelen == len && - !NFSBCMP(usrp->lug_name, str, len)) { - if (usrp->lug_expiry < NFSD_MONOSEC) - break; - *uidp = usrp->lug_uid; - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + if (nfsrv_dnsnamelen > 0) { + /* + * If an '@' is found and the domain name matches, search for + * the name with dns stripped off. + * Mixed case alpahbetics will match for the domain name, but + * all upper case will not. + */ + if (cnt == 0 && i < len && i > 0 && + (len - 1 - i) == nfsrv_dnsnamelen && + !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { + len -= (nfsrv_dnsnamelen + 1); + *(cp - 1) = '\0'; + } + + /* + * Check for the special case of "nobody". + */ + if (len == 6 && !NFSBCMP(str, "nobody", 6)) { + *uidp = nfsrv_defaultuid; error = 0; goto out; } + + hp = NFSUSERNAMEHASH(str, len); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_namehash) { + if (usrp->lug_namelen == len && + !NFSBCMP(usrp->lug_name, str, len)) { + if (usrp->lug_expiry < NFSD_MONOSEC) + break; + hp2 = NFSUSERHASH(usrp->lug_uid); + mtx_lock(&hp2->mtx); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp2->lughead, usrp, + lug_numhash); + *uidp = usrp->lug_uid; + mtx_unlock(&hp2->mtx); + mtx_unlock(&hp->mtx); + error = 0; + goto out; + } + } + mtx_unlock(&hp->mtx); + cnt++; + ret = nfsrv_getuser(RPCNFSUSERD_GETUSER, (uid_t)0, (gid_t)0, + str, p); + if (ret == 0 && cnt < 2) + goto tryagain; } - NFSUNLOCKNAMEID(); - cnt++; - ret = nfsrv_getuser(RPCNFSUSERD_GETUSER, (uid_t)0, (gid_t)0, - str, p); - if (ret == 0 && cnt < 2) - goto tryagain; error = NFSERR_BADOWNER; out: @@ -2751,18 +2809,17 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, u_char *cp = *cpp; gid_t tmp; int cnt, hasampersand, len = NFSV4_SMALLSTR, ret; + struct nfsrv_lughash *hp; cnt = 0; tryagain: - NFSLOCKNAMEID(); - if (nfsrv_dnsname) { + if (nfsrv_dnsnamelen > 0) { /* * Always map nfsrv_defaultgid to "nogroup". */ if (gid == nfsrv_defaultgid) { i = nfsrv_dnsnamelen + 8; if (i > len) { - NFSUNLOCKNAMEID(); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2774,11 +2831,12 @@ tryagain: NFSBCOPY("nogroup@", cp, 8); cp += 8; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); - NFSUNLOCKNAMEID(); return; } hasampersand = 0; - LIST_FOREACH(usrp, NFSGROUPHASH(gid), lug_numhash) { + hp = NFSGROUPHASH(gid); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { if (usrp->lug_gid == gid) { if (usrp->lug_expiry < NFSD_MONOSEC) break; @@ -2798,7 +2856,7 @@ tryagain: i = usrp->lug_namelen + nfsrv_dnsnamelen + 1; if (i > len) { - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2813,20 +2871,19 @@ tryagain: *cp++ = '@'; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); } - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp->lughead, usrp, + lug_numhash); + mtx_unlock(&hp->mtx); return; } } - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); cnt++; ret = nfsrv_getuser(RPCNFSUSERD_GETGID, (uid_t)0, gid, NULL, p); if (ret == 0 && cnt < 2) goto tryagain; - } else { - NFSUNLOCKNAMEID(); } /* @@ -2867,6 +2924,7 @@ nfsv4_strtogid(struct nfsrv_descript *nd int cnt, ret; int error = 0; gid_t tgid; + struct nfsrv_lughash *hp, *hp2; if (len == 0) { error = NFSERR_BADOWNER; @@ -2896,47 +2954,53 @@ nfsv4_strtogid(struct nfsrv_descript *nd cnt = 0; tryagain: - NFSLOCKNAMEID(); - /* - * If an '@' is found and the dns name matches, search for the name - * with the dns stripped off. - */ - if (cnt == 0 && i < len && i > 0 && nfsrv_dnsname && - (len - 1 - i) == nfsrv_dnsnamelen && - !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { - len -= (nfsrv_dnsnamelen + 1); - *(cp - 1) = '\0'; - } - - /* - * Check for the special case of "nogroup". - */ - if (len == 7 && !NFSBCMP(str, "nogroup", 7)) { - *gidp = nfsrv_defaultgid; - NFSUNLOCKNAMEID(); - error = 0; - goto out; - } - - LIST_FOREACH(usrp, NFSGROUPNAMEHASH(str, len), lug_namehash) { - if (usrp->lug_namelen == len && - !NFSBCMP(usrp->lug_name, str, len)) { - if (usrp->lug_expiry < NFSD_MONOSEC) - break; - *gidp = usrp->lug_gid; - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + if (nfsrv_dnsnamelen > 0) { + /* + * If an '@' is found and the dns name matches, search for the + * name with the dns stripped off. + */ + if (cnt == 0 && i < len && i > 0 && + (len - 1 - i) == nfsrv_dnsnamelen && + !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { + len -= (nfsrv_dnsnamelen + 1); + *(cp - 1) = '\0'; + } + + /* + * Check for the special case of "nogroup". + */ + if (len == 7 && !NFSBCMP(str, "nogroup", 7)) { + *gidp = nfsrv_defaultgid; error = 0; goto out; } + + hp = NFSGROUPNAMEHASH(str, len); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_namehash) { + if (usrp->lug_namelen == len && + !NFSBCMP(usrp->lug_name, str, len)) { + if (usrp->lug_expiry < NFSD_MONOSEC) + break; + hp2 = NFSGROUPHASH(usrp->lug_gid); + mtx_lock(&hp2->mtx); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp2->lughead, usrp, + lug_numhash); + *gidp = usrp->lug_gid; + mtx_unlock(&hp2->mtx); + mtx_unlock(&hp->mtx); + error = 0; + goto out; + } + } + mtx_unlock(&hp->mtx); + cnt++; + ret = nfsrv_getuser(RPCNFSUSERD_GETGROUP, (uid_t)0, (gid_t)0, + str, p); + if (ret == 0 && cnt < 2) + goto tryagain; } - NFSUNLOCKNAMEID(); - cnt++; - ret = nfsrv_getuser(RPCNFSUSERD_GETGROUP, (uid_t)0, (gid_t)0, - str, p); - if (ret == 0 && cnt < 2) - goto tryagain; error = NFSERR_BADOWNER; out: @@ -3094,111 +3158,218 @@ APPLESTATIC int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; - struct nfsuserhashhead *hp; - int i; + struct nfsrv_lughash *hp_name, *hp_idnum, *thp; + int i, group_locked, groupname_locked, user_locked, username_locked; int error = 0; u_char *cp; + gid_t *grps; + struct ucred *cr; + static int onethread = 0; + static time_t lasttime = 0; if (nidp->nid_flag & NFSID_INITIALIZE) { - cp = (u_char *)malloc(nidp->nid_namelen + 1, - M_NFSSTRING, M_WAITOK); - error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp, - nidp->nid_namelen); - NFSLOCKNAMEID(); - if (nfsrv_dnsname) { + cp = malloc(nidp->nid_namelen + 1, M_NFSSTRING, M_WAITOK); + error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp, + nidp->nid_namelen); + if (error != 0) { + free(cp, M_NFSSTRING); + goto out; + } + if (atomic_cmpset_acq_int(&nfsrv_dnsnamelen, 0, 0) == 0) { + /* + * Free up all the old stuff and reinitialize hash + * lists. All mutexes for both lists must be locked, + * with the user/group name ones before the uid/gid + * ones, to avoid a LOR. + */ + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsusernamehash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsuserhash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_FOREACH_SAFE(usrp, + &nfsuserhash[i].lughead, lug_numhash, nusrp) + nfsrv_removeuser(usrp, 1); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsuserhash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsusernamehash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgroupnamehash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgrouphash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_FOREACH_SAFE(usrp, + &nfsgrouphash[i].lughead, lug_numhash, + nusrp) + nfsrv_removeuser(usrp, 0); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgrouphash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgroupnamehash[i].mtx); + free(nfsrv_dnsname, M_NFSSTRING); + nfsrv_dnsname = NULL; + } + if (nfsuserhash == NULL) { + /* Allocate the hash tables. */ + nfsuserhash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsuserhash[i].mtx, "nfsuidhash", + NULL, MTX_DEF | MTX_DUPOK); + nfsusernamehash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsusernamehash[i].mtx, + "nfsusrhash", NULL, MTX_DEF | + MTX_DUPOK); + nfsgrouphash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsgrouphash[i].mtx, "nfsgidhash", + NULL, MTX_DEF | MTX_DUPOK); + nfsgroupnamehash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsgroupnamehash[i].mtx, + "nfsgrphash", NULL, MTX_DEF | MTX_DUPOK); + } + /* (Re)initialize the list heads. */ + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsuserhash[i].lughead); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsusernamehash[i].lughead); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsgrouphash[i].lughead); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsgroupnamehash[i].lughead); + /* - * Free up all the old stuff and reinitialize hash lists. + * Put name in "DNS" string. */ - TAILQ_FOREACH_SAFE(usrp, &nfsuserlruhead, lug_lru, nusrp) { - nfsrv_removeuser(usrp); - } - free(nfsrv_dnsname, M_NFSSTRING); - nfsrv_dnsname = NULL; - } - TAILQ_INIT(&nfsuserlruhead); - for (i = 0; i < NFSUSERHASHSIZE; i++) - LIST_INIT(&nfsuserhash[i]); - for (i = 0; i < NFSGROUPHASHSIZE; i++) - LIST_INIT(&nfsgrouphash[i]); - for (i = 0; i < NFSUSERHASHSIZE; i++) - LIST_INIT(&nfsusernamehash[i]); - for (i = 0; i < NFSGROUPHASHSIZE; i++) - LIST_INIT(&nfsgroupnamehash[i]); - - /* - * Put name in "DNS" string. - */ - if (!error) { nfsrv_dnsname = cp; - nfsrv_dnsnamelen = nidp->nid_namelen; nfsrv_defaultuid = nidp->nid_uid; nfsrv_defaultgid = nidp->nid_gid; nfsrv_usercnt = 0; nfsrv_usermax = nidp->nid_usermax; - } - NFSUNLOCKNAMEID(); - if (error) - free(cp, M_NFSSTRING); - goto out; + atomic_store_rel_int(&nfsrv_dnsnamelen, nidp->nid_namelen); + goto out; } /* * malloc the new one now, so any potential sleep occurs before * manipulation of the lists. */ - MALLOC(newusrp, struct nfsusrgrp *, sizeof (struct nfsusrgrp) + - nidp->nid_namelen, M_NFSUSERGROUP, M_WAITOK); + newusrp = malloc(sizeof(struct nfsusrgrp) + nidp->nid_namelen, + M_NFSUSERGROUP, M_WAITOK | M_ZERO); error = copyin(CAST_USER_ADDR_T(nidp->nid_name), newusrp->lug_name, nidp->nid_namelen); + if (error == 0 && nidp->nid_ngroup > 0 && + (nidp->nid_flag & NFSID_ADDUID) != 0) { + grps = malloc(sizeof(gid_t) * nidp->nid_ngroup, M_TEMP, + M_WAITOK); + error = copyin(CAST_USER_ADDR_T(nidp->nid_grps), grps, + sizeof(gid_t) * nidp->nid_ngroup); + if (error == 0) { + /* + * Create a credential just like svc_getcred(), + * but using the group list provided. + */ + cr = crget(); + cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; + crsetgroups(cr, nidp->nid_ngroup, grps); + cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; + cr->cr_prison = &prison0; + prison_hold(cr->cr_prison); +#ifdef MAC + mac_cred_associate_nfsd(cr); +#endif + newusrp->lug_cred = cr; + } + free(grps, M_TEMP); + } if (error) { - free((caddr_t)newusrp, M_NFSUSERGROUP); + free(newusrp, M_NFSUSERGROUP); goto out; } newusrp->lug_namelen = nidp->nid_namelen; - NFSLOCKNAMEID(); + /* + * The lock order is username[0]->[nfsrv_lughashsize - 1] followed + * by uid[0]->[nfsrv_lughashsize - 1], with the same for group. + * The flags user_locked, username_locked, group_locked and + * groupname_locked are set to indicate all of those hash lists are + * locked. hp_name != NULL and hp_idnum != NULL indicates that + * the respective one mutex is locked. + */ + user_locked = username_locked = group_locked = groupname_locked = 0; + hp_name = hp_idnum = NULL; + /* * Delete old entries, as required. */ if (nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID)) { - hp = NFSUSERHASH(nidp->nid_uid); - LIST_FOREACH_SAFE(usrp, hp, lug_numhash, nusrp) { + /* Must lock all username hash lists first, to avoid a LOR. */ + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsusernamehash[i].mtx); + username_locked = 1; + hp_idnum = NFSUSERHASH(nidp->nid_uid); + mtx_lock(&hp_idnum->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_idnum->lughead, lug_numhash, + nusrp) { if (usrp->lug_uid == nidp->nid_uid) - nfsrv_removeuser(usrp); + nfsrv_removeuser(usrp, 1); } - } - if (nidp->nid_flag & (NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) { - hp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); - LIST_FOREACH_SAFE(usrp, hp, lug_namehash, nusrp) { + } else if (nidp->nid_flag & (NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) { + hp_name = NFSUSERNAMEHASH(newusrp->lug_name, + newusrp->lug_namelen); + mtx_lock(&hp_name->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_name->lughead, lug_namehash, + nusrp) { if (usrp->lug_namelen == newusrp->lug_namelen && !NFSBCMP(usrp->lug_name, newusrp->lug_name, - usrp->lug_namelen)) - nfsrv_removeuser(usrp); - } - } - if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) { - hp = NFSGROUPHASH(nidp->nid_gid); - LIST_FOREACH_SAFE(usrp, hp, lug_numhash, nusrp) { + usrp->lug_namelen)) { + thp = NFSUSERHASH(usrp->lug_uid); + mtx_lock(&thp->mtx); + nfsrv_removeuser(usrp, 1); + mtx_unlock(&thp->mtx); + } + } + hp_idnum = NFSUSERHASH(nidp->nid_uid); + mtx_lock(&hp_idnum->mtx); + } else if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) { + /* Must lock all groupname hash lists first, to avoid a LOR. */ + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgroupnamehash[i].mtx); + groupname_locked = 1; + hp_idnum = NFSGROUPHASH(nidp->nid_gid); + mtx_lock(&hp_idnum->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_idnum->lughead, lug_numhash, + nusrp) { if (usrp->lug_gid == nidp->nid_gid) - nfsrv_removeuser(usrp); + nfsrv_removeuser(usrp, 0); } - } - if (nidp->nid_flag & (NFSID_DELGROUPNAME | NFSID_ADDGROUPNAME)) { - hp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); - LIST_FOREACH_SAFE(usrp, hp, lug_namehash, nusrp) { + } else if (nidp->nid_flag & (NFSID_DELGROUPNAME | NFSID_ADDGROUPNAME)) { + hp_name = NFSGROUPNAMEHASH(newusrp->lug_name, + newusrp->lug_namelen); + mtx_lock(&hp_name->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_name->lughead, lug_namehash, + nusrp) { if (usrp->lug_namelen == newusrp->lug_namelen && !NFSBCMP(usrp->lug_name, newusrp->lug_name, - usrp->lug_namelen)) - nfsrv_removeuser(usrp); + usrp->lug_namelen)) { + thp = NFSGROUPHASH(usrp->lug_gid); + mtx_lock(&thp->mtx); + nfsrv_removeuser(usrp, 0); + mtx_unlock(&thp->mtx); + } } - } - TAILQ_FOREACH_SAFE(usrp, &nfsuserlruhead, lug_lru, nusrp) { - if (usrp->lug_expiry < NFSD_MONOSEC) - nfsrv_removeuser(usrp); - } - while (nfsrv_usercnt >= nfsrv_usermax) { - usrp = TAILQ_FIRST(&nfsuserlruhead); - nfsrv_removeuser(usrp); + hp_idnum = NFSGROUPHASH(nidp->nid_gid); + mtx_lock(&hp_idnum->mtx); } /* @@ -3210,23 +3381,129 @@ nfssvc_idname(struct nfsd_idargs *nidp) newusrp->lug_expiry = NFSD_MONOSEC + 5; if (nidp->nid_flag & (NFSID_ADDUID | NFSID_ADDUSERNAME)) { newusrp->lug_uid = nidp->nid_uid; - LIST_INSERT_HEAD(NFSUSERHASH(newusrp->lug_uid), newusrp, - lug_numhash); - LIST_INSERT_HEAD(NFSUSERNAMEHASH(newusrp->lug_name, - newusrp->lug_namelen), newusrp, lug_namehash); - TAILQ_INSERT_TAIL(&nfsuserlruhead, newusrp, lug_lru); - nfsrv_usercnt++; + thp = NFSUSERHASH(newusrp->lug_uid); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_numhash); + thp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash); + atomic_add_int(&nfsrv_usercnt, 1); } else if (nidp->nid_flag & (NFSID_ADDGID | NFSID_ADDGROUPNAME)) { newusrp->lug_gid = nidp->nid_gid; - LIST_INSERT_HEAD(NFSGROUPHASH(newusrp->lug_gid), newusrp, - lug_numhash); - LIST_INSERT_HEAD(NFSGROUPNAMEHASH(newusrp->lug_name, - newusrp->lug_namelen), newusrp, lug_namehash); - TAILQ_INSERT_TAIL(&nfsuserlruhead, newusrp, lug_lru); - nfsrv_usercnt++; - } else - FREE((caddr_t)newusrp, M_NFSUSERGROUP); - NFSUNLOCKNAMEID(); + thp = NFSGROUPHASH(newusrp->lug_gid); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_numhash); + thp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash); + atomic_add_int(&nfsrv_usercnt, 1); + } else { + if (newusrp->lug_cred != NULL) + crfree(newusrp->lug_cred); + free(newusrp, M_NFSUSERGROUP); + } + + /* + * Once per second, allow one thread to trim the cache. + */ + if (lasttime < NFSD_MONOSEC && + atomic_cmpset_acq_int(&onethread, 0, 1) != 0) { + /* + * First, unlock the single mutexes, so that all entries + * can be locked and any LOR is avoided. + */ + if (hp_name != NULL) { + mtx_unlock(&hp_name->mtx); + hp_name = NULL; + } + if (hp_idnum != NULL) { + mtx_unlock(&hp_idnum->mtx); + hp_idnum = NULL; + } + + if ((nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID | + NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) != 0) { + if (username_locked == 0) { + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsusernamehash[i].mtx); + username_locked = 1; + } + KASSERT(user_locked == 0, + ("nfssvc_idname: user_locked")); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsuserhash[i].mtx); + user_locked = 1; + for (i = 0; i < nfsrv_lughashsize; i++) { + TAILQ_FOREACH_SAFE(usrp, + &nfsuserhash[i].lughead, lug_numhash, + nusrp) + if (usrp->lug_expiry < NFSD_MONOSEC) + nfsrv_removeuser(usrp, 1); + } + for (i = 0; i < nfsrv_lughashsize; i++) { + /* + * Trim the cache using an approximate LRU + * algorithm. This code deletes the least + * recently used entry on each hash list. + */ + if (nfsrv_usercnt <= nfsrv_usermax) + break; + usrp = TAILQ_FIRST(&nfsuserhash[i].lughead); + if (usrp != NULL) + nfsrv_removeuser(usrp, 1); + } + } else { + if (groupname_locked == 0) { + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgroupnamehash[i].mtx); + groupname_locked = 1; + } + KASSERT(group_locked == 0, + ("nfssvc_idname: group_locked")); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgrouphash[i].mtx); + group_locked = 1; + for (i = 0; i < nfsrv_lughashsize; i++) { + TAILQ_FOREACH_SAFE(usrp, + &nfsgrouphash[i].lughead, lug_numhash, + nusrp) + if (usrp->lug_expiry < NFSD_MONOSEC) + nfsrv_removeuser(usrp, 0); + } + for (i = 0; i < nfsrv_lughashsize; i++) { + /* + * Trim the cache using an approximate LRU + * algorithm. This code deletes the least + * recently user entry on each hash list. + */ + if (nfsrv_usercnt <= nfsrv_usermax) + break; + usrp = TAILQ_FIRST(&nfsgrouphash[i].lughead); + if (usrp != NULL) + nfsrv_removeuser(usrp, 0); + } + } + lasttime = NFSD_MONOSEC; + atomic_store_rel_int(&onethread, 0); + } + + /* Now, unlock all locked mutexes. */ + if (hp_idnum != NULL) + mtx_unlock(&hp_idnum->mtx); + if (hp_name != NULL) + mtx_unlock(&hp_name->mtx); + if (user_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsuserhash[i].mtx); + if (username_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsusernamehash[i].mtx); + if (group_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgrouphash[i].mtx); + if (groupname_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgroupnamehash[i].mtx); out: NFSEXITCODE(error); return (error); @@ -3236,15 +3513,29 @@ out: * Remove a user/group name element. */ static void -nfsrv_removeuser(struct nfsusrgrp *usrp) +nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) { + struct nfsrv_lughash *hp; - NFSNAMEIDREQUIRED(); - LIST_REMOVE(usrp, lug_numhash); - LIST_REMOVE(usrp, lug_namehash); - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - nfsrv_usercnt--; - FREE((caddr_t)usrp, M_NFSUSERGROUP); + if (isuser != 0) { + hp = NFSUSERHASH(usrp->lug_uid); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp = NFSUSERNAMEHASH(usrp->lug_name, usrp->lug_namelen); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash); + } else { + hp = NFSGROUPHASH(usrp->lug_gid); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp = NFSGROUPNAMEHASH(usrp->lug_name, usrp->lug_namelen); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash); + } + atomic_add_int(&nfsrv_usercnt, -1); + if (usrp->lug_cred != NULL) + crfree(usrp->lug_cred); + free(usrp, M_NFSUSERGROUP); } /* Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs_var.h Mon Dec 14 21:21:43 2015 (r292223) @@ -296,6 +296,7 @@ void nfsv4_setsequence(struct nfsmount * int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *, int *, uint32_t *, uint8_t *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 14 21:30:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA7CCA43BFB; Mon, 14 Dec 2015 21:30:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97A6D1EC7; Mon, 14 Dec 2015 21:30:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBELUSDZ038373; Mon, 14 Dec 2015 21:30:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBELUSJV038371; Mon, 14 Dec 2015 21:30:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142130.tBELUSJV038371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 21:30: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: r292224 - in stable/10: . sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 21:30:29 -0000 Author: rmacklem Date: Mon Dec 14 21:30:28 2015 New Revision: 292224 URL: https://svnweb.freebsd.org/changeset/base/292224 Log: Bump __FreeBSD_version since r292223 changed the internal interface between the nfsd.ko and nfscommon.ko modules such that they need to be upgraded to-gether. Modified: stable/10/UPDATING stable/10/sys/sys/param.h Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 14 21:21:43 2015 (r292223) +++ stable/10/UPDATING Mon Dec 14 21:30:28 2015 (r292224) @@ -16,6 +16,11 @@ 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. +20151214: + r292223 changed the internal interface between the nfsd.ko and + nfscommon.ko modules. As such, they must both be upgraded to-gether. + __FreeBSD_version has been bumped because of this. + 20151113: Qlogic 24xx/25xx firmware images were updated from 5.5.0 to 7.3.0. Kernel modules isp_2400_multi and isp_2500_multi were removed and Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Mon Dec 14 21:21:43 2015 (r292223) +++ stable/10/sys/sys/param.h Mon Dec 14 21:30:28 2015 (r292224) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1002502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1002503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Dec 14 21:33:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98589A43F77; Mon, 14 Dec 2015 21:33:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697A912F7; Mon, 14 Dec 2015 21:33:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBELXVp1041195; Mon, 14 Dec 2015 21:33:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBELXVJD041194; Mon, 14 Dec 2015 21:33:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142133.tBELXVJD041194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 21:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292225 - stable/10/usr.bin/bmake 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 21:33:32 -0000 Author: bdrewery Date: Mon Dec 14 21:33:31 2015 New Revision: 292225 URL: https://svnweb.freebsd.org/changeset/base/292225 Log: MFC r266566: Add .../share/mk to the default system make path. This will fix the problem with broken in-tree builds (which are used far more pervasively than I'd known outside the tree). However, weird results may now happen if at any point in the tree above you there happens to be a directory that has subdirectory of share/mk, as unpredictable results will follow. This was considered the lessor of the two evils, at least for now. In the future this will be removed again when the underlying issues are resolved. For MFCing, this is to ensure that when upgrading to head the share/mk in-tree is always used. Otherwise several build features will not work. This passes a build using head's bmake which has this as the default already. Relnotes: yes Modified: stable/10/usr.bin/bmake/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bmake/Makefile ============================================================================== --- stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:30:28 2015 (r292224) +++ stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:33:31 2015 (r292225) @@ -167,7 +167,6 @@ accept test: # override some simple things BINDIR= /usr/bin MANDIR= /usr/share/man/man -DEFAULT_SYS_PATH= /usr/share/mk # make sure we get this CFLAGS+= ${COPTS.${.IMPSRC:T}} From owner-svn-src-all@freebsd.org Mon Dec 14 22:00:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7318BA478BB; Mon, 14 Dec 2015 22:00:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 366A013AE; Mon, 14 Dec 2015 22:00:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEM073B049373; Mon, 14 Dec 2015 22:00:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEM07rP049371; Mon, 14 Dec 2015 22:00:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512142200.tBEM07rP049371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 14 Dec 2015 22:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292226 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:00:08 -0000 Author: cem Date: Mon Dec 14 22:00:07 2015 New Revision: 292226 URL: https://svnweb.freebsd.org/changeset/base/292226 Log: ioat(4): Gather and expose DMA statistics via sysctl Organize the dev.ioat sysctl node into a tree while we're here. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Dec 14 21:33:31 2015 (r292225) +++ head/sys/dev/ioat/ioat.c Mon Dec 14 22:00:07 2015 (r292226) @@ -588,6 +588,7 @@ ioat_interrupt_handler(void *arg) { struct ioat_softc *ioat = arg; + ioat->stats.interrupts++; ioat_process_events(ioat); } @@ -649,6 +650,8 @@ ioat_process_events(struct ioat_softc *i ioat_timer_callback, ioat); } + ioat->stats.descriptors_processed += completed; + out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); mtx_unlock(&ioat->cleanup_lock); @@ -659,6 +662,8 @@ out: if (!is_ioat_halted(comp_update)) return; + ioat->stats.channel_halts++; + /* * Fatal programming error on this DMA channel. Flush any outstanding * work with error status and restart the engine. @@ -670,6 +675,7 @@ out: chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET); ioat_halted_debug(ioat, chanerr); + ioat->stats.last_halt_chanerr = chanerr; while (ioat_get_active(ioat) > 0) { desc = ioat_get_ring_entry(ioat, ioat->tail); @@ -682,6 +688,8 @@ out: ioat_putn_locked(ioat, 1, IOAT_ACTIVE_DESCR_REF); ioat->tail++; + ioat->stats.descriptors_processed++; + ioat->stats.descriptors_error++; } /* Clear error status */ @@ -1363,6 +1371,8 @@ ioat_submit_single(struct ioat_softc *io callout_reset(&ioat->timer, IOAT_INTR_TIMO, ioat_timer_callback, ioat); } + + ioat->stats.descriptors_submitted++; } static int @@ -1518,6 +1528,36 @@ sysctl_handle_chansts(SYSCTL_HANDLER_ARG } static int +sysctl_handle_dpi(SYSCTL_HANDLER_ARGS) +{ + struct ioat_softc *ioat; + struct sbuf sb; +#define PRECISION "1" + const uintmax_t factor = 10; + uintmax_t rate; + int error; + + ioat = arg1; + sbuf_new_for_sysctl(&sb, NULL, 16, req); + + if (ioat->stats.interrupts == 0) { + sbuf_printf(&sb, "NaN"); + goto out; + } + rate = ioat->stats.descriptors_processed * factor / + ioat->stats.interrupts; + sbuf_printf(&sb, "%ju.%." PRECISION "ju", rate / factor, + rate % factor); +#undef PRECISION +out: + error = sbuf_finish(&sb); + sbuf_delete(&sb); + if (error != 0 || req->newptr == NULL) + return (error); + return (EINVAL); +} + +static int sysctl_handle_error(SYSCTL_HANDLER_ARGS) { struct ioat_descriptor *desc; @@ -1587,9 +1627,9 @@ dump_descriptor(void *hw_desc) static void ioat_setup_sysctl(device_t device) { - struct sysctl_oid_list *par; + struct sysctl_oid_list *par, *statpar, *state, *hammer; struct sysctl_ctx_list *ctx; - struct sysctl_oid *tree; + struct sysctl_oid *tree, *tmp; struct ioat_softc *ioat; ioat = DEVICE2SOFTC(device); @@ -1602,36 +1642,72 @@ ioat_setup_sysctl(device_t device) SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "max_xfer_size", CTLFLAG_RD, &ioat->max_xfer_size, 0, "HW maximum transfer size"); - SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "ring_size_order", CTLFLAG_RD, + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "state", CTLFLAG_RD, NULL, + "IOAT channel internal state"); + state = SYSCTL_CHILDREN(tmp); + + SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "ring_size_order", CTLFLAG_RD, &ioat->ring_size_order, 0, "SW descriptor ring size order"); - SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "head", CTLFLAG_RD, &ioat->head, 0, - "SW descriptor head pointer index"); - SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "tail", CTLFLAG_RD, &ioat->tail, 0, - "SW descriptor tail pointer index"); - SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "hw_head", CTLFLAG_RD, + SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "head", CTLFLAG_RD, &ioat->head, + 0, "SW descriptor head pointer index"); + SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "tail", CTLFLAG_RD, &ioat->tail, + 0, "SW descriptor tail pointer index"); + SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "hw_head", CTLFLAG_RD, &ioat->hw_head, 0, "HW DMACOUNT"); - SYSCTL_ADD_UQUAD(ctx, par, OID_AUTO, "last_completion", CTLFLAG_RD, + SYSCTL_ADD_UQUAD(ctx, state, OID_AUTO, "last_completion", CTLFLAG_RD, ioat->comp_update, "HW addr of last completion"); - SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_resize_pending", CTLFLAG_RD, + SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_resize_pending", CTLFLAG_RD, &ioat->is_resize_pending, 0, "resize pending"); - SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_completion_pending", CTLFLAG_RD, - &ioat->is_completion_pending, 0, "completion pending"); - SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_reset_pending", CTLFLAG_RD, + SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_completion_pending", + CTLFLAG_RD, &ioat->is_completion_pending, 0, "completion pending"); + SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_reset_pending", CTLFLAG_RD, &ioat->is_reset_pending, 0, "reset pending"); - SYSCTL_ADD_INT(ctx, par, OID_AUTO, "is_channel_running", CTLFLAG_RD, + SYSCTL_ADD_INT(ctx, state, OID_AUTO, "is_channel_running", CTLFLAG_RD, &ioat->is_channel_running, 0, "channel running"); - SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "force_hw_reset", + SYSCTL_ADD_PROC(ctx, state, OID_AUTO, "chansts", + CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", + "String of the channel status"); + + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "hammer", CTLFLAG_RD, NULL, + "Big hammers (mostly for testing)"); + hammer = SYSCTL_CHILDREN(tmp); + + SYSCTL_ADD_PROC(ctx, hammer, OID_AUTO, "force_hw_reset", CTLTYPE_INT | CTLFLAG_RW, ioat, 0, sysctl_handle_reset, "I", "Set to non-zero to reset the hardware"); - SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "force_hw_error", + SYSCTL_ADD_PROC(ctx, hammer, OID_AUTO, "force_hw_error", CTLTYPE_INT | CTLFLAG_RW, ioat, 0, sysctl_handle_error, "I", "Set to non-zero to inject a recoverable hardware error"); - SYSCTL_ADD_PROC(ctx, par, OID_AUTO, "chansts", - CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", - "String of the channel status"); + + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "stats", CTLFLAG_RD, NULL, + "IOAT channel statistics"); + statpar = SYSCTL_CHILDREN(tmp); + + SYSCTL_ADD_UQUAD(ctx, statpar, OID_AUTO, "interrupts", CTLFLAG_RW, + &ioat->stats.interrupts, + "Number of interrupts processed on this channel"); + SYSCTL_ADD_UQUAD(ctx, statpar, OID_AUTO, "descriptors", CTLFLAG_RW, + &ioat->stats.descriptors_processed, + "Number of descriptors processed on this channel"); + SYSCTL_ADD_UQUAD(ctx, statpar, OID_AUTO, "submitted", CTLFLAG_RW, + &ioat->stats.descriptors_submitted, + "Number of descriptors submitted to this channel"); + SYSCTL_ADD_UQUAD(ctx, statpar, OID_AUTO, "errored", CTLFLAG_RW, + &ioat->stats.descriptors_error, + "Number of descriptors failed by channel errors"); + SYSCTL_ADD_U32(ctx, statpar, OID_AUTO, "halts", CTLFLAG_RW, + &ioat->stats.channel_halts, 0, + "Number of times the channel has halted"); + SYSCTL_ADD_U32(ctx, statpar, OID_AUTO, "last_halt_chanerr", CTLFLAG_RW, + &ioat->stats.last_halt_chanerr, 0, + "The raw CHANERR when the channel was last halted"); + + SYSCTL_ADD_PROC(ctx, statpar, OID_AUTO, "desc_per_interrupt", + CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_dpi, "A", + "Descriptors per interrupt"); } static inline struct ioat_softc * Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Mon Dec 14 21:33:31 2015 (r292225) +++ head/sys/dev/ioat/ioat_internal.h Mon Dec 14 22:00:07 2015 (r292226) @@ -407,6 +407,16 @@ struct ioat_softc { #ifdef INVARIANTS volatile uint32_t refkinds[IOAT_NUM_REF_KINDS]; #endif + + struct { + uint64_t interrupts; + uint64_t descriptors_processed; + uint64_t descriptors_error; + uint64_t descriptors_submitted; + + uint32_t channel_halts; + uint32_t last_halt_chanerr; + } stats; }; void ioat_test_attach(void); From owner-svn-src-all@freebsd.org Mon Dec 14 22:00:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92804A47947; Mon, 14 Dec 2015 22:00:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C90A15BF; Mon, 14 Dec 2015 22:00:47 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEM0k5V049487; Mon, 14 Dec 2015 22:00:46 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEM0kjP049486; Mon, 14 Dec 2015 22:00:46 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512142200.tBEM0kjP049486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 14 Dec 2015 22:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292227 - head/sys/boot/uboot/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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:00:47 -0000 Author: ian Date: Mon Dec 14 22:00:46 2015 New Revision: 292227 URL: https://svnweb.freebsd.org/changeset/base/292227 Log: Enhance the "ubenv import" command to allow importing a u-boot env var directly into a loader (and thus kernel) env var, using the syntax ubenv import ldvarname=ubvarname Without the varname= prefix it uses the historical behavior of importing to the name uboot.ubvarname. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Mon Dec 14 22:00:07 2015 (r292226) +++ head/sys/boot/uboot/common/main.c Mon Dec 14 22:00:46 2015 (r292227) @@ -573,17 +573,41 @@ enum ubenv_action { static void handle_uboot_env_var(enum ubenv_action action, const char * var) { - const char * val; - char ubv[128]; + char ldvar[128]; + const char *val; + char *wrk; + int len; + + /* + * On an import with the variable name formatted as ldname=ubname, + * import the uboot variable ubname into the loader variable ldname, + * otherwise the historical behavior is to import to uboot.ubname. + */ + if (action == UBENV_IMPORT) { + len = strcspn(var, "="); + if (var[len] == 0) { + strcpy(ldvar, "uboot."); + strncat(ldvar, var, sizeof(ldvar) - 7); + } else { + len = MIN(len, sizeof(ldvar) - 1); + strncpy(ldvar, var, len); + ldvar[len] = 0; + var = &var[len + 1]; + } + } /* * If the user prepended "uboot." (which is how they usually see these * names) strip it off as a convenience. */ if (strncmp(var, "uboot.", 6) == 0) { - snprintf(ubv, sizeof(ubv), "%s", &var[6]); - var = ubv; + var = &var[6]; } + + /* If ldvar is malformed or there's no variable name left, punt. */ + if (ldvar[0] == 0 || var[0] == 0) + return; + val = ub_env_get(var); if (action == UBENV_SHOW) { if (val == NULL) @@ -592,8 +616,7 @@ handle_uboot_env_var(enum ubenv_action a printf("uboot.%s=%s\n", var, val); } else if (action == UBENV_IMPORT) { if (val != NULL) { - snprintf(ubv, sizeof(ubv), "uboot.%s", var); - setenv(ubv, val, 1); + setenv(ldvar, val, 1); } } } From owner-svn-src-all@freebsd.org Mon Dec 14 22:01:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D32A47E28; Mon, 14 Dec 2015 22:01:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3E6B1A3E; Mon, 14 Dec 2015 22:01:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEM1qhK049656; Mon, 14 Dec 2015 22:01:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEM1qrY049650; Mon, 14 Dec 2015 22:01:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512142201.tBEM1qrY049650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 14 Dec 2015 22:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292228 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:01:54 -0000 Author: cem Date: Mon Dec 14 22:01:52 2015 New Revision: 292228 URL: https://svnweb.freebsd.org/changeset/base/292228 Log: ioat(4): Add support for interrupt coalescing In I/OAT, this is done through the INTRDELAY register. On supported platforms, this register can coalesce interrupts in a set period to avoid excessive interrupt load for small descriptor workflows. The period is configurable anywhere from 1 microsecond to 16.38 milliseconds, in microsecond granularity. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_hw.h head/sys/dev/ioat/ioat_internal.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Mon Dec 14 22:00:46 2015 (r292227) +++ head/share/man/man4/ioat.4 Mon Dec 14 22:01:52 2015 (r292228) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2015 +.Dd December 14, 2015 .Dt IOAT 4 .Os .Sh NAME @@ -63,6 +63,10 @@ In .Fn ioat_get_dmaengine "uint32_t channel_index" .Ft void .Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine" +.Ft int +.Fn ioat_set_interrupt_coalesce "bus_dmaengine_t dmaengine" "uint16_t delay" +.Ft uint16_t +.Fn ioat_get_max_coalesce_period "bus_dmaengine_t dmaengine" .Ft void .Fn ioat_acquire "bus_dmaengine_t dmaengine" .Ft void @@ -129,6 +133,20 @@ flag. For example, a user might submit multiple operations to the same channel and only enable an interrupt and callback for the last operation. .Pp +The hardware can delay and coalesce interrupts on a given channel for a +configurable period of time, in microseconds. +This may be desired to reduce the processing and interrupt overhead per +descriptor, especially for workflows consisting of many small operations. +Software can control this on a per-channel basis with the +.Fn ioat_set_interrupt_coalesce +API. +The +.Fn ioat_get_max_coalesce_period +API can be used to determine the maximum coalescing period supported by the +hardware, in microseconds. +Current platforms support up to a 16.383 millisecond coalescing period. +Optimal configuration will vary by workflow and desired operation latency. +.Pp All operations are safe to use in a non-blocking context with the .Ar DMA_NO_WAIT flag. Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Dec 14 22:00:46 2015 (r292227) +++ head/sys/dev/ioat/ioat.c Mon Dec 14 22:01:52 2015 (r292228) @@ -404,6 +404,11 @@ ioat3_attach(device_t device) xfercap = ioat_read_xfercap(ioat); ioat->max_xfer_size = 1 << xfercap; + ioat->intrdelay_supported = (ioat_read_2(ioat, IOAT_INTRDELAY_OFFSET) & + IOAT_INTRDELAY_SUPPORTED) != 0; + if (ioat->intrdelay_supported) + ioat->intrdelay_max = IOAT_INTRDELAY_US_MASK; + /* TODO: need to check DCA here if we ever do XOR/PQ */ mtx_init(&ioat->submit_lock, "ioat_submit", NULL, MTX_DEF); @@ -730,6 +735,32 @@ ioat_put_dmaengine(bus_dmaengine_t dmaen ioat_put(ioat, IOAT_DMAENGINE_REF); } +int +ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + if (!ioat->intrdelay_supported) + return (ENODEV); + if (delay > ioat->intrdelay_max) + return (ERANGE); + + ioat_write_2(ioat, IOAT_INTRDELAY_OFFSET, delay); + ioat->cached_intrdelay = + ioat_read_2(ioat, IOAT_INTRDELAY_OFFSET) & IOAT_INTRDELAY_US_MASK; + return (0); +} + +uint16_t +ioat_get_max_coalesce_period(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (ioat->intrdelay_max); +} + void ioat_acquire(bus_dmaengine_t dmaengine) { @@ -1641,6 +1672,11 @@ ioat_setup_sysctl(device_t device) &ioat->version, 0, "HW version (0xMM form)"); SYSCTL_ADD_UINT(ctx, par, OID_AUTO, "max_xfer_size", CTLFLAG_RD, &ioat->max_xfer_size, 0, "HW maximum transfer size"); + SYSCTL_ADD_INT(ctx, par, OID_AUTO, "intrdelay_supported", CTLFLAG_RD, + &ioat->intrdelay_supported, 0, "Is INTRDELAY supported"); + SYSCTL_ADD_U16(ctx, par, OID_AUTO, "intrdelay_max", CTLFLAG_RD, + &ioat->intrdelay_max, 0, + "Maximum configurable INTRDELAY on this channel (microseconds)"); tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "state", CTLFLAG_RD, NULL, "IOAT channel internal state"); @@ -1671,6 +1707,10 @@ ioat_setup_sysctl(device_t device) CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", "String of the channel status"); + SYSCTL_ADD_U16(ctx, state, OID_AUTO, "intrdelay", CTLFLAG_RD, + &ioat->cached_intrdelay, 0, + "Current INTRDELAY on this channel (cached, microseconds)"); + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "hammer", CTLFLAG_RD, NULL, "Big hammers (mostly for testing)"); hammer = SYSCTL_CHILDREN(tmp); Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Mon Dec 14 22:00:46 2015 (r292227) +++ head/sys/dev/ioat/ioat.h Mon Dec 14 22:01:52 2015 (r292228) @@ -61,6 +61,28 @@ bus_dmaengine_t ioat_get_dmaengine(uint3 void ioat_put_dmaengine(bus_dmaengine_t dmaengine); /* + * Set interrupt coalescing on a DMA channel. + * + * The argument is in microseconds. A zero value disables coalescing. Any + * other value delays interrupt generation for N microseconds to provide + * opportunity to coalesce multiple operations into a single interrupt. + * + * Returns an error status, or zero on success. + * + * - ERANGE if the given value exceeds the delay supported by the hardware. + * (All current hardware supports a maximum of 0x3fff microseconds delay.) + * - ENODEV if the hardware does not support interrupt coalescing. + */ +int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay); + +/* + * Return the maximum supported coalescing period, for use in + * ioat_set_interrupt_coalesce(). If the hardware does not support coalescing, + * returns zero. + */ +uint16_t ioat_get_max_coalesce_period(bus_dmaengine_t dmaengine); + +/* * Acquire must be called before issuing an operation to perform. Release is * called after. Multiple operations can be issued within the context of one * acquire and release Modified: head/sys/dev/ioat/ioat_hw.h ============================================================================== --- head/sys/dev/ioat/ioat_hw.h Mon Dec 14 22:00:46 2015 (r292227) +++ head/sys/dev/ioat/ioat_hw.h Mon Dec 14 22:01:52 2015 (r292228) @@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$"); #define IOAT_VER_3_3 0x33 #define IOAT_INTRDELAY_OFFSET 0x0C +#define IOAT_INTRDELAY_SUPPORTED (1 << 15) +/* Reserved. (1 << 14) */ +/* [13:0] is the coalesce period, in microseconds. */ +#define IOAT_INTRDELAY_US_MASK ((1 << 14) - 1) #define IOAT_CS_STATUS_OFFSET 0x0E Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Mon Dec 14 22:00:46 2015 (r292227) +++ head/sys/dev/ioat/ioat_internal.h Mon Dec 14 22:01:52 2015 (r292228) @@ -373,6 +373,8 @@ struct ioat_softc { struct resource *pci_resource; uint32_t max_xfer_size; uint32_t capabilities; + uint16_t intrdelay_max; + uint16_t cached_intrdelay; struct resource *res; int rid; @@ -393,6 +395,7 @@ struct ioat_softc { boolean_t is_completion_pending; boolean_t is_reset_pending; boolean_t is_channel_running; + boolean_t intrdelay_supported; uint32_t head; uint32_t tail; From owner-svn-src-all@freebsd.org Mon Dec 14 22:02:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2083FA47E5D; Mon, 14 Dec 2015 22:02:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D66251BD0; Mon, 14 Dec 2015 22:02:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEM21d5050027; Mon, 14 Dec 2015 22:02:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEM21Hg050022; Mon, 14 Dec 2015 22:02:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512142202.tBEM21Hg050022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 14 Dec 2015 22:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292229 - in head: sys/dev/ioat tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:02:03 -0000 Author: cem Date: Mon Dec 14 22:02:01 2015 New Revision: 292229 URL: https://svnweb.freebsd.org/changeset/base/292229 Log: ioatcontrol(8): Add support for interrupt coalescing The new flag, -c , sets the interrupt coalescing period in microseconds through the new ioat(4) API ioat_set_interrupt_coalesce(). Also add a -z flag to zero ioat statistics before tests, to make it easy to measure results. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_test.c head/sys/dev/ioat/ioat_test.h head/tools/tools/ioat/ioatcontrol.8 head/tools/tools/ioat/ioatcontrol.c Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Mon Dec 14 22:01:52 2015 (r292228) +++ head/sys/dev/ioat/ioat_test.c Mon Dec 14 22:02:01 2015 (r292229) @@ -337,10 +337,11 @@ ioat_test_submit_1_tx(struct ioat_test * static void ioat_dma_test(void *arg) { + struct ioat_softc *ioat; struct ioat_test *test; bus_dmaengine_t dmaengine; uint32_t loops; - int index, rc, start, end; + int index, rc, start, end, error; test = arg; memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status)); @@ -393,9 +394,10 @@ ioat_dma_test(void *arg) test->status[IOAT_TEST_NO_DMA_ENGINE]++; return; } + ioat = to_ioat_softc(dmaengine); if (test->testkind == IOAT_TEST_FILL && - (to_ioat_softc(dmaengine)->capabilities & IOAT_DMACAP_BFILL) == 0) + (ioat->capabilities & IOAT_DMACAP_BFILL) == 0) { ioat_test_log(0, "Hardware doesn't support block fill, aborting test\n"); @@ -403,6 +405,25 @@ ioat_dma_test(void *arg) goto out; } + if (test->coalesce_period > ioat->intrdelay_max) { + ioat_test_log(0, + "Hardware doesn't support intrdelay of %u us.\n", + (unsigned)test->coalesce_period); + test->status[IOAT_TEST_INVALID_INPUT]++; + goto out; + } + error = ioat_set_interrupt_coalesce(dmaengine, test->coalesce_period); + if (error == ENODEV && test->coalesce_period == 0) + error = 0; + if (error != 0) { + ioat_test_log(0, "ioat_set_interrupt_coalesce: %d\n", error); + test->status[IOAT_TEST_INVALID_INPUT]++; + goto out; + } + + if (test->zero_stats) + memset(&ioat->stats, 0, sizeof(ioat->stats)); + if (test->testkind == IOAT_TEST_RAW_DMA) { if (test->raw_is_virtual) { test->raw_vtarget = (void *)test->raw_target; Modified: head/sys/dev/ioat/ioat_test.h ============================================================================== --- head/sys/dev/ioat/ioat_test.h Mon Dec 14 22:01:52 2015 (r292228) +++ head/sys/dev/ioat/ioat_test.h Mon Dec 14 22:02:01 2015 (r292229) @@ -75,6 +75,10 @@ struct ioat_test { bool raw_write; bool raw_is_virtual; + bool zero_stats; + /* Configure coalesce period */ + uint16_t coalesce_period; + /* Internal usage -- not test inputs */ TAILQ_HEAD(, test_transaction) free_q; TAILQ_HEAD(, test_transaction) pend_q; Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Mon Dec 14 22:01:52 2015 (r292228) +++ head/tools/tools/ioat/ioatcontrol.8 Mon Dec 14 22:02:01 2015 (r292229) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2015 +.Dd December 14, 2015 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -33,10 +33,12 @@ .Xr ioat 4 .Sh SYNOPSIS .Nm +.Op Fl c Ar period .Op Fl E .Op Fl f .Op Fl m .Op Fl V +.Op Fl z .Ar channel_number .Ar num_txns .Ar [ bufsize @@ -44,9 +46,11 @@ .Ar [ duration ] ] ] .Nm .Fl r +.Op Fl c Ar period .Op Fl v .Op Fl V .Op Fl w +.Op Fl z .Ar channel_number .Ar address .Ar [ bufsize ] @@ -57,6 +61,8 @@ allows one to issue some number of test driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds +.It Fl c Ar period +Configure the channel's interrupt coalescing period, in microseconds. .It Fl E Test non-contiguous 8k copy. .It Fl f @@ -67,6 +73,8 @@ tests copy) Test memcpy instead of DMA. .It Fl V Verify copies/fills for accuracy +.It Fl z +Zero device statistics before running test. .El .Pp Alternatively one can use @@ -76,6 +84,8 @@ to issue DMA to or from a specific .Ar address . The arguments in "raw" mode are: .Bl -tag -width Ds +.It Fl c Ar period +As above. .It Fl v .Ar address is a kernel virtual address (by default, @@ -90,6 +100,8 @@ Write to the specified .Nm .Fl r reads) +.It Fl z +As above. .El .Pp .Nm Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Mon Dec 14 22:01:52 2015 (r292228) +++ head/tools/tools/ioat/ioatcontrol.c Mon Dec 14 22:02:01 2015 (r292229) @@ -48,10 +48,14 @@ static void usage(void) { - printf("Usage: %s [-E|-f|-m] [-V] [ " + printf("Usage: %s [-E|-f|-m] OPTIONS [ " "[ [duration]]]\n", getprogname()); - printf(" %s -r [-vV] []\n", + printf(" %s -r [-v] OPTIONS []\n\n", getprogname()); + printf(" OPTIONS:\n"); + printf(" -c - Enable interrupt coalescing (us)\n"); + printf(" -V - Enable verification\n"); + printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -103,8 +107,11 @@ main(int argc, char **argv) fflag = rflag = Eflag = mflag = false; modeflags = 0; - while ((ch = getopt(argc, argv, "EfmrvVw")) != -1) { + while ((ch = getopt(argc, argv, "c:EfmrvVwz")) != -1) { switch (ch) { + case 'c': + t.coalesce_period = atoi(optarg); + break; case 'E': Eflag = true; modeflags++; @@ -130,6 +137,9 @@ main(int argc, char **argv) case 'w': t.raw_write = true; break; + case 'z': + t.zero_stats = true; + break; default: usage(); } From owner-svn-src-all@freebsd.org Mon Dec 14 22:42:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90BB3A44A6D; Mon, 14 Dec 2015 22:42:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 624A5148F; Mon, 14 Dec 2015 22:42:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEMg5h5066908; Mon, 14 Dec 2015 22:42:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEMg5sc066907; Mon, 14 Dec 2015 22:42:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142242.tBEMg5sc066907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 22:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292230 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:42:06 -0000 Author: bdrewery Date: Mon Dec 14 22:42:05 2015 New Revision: 292230 URL: https://svnweb.freebsd.org/changeset/base/292230 Log: Allow overriding FILESDIRs for snmp files. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.snmpmod.mk Modified: head/share/mk/bsd.snmpmod.mk ============================================================================== --- head/share/mk/bsd.snmpmod.mk Mon Dec 14 22:02:01 2015 (r292229) +++ head/share/mk/bsd.snmpmod.mk Mon Dec 14 22:42:05 2015 (r292230) @@ -16,12 +16,12 @@ ${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree .if defined(DEFS) FILESGROUPS+= DEFS -DEFSDIR= ${SHAREDIR}/snmp/defs +DEFSDIR?= ${SHAREDIR}/snmp/defs .endif .if defined(BMIBS) FILESGROUPS+= BMIBS -BMIBSDIR= ${SHAREDIR}/snmp/mibs +BMIBSDIR?= ${SHAREDIR}/snmp/mibs .endif .include From owner-svn-src-all@freebsd.org Mon Dec 14 22:43:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115F7A44B5F; Mon, 14 Dec 2015 22:43:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C41183F; Mon, 14 Dec 2015 22:43:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEMhidV067126; Mon, 14 Dec 2015 22:43:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEMhip9067125; Mon, 14 Dec 2015 22:43:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142243.tBEMhip9067125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 22:43:44 +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: r292231 - stable/10/usr.sbin/nfsuserd 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:43:45 -0000 Author: rmacklem Date: Mon Dec 14 22:43:43 2015 New Revision: 292231 URL: https://svnweb.freebsd.org/changeset/base/292231 Log: MFC: r291534 Add support for the "-manage-gids" option to the nfsuserd daemon. When this option is set, the NFS server uses the list of groups acquired via getgrouplist(3) for the uid instead of the list of groups in the RPC request. This can be used to avoid the 16 gid limit for the group list in the RPC request. Relnotes: yes Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.c ============================================================================== --- stable/10/usr.sbin/nfsuserd/nfsuserd.c Mon Dec 14 22:42:05 2015 (r292230) +++ stable/10/usr.sbin/nfsuserd/nfsuserd.c Mon Dec 14 22:43:43 2015 (r292231) @@ -92,7 +92,7 @@ uid_t defaultuid = (uid_t)32767; u_char *defaultgroup = "nogroup"; gid_t defaultgid = (gid_t)32767; int verbose = 0, im_a_slave = 0, nfsuserdcnt = -1, forcestart = 0; -int defusertimeout = DEFUSERTIMEOUT; +int defusertimeout = DEFUSERTIMEOUT, manage_gids = 0; pid_t slaves[MAXNFSUSERD]; int @@ -110,6 +110,8 @@ main(int argc, char *argv[]) char hostname[MAXHOSTNAMELEN + 1], *cp; struct addrinfo *aip, hints; static uid_t check_dups[MAXUSERMAX]; + gid_t grps[NGROUPS]; + int ngroup; if (modfind("nfscommon") < 0) { /* Not present in kernel, try loading it */ @@ -160,6 +162,8 @@ main(int argc, char *argv[]) verbose = 1; } else if (!strcmp(*argv, "-force")) { forcestart = 1; + } else if (!strcmp(*argv, "-manage-gids")) { + manage_gids = 1; } else if (!strcmp(*argv, "-usermax")) { if (argc == 1) usage(); @@ -297,12 +301,14 @@ main(int argc, char *argv[]) nid.nid_gid = defaultgid; nid.nid_name = dnsname; nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_INITIALIZE; #ifdef DEBUG printf("Initialize uid=%d gid=%d dns=%s\n", nid.nid_uid, nid.nid_gid, nid.nid_name); #else - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) errx(1, "Can't initialize nfs user/groups"); #endif @@ -316,11 +322,13 @@ main(int argc, char *argv[]) nid.nid_gid = grp->gr_gid; nid.nid_name = grp->gr_name; nid.nid_namelen = strlen(grp->gr_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDGID; #ifdef DEBUG printf("add gid=%d name=%s\n", nid.nid_gid, nid.nid_name); #else - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) errx(1, "Can't add group %s", grp->gr_name); #endif @@ -352,11 +360,23 @@ main(int argc, char *argv[]) nid.nid_uid = pwd->pw_uid; nid.nid_name = pwd->pw_name; nid.nid_namelen = strlen(pwd->pw_name); + if (manage_gids != 0) { + /* Get the group list for this user. */ + ngroup = NGROUPS; + if (getgrouplist(pwd->pw_name, pwd->pw_gid, grps, + &ngroup) < 0) + syslog(LOG_ERR, "Group list too small"); + nid.nid_ngroup = ngroup; + nid.nid_grps = grps; + } else { + nid.nid_ngroup = 0; + nid.nid_grps = NULL; + } nid.nid_flag = NFSID_ADDUID; #ifdef DEBUG printf("add uid=%d name=%s\n", nid.nid_uid, nid.nid_name); #else - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) errx(1, "Can't add user %s", pwd->pw_name); #endif @@ -439,6 +459,8 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP struct info info; struct nfsd_idargs nid; u_int32_t saddr; + gid_t grps[NGROUPS]; + int ngroup; /* * Only handle requests from 127.0.0.1 on a reserved port number. @@ -472,14 +494,28 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_usertimeout = defusertimeout; nid.nid_uid = pwd->pw_uid; nid.nid_name = pwd->pw_name; + if (manage_gids != 0) { + /* Get the group list for this user. */ + ngroup = NGROUPS; + if (getgrouplist(pwd->pw_name, pwd->pw_gid, + grps, &ngroup) < 0) + syslog(LOG_ERR, "Group list too small"); + nid.nid_ngroup = ngroup; + nid.nid_grps = grps; + } else { + nid.nid_ngroup = 0; + nid.nid_grps = NULL; + } } else { nid.nid_usertimeout = 5; nid.nid_uid = (uid_t)info.id; nid.nid_name = defaultuser; + nid.nid_ngroup = 0; + nid.nid_grps = NULL; } nid.nid_namelen = strlen(nid.nid_name); nid.nid_flag = NFSID_ADDUID; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add user %s\n", pwd->pw_name); @@ -509,8 +545,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_name = defaultgroup; } nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDGID; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add group %s\n", @@ -541,8 +579,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_name = info.name; } nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDUSERNAME; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add user %s\n", pwd->pw_name); @@ -572,8 +612,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_name = info.name; } nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDGROUPNAME; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add group %s\n", @@ -679,5 +721,5 @@ usage(void) { errx(1, - "usage: nfsuserd [-usermax cache_size] [-usertimeout minutes] [-verbose] [-domain domain_name] [n]"); + "usage: nfsuserd [-usermax cache_size] [-usertimeout minutes] [-verbose] [-manage-gids] [-domain domain_name] [n]"); } From owner-svn-src-all@freebsd.org Mon Dec 14 22:54:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5793AA47E36; Mon, 14 Dec 2015 22:54:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C9151F79; Mon, 14 Dec 2015 22:54:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEMs3US070934; Mon, 14 Dec 2015 22:54:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEMs3gm070933; Mon, 14 Dec 2015 22:54:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142254.tBEMs3gm070933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 22:54: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: r292232 - stable/10/usr.sbin/nfsuserd 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 22:54:04 -0000 Author: rmacklem Date: Mon Dec 14 22:54:02 2015 New Revision: 292232 URL: https://svnweb.freebsd.org/changeset/base/292232 Log: MFC: r291535 Document the new "-manage-gids" option for the nfsuserd daemon. This is a content change. Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- stable/10/usr.sbin/nfsuserd/nfsuserd.8 Mon Dec 14 22:43:43 2015 (r292231) +++ stable/10/usr.sbin/nfsuserd/nfsuserd.8 Mon Dec 14 22:54:02 2015 (r292232) @@ -24,14 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2009 +.Dd November 1, 2015 .Dt NFSUSERD 8 .Os .Sh NAME .Nm nfsuserd .Nd load user and group information into the kernel for .Tn NFSv4 -services +services plus support manage-gids for all NFS versions .Sh SYNOPSIS .Nm nfsuserd .Op Fl domain Ar domain_name @@ -39,11 +39,14 @@ services .Op Fl usermax Ar max_cache_size .Op Fl verbose .Op Fl force +.Op Fl manage-gids .Op Ar num_servers .Sh DESCRIPTION .Nm loads user and group information into the kernel for NFSv4. It must be running for NFSv4 to function correctly, either client or server. +It also provides support for manage-gids and must be running on the server if +this is being used for any version of NFS. .Pp Upon startup, it loads the machines DNS domain name, plus timeout and cache size limit into the kernel. It then preloads the cache with group @@ -79,6 +82,15 @@ When set, the server logs a bunch of inf This flag option must be set to restart the daemon after it has gone away abnormally and refuses to start, because it thinks nfsuserd is already running. +.It Fl manage-gids +This flag enables manage-gids for the NFS server +.Xr nfsd 8 . +When this is enabled, all NFS requests using +AUTH_SYS authentication take the uid from the RPC request +and uses the group list for that uid provided by +.Xr getgrouplist 3 +on the server instead of the list of groups provided in the RPC authenticator. +This can be used to avoid the 16 group limit for AUTH_SYS. .It Ar num_servers Specifies how many servers to create (max 20). The default of 4 may be sufficient. You should run enough servers, so that @@ -89,8 +101,9 @@ performance impact, whereas running too such as a process table entry and swap space. .El .Sh SEE ALSO -.Xr getpwent 3 , .Xr getgrent 3 , +.Xr getgrouplist 3 , +.Xr getpwent 3 , .Xr nfsv4 4 , .Xr group 5 , .Xr passwd 5 , @@ -103,7 +116,8 @@ utility was introduced with the NFSv4 ex The .Nm use -.Xr getgrent 3 +.Xr getgrent 3 , +.Xr getgrouplist 3 and .Xr getpwent 3 library calls to resolve requests and will hang if the servers handling From owner-svn-src-all@freebsd.org Mon Dec 14 23:09:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80CAEA438A2; Mon, 14 Dec 2015 23:09:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38A591A01; Mon, 14 Dec 2015 23:09:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEN93d3075448; Mon, 14 Dec 2015 23:09:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEN93cv075445; Mon, 14 Dec 2015 23:09:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142309.tBEN93cv075445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 23:09: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: r292233 - in stable/10/etc: defaults rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 23:09:04 -0000 Author: rmacklem Date: Mon Dec 14 23:09:02 2015 New Revision: 292233 URL: https://svnweb.freebsd.org/changeset/base/292233 Log: MFC: r291536 Add support for the new "-manage-gids" option for the nfsuserd daemon to the rc scripts. With these changes, setting nfs_server_managegids="YES" in /etc/rc.conf will enable this capability. Relnotes: yes Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/nfsd stable/10/etc/rc.d/nfsuserd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Mon Dec 14 22:54:02 2015 (r292232) +++ stable/10/etc/defaults/rc.conf Mon Dec 14 23:09:02 2015 (r292233) @@ -330,6 +330,7 @@ nfs_access_cache="60" # Client cache ti nfs_server_enable="NO" # This host is an NFS server (or NO). oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). nfs_server_flags="-u -t" # Flags to nfsd (if enabled). +nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. Modified: stable/10/etc/rc.d/nfsd ============================================================================== --- stable/10/etc/rc.d/nfsd Mon Dec 14 22:54:02 2015 (r292232) +++ stable/10/etc/rc.d/nfsd Mon Dec 14 23:09:02 2015 (r292233) @@ -46,9 +46,13 @@ nfsd_precmd() sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi + if checkyesno nfsv4_server_enable || \ + checkyesno nfs_server_managegids; then + force_depend nfsuserd || err 1 "Cannot run nfsuserd" + fi + if checkyesno nfsv4_server_enable; then sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null - force_depend nfsuserd || err 1 "Cannot run nfsuserd" else echo 'NFSv4 is disabled' sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null Modified: stable/10/etc/rc.d/nfsuserd ============================================================================== --- stable/10/etc/rc.d/nfsuserd Mon Dec 14 22:54:02 2015 (r292232) +++ stable/10/etc/rc.d/nfsuserd Mon Dec 14 23:09:02 2015 (r292233) @@ -15,5 +15,14 @@ command="/usr/sbin/${name}" sig_stop="USR1" load_rc_config $name +start_precmd="nfsuserd_precmd" + +nfsuserd_precmd() +{ + if checkyesno nfs_server_managegids; then + rc_flags="-manage-gids ${nfsuserd_flags}" + fi + return 0 +} run_rc_command "$1" From owner-svn-src-all@freebsd.org Mon Dec 14 23:09:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968B3A43961; Mon, 14 Dec 2015 23:09:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65FF91BA1; Mon, 14 Dec 2015 23:09:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEN9UkI075536; Mon, 14 Dec 2015 23:09:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEN9U5G075535; Mon, 14 Dec 2015 23:09:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512142309.tBEN9U5G075535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 14 Dec 2015 23:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292234 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 23:09:31 -0000 Author: ian Date: Mon Dec 14 23:09:30 2015 New Revision: 292234 URL: https://svnweb.freebsd.org/changeset/base/292234 Log: Add strlcat() and strlcpy() to libstand. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Mon Dec 14 23:09:02 2015 (r292233) +++ head/lib/libstand/Makefile Mon Dec 14 23:09:30 2015 (r292234) @@ -39,8 +39,8 @@ SRCS+= ntoh.c .PATH: ${LIBC_SRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC_SRC}/arm/gen From owner-svn-src-all@freebsd.org Mon Dec 14 23:25:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1667DA44386; Mon, 14 Dec 2015 23:25:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D864D1629; Mon, 14 Dec 2015 23:25:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBENPVlX082549; Mon, 14 Dec 2015 23:25:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBENPVGU082548; Mon, 14 Dec 2015 23:25:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142325.tBENPVGU082548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 23:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292235 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 23:25:33 -0000 Author: bdrewery Date: Mon Dec 14 23:25:31 2015 New Revision: 292235 URL: https://svnweb.freebsd.org/changeset/base/292235 Log: Follow-up r290423: Don't use CSH for buildenv shell. It does not properly import PATH; the PATH is reset by included profile files on startup which breaks the biggest feature of buildenv (using sysrooted cc from WORLDTMP) Spotted by: smh, kib Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Dec 14 23:09:30 2015 (r292234) +++ head/Makefile.inc1 Mon Dec 14 23:25:31 2015 (r292235) @@ -146,7 +146,11 @@ CLEANDIR= cleandir LOCAL_TOOL_DIRS?= PACKAGEDIR?= ${DESTDIR}/${DISTDIR} +.if empty(SHELL:M*csh*) BUILDENV_SHELL?=${SHELL} +.else +BUILDENV_SHELL?=/bin/sh +.endif SVN?= /usr/local/bin/svn SVNFLAGS?= -r HEAD From owner-svn-src-all@freebsd.org Mon Dec 14 23:35:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63426A449A8; Mon, 14 Dec 2015 23:35:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 129FB1CFC; Mon, 14 Dec 2015 23:35:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by lbblt2 with SMTP id lt2so117788770lbb.3; Mon, 14 Dec 2015 15:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CaCaxWp5uTXfYmKkbkh9DrIOEbjXqzQDYVcgAIJPLqg=; b=EouaW6GPYHc71MHOUepcAlRO+fCQKeHO6EfsiYOeV4xndCLjlXDLGyfbw7J0/WtPBI AktIIJa3+IGb1DK9jAxHw4UGlaUxK+vpY5A/q9/FRf7rW+29iPIkdB94j29Kajh4sIu2 +Z/l2ZdpzuPmlbp5AABxlVNbh9XFkm/Z+AQ12TWM5OX60wwIRVm4UgljhKi6aoe6O8GS H422kMpdUjqZXW+LIwgCTXlNL07SWYpdGvrjMIq16uKV/xyzF39T6ZlFyjB+9So/xg6X VSHvlSSqpQ9k8uCGiG9/+1alEzvG1UrfZjwLUwfDMj8NiwIIPSe4GvzRG3eMMrr1XgXQ tHfg== MIME-Version: 1.0 X-Received: by 10.112.160.169 with SMTP id xl9mr14452760lbb.40.1450136120709; Mon, 14 Dec 2015 15:35:20 -0800 (PST) Received: by 10.112.219.9 with HTTP; Mon, 14 Dec 2015 15:35:20 -0800 (PST) In-Reply-To: <201512142133.tBELXVJD041194@repo.freebsd.org> References: <201512142133.tBELXVJD041194@repo.freebsd.org> Date: Mon, 14 Dec 2015 15:35:20 -0800 Message-ID: Subject: Re: svn commit: r292225 - stable/10/usr.bin/bmake From: NGie Cooper To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 14 Dec 2015 23:35:23 -0000 On Mon, Dec 14, 2015 at 1:33 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Dec 14 21:33:31 2015 > New Revision: 292225 > URL: https://svnweb.freebsd.org/changeset/base/292225 > > Log: > MFC r266566: > > Add .../share/mk to the default system make path. This will fix the problem > with broken in-tree builds (which are used far more pervasively than I'd > known outside the tree). However, weird results may now happen if at any > point in the tree above you there happens to be a directory that has > subdirectory of share/mk, as unpredictable results will follow. This was > considered the lessor of the two evils, at least for now. In the future this > will be removed again when the underlying issues are resolved. > > For MFCing, this is to ensure that when upgrading to head the share/mk > in-tree is always used. Otherwise several build features will not work. > This passes a build using head's bmake which has this as the default > already. > > Relnotes: yes THANK YOU!!!! From owner-svn-src-all@freebsd.org Tue Dec 15 00:05:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAFA5A43A16; Tue, 15 Dec 2015 00:05:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4961D2B; Tue, 15 Dec 2015 00:05:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF058No097452; Tue, 15 Dec 2015 00:05:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF057l2097434; Tue, 15 Dec 2015 00:05:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512150005.tBF057l2097434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 15 Dec 2015 00:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292236 - in head: contrib/mdocml lib lib/libc/sys lib/libsysdecode share/mk usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 00:05:10 -0000 Author: jhb Date: Tue Dec 15 00:05:07 2015 New Revision: 292236 URL: https://svnweb.freebsd.org/changeset/base/292236 Log: Start on a new library (libsysdecode) that provides routines for decoding system call information such as system call arguments. Initially this will consist of pulling duplicated code out of truss and kdump though it may prove useful for other utilities in the future. This commit moves the shared utrace(2) record parser out of kdump into the library and updates kdump and truss to use it. One difference from the previous version is that the library version treats unknown events that start with the "RTLD" signature as unknown events. This simplifies the interface and allows the consumer to decide how to handle all non-recognized events. Instead, this function only generates a string description for known malloc() and RTLD records. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4537 Added: head/lib/libsysdecode/ head/lib/libsysdecode/Makefile (contents, props changed) head/lib/libsysdecode/sysdecode.3 (contents, props changed) head/lib/libsysdecode/sysdecode.h (contents, props changed) head/lib/libsysdecode/sysdecode_utrace.3 (contents, props changed) head/lib/libsysdecode/utrace.c - copied, changed from r292235, head/usr.bin/kdump/utrace.c Deleted: head/usr.bin/kdump/utrace.c Modified: head/contrib/mdocml/lib.in head/lib/Makefile head/lib/libc/sys/utrace.2 head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/usr.bin/kdump/Makefile head/usr.bin/kdump/Makefile.depend head/usr.bin/kdump/kdump.c head/usr.bin/truss/Makefile head/usr.bin/truss/Makefile.depend.amd64 head/usr.bin/truss/syscalls.c Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Mon Dec 14 23:25:31 2015 (r292235) +++ head/contrib/mdocml/lib.in Tue Dec 15 00:05:07 2015 (r292236) @@ -110,6 +110,7 @@ LINE("libsdp", "Bluetooth Service Disco LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") LINE("libSystem", "System Library (libSystem, \\-lSystem)") +LINE("libsysdcode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") LINE("libtacplus", "TACACS+ Client Library (libtacplus, \\-ltacplus)") LINE("libtcplay", "TrueCrypt-compatible API library (libtcplay, \\-ltcplay)") LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)") Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Dec 14 23:25:31 2015 (r292235) +++ head/lib/Makefile Tue Dec 15 00:05:07 2015 (r292236) @@ -98,6 +98,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libstand \ libstdbuf \ libstdthreads \ + libsysdecode \ libtacplus \ ${_libtelnet} \ ${_libthr} \ Modified: head/lib/libc/sys/utrace.2 ============================================================================== --- head/lib/libc/sys/utrace.2 Mon Dec 14 23:25:31 2015 (r292235) +++ head/lib/libc/sys/utrace.2 Tue Dec 15 00:05:07 2015 (r292236) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2015 +.Dd December 11, 2015 .Dt UTRACE 2 .Os .Sh NAME @@ -71,7 +71,8 @@ support .Xr kdump 1 , .Xr ktrace 1 , .Xr ktrace 2 , -.Xr truss 1 +.Xr truss 1 , +.Xr sysdecode_utrace 3 .Sh HISTORY The .Fn utrace Added: head/lib/libsysdecode/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/Makefile Tue Dec 15 00:05:07 2015 (r292236) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.include + +LIB= sysdecode + +SRCS= utrace.c +INCS= sysdecode.h + +MAN+= sysdecode.3 \ + sysdecode_utrace.3 + +.include Added: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode.3 Tue Dec 15 00:05:07 2015 (r292236) @@ -0,0 +1,47 @@ +.\" +.\" Copyright (c) 2015 John Baldwin +.\" 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 December 10, 2015 +.Dt SYSDECODE 3 +.Os +.Sh NAME +.Nm sysdecode +.Nd system argument decoding library +.Sh LIBRARY +.Lb libsysdecode +.Sh DESCRIPTION +The +.Nm +library includes several functions that provide descriptive names of +values associated with system calls. +.Sh SEE ALSO +.Xr sysdecode_utrace 3 +.Sh HISTORY +The +.Nm +library first appeared in +.Fx 11.0 . Added: head/lib/libsysdecode/sysdecode.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode.h Tue Dec 15 00:05:07 2015 (r292236) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2015 John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __SYSDECODE_H__ +#define __SYSDECODE_H__ + +int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); + +#endif /* !__SYSDECODE_H__ */ Added: head/lib/libsysdecode/sysdecode_utrace.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_utrace.3 Tue Dec 15 00:05:07 2015 (r292236) @@ -0,0 +1,73 @@ +.\" +.\" Copyright (c) 2015 John Baldwin +.\" 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 December 11, 2015 +.Dt sysdecode_utrace 3 +.Os +.Sh NAME +.Nm sysdecode_utrace +.Nd produce text description of a utrace record +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.Ft int +.Fn sysdecode_utrace "FILE *fp" "void *buf" "size_t len" "int decimal" +.Sh DESCRIPTION +The +.Fn sysdecode_utrace +function outputs a textual representation of a +.Xr utrace 2 +record identified by +.Fa buf +and +.Fa len +to the output stream +.Fa fp . +.Pp +The function only outputs a representation for certain types of records. +If a record is recognized, +the function outputs the description and returns a non-zero value. +If the record is not recognized, +the function does not output anything and returns zero. +The +.Fn sysdecode_utrace +function currently recognizes +.Xr utrace 2 +records generated by +.Xr malloc 3 +and +.Xr rtld 1 . +.Sh RETURN VALUES +The +.Fn sysdecode_utrace +function returns a non-zero value if it recognizes a +.Xr utrace 2 +record; +otherwise it returns zero. +.Sh SEE ALSO +.Xr utrace 2 , +.Xr sysdecode 3 Copied and modified: head/lib/libsysdecode/utrace.c (from r292235, head/usr.bin/kdump/utrace.c) ============================================================================== --- head/usr.bin/kdump/utrace.c Mon Dec 14 23:25:31 2015 (r292235, copy source) +++ head/lib/libsysdecode/utrace.c Tue Dec 15 00:05:07 2015 (r292236) @@ -34,8 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -int kdump_print_utrace(FILE *, void *, size_t, int); +#include #define UTRACE_DLOPEN_START 1 #define UTRACE_DLOPEN_STOP 2 @@ -60,11 +59,10 @@ struct utrace_rtld { char name[MAXPATHLEN]; }; -static void -print_utrace_rtld(FILE *fp, void *p, size_t len, int decimal) +static int +print_utrace_rtld(FILE *fp, void *p) { struct utrace_rtld *ut = p; - unsigned char *cp; void *parent; int mode; @@ -136,16 +134,9 @@ print_utrace_rtld(FILE *fp, void *p, siz ut->name); break; default: - cp = p; - cp += 4; - len -= 4; - fprintf(fp, "RTLD: %zu ", len); - while (len--) - if (decimal) - fprintf(fp, " %d", *cp++); - else - fprintf(fp, " %02x", *cp++); + return (0); } + return (1); } struct utrace_malloc { @@ -170,12 +161,11 @@ print_utrace_malloc(FILE *fp, void *p) } int -kdump_print_utrace(FILE *fp, void *p, size_t len, int decimal) +sysdecode_utrace(FILE *fp, void *p, size_t len) { - if (len >= 8 && bcmp(p, "RTLD", 4) == 0) { - print_utrace_rtld(fp, p, len, decimal); - return (1); + if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) { + return (print_utrace_rtld(fp, p)); } if (len == sizeof(struct utrace_malloc)) { Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Dec 14 23:25:31 2015 (r292235) +++ head/share/mk/bsd.libnames.mk Tue Dec 15 00:05:07 2015 (r292236) @@ -134,6 +134,7 @@ LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/l LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a +LIBSYSDECODE?= ${DESTDIR}${LIBDIR}/libsysdecode.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon Dec 14 23:25:31 2015 (r292235) +++ head/share/mk/src.libnames.mk Tue Dec 15 00:05:07 2015 (r292236) @@ -148,6 +148,7 @@ _LIBRARIES= \ ssp_nonshared \ stdthreads \ supcplusplus \ + sysdecode \ tacplus \ termcap \ termcapw \ Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Mon Dec 14 23:25:31 2015 (r292235) +++ head/usr.bin/kdump/Makefile Tue Dec 15 00:05:07 2015 (r292236) @@ -6,11 +6,12 @@ .PATH: ${.CURDIR}/../ktrace PROG= kdump -SRCS= kdump_subr.c kdump_subr.h kdump.c ioctl.c subr.c utrace.c +SRCS= kdump_subr.c kdump_subr.h kdump.c ioctl.c subr.c CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. +LIBADD= sysdecode .if ${MK_CASPER} != "no" -LIBADD= capsicum +LIBADD+= capsicum CFLAGS+=-DHAVE_LIBCAPSICUM .endif Modified: head/usr.bin/kdump/Makefile.depend ============================================================================== --- head/usr.bin/kdump/Makefile.depend Mon Dec 14 23:25:31 2015 (r292235) +++ head/usr.bin/kdump/Makefile.depend Tue Dec 15 00:05:07 2015 (r292236) @@ -13,6 +13,7 @@ DIRDEPS = \ lib/libcapsicum \ lib/libcompiler_rt \ lib/libnv \ + lib/libsysdecode \ .include Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Dec 14 23:25:31 2015 (r292235) +++ head/usr.bin/kdump/kdump.c Tue Dec 15 00:05:07 2015 (r292236) @@ -83,6 +83,7 @@ extern int errno; #include #include #include +#include #include #include #include @@ -116,7 +117,6 @@ void ktrfaultend(struct ktr_faultend *); void limitfd(int fd); void usage(void); void ioctlname(unsigned long, int); -int kdump_print_utrace(FILE *, void *, size_t, int); #define TIMESTAMP_NONE 0x0 #define TIMESTAMP_ABSOLUTE 0x1 @@ -1541,7 +1541,7 @@ ktruser(int len, void *p) { unsigned char *cp; - if (kdump_print_utrace(stdout, p, len, decimal)) { + if (sysdecode_utrace(stdout, p, len)) { printf("\n"); return; } Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Mon Dec 14 23:25:31 2015 (r292235) +++ head/usr.bin/truss/Makefile Tue Dec 15 00:05:07 2015 (r292236) @@ -4,8 +4,7 @@ NO_WERROR= PROG= truss SRCS= cloudabi.c ioctl.c main.c setup.c syscalls.c -.PATH: ${.CURDIR:H}/kdump -SRCS+= utrace.c +LIBADD= sysdecode CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys CLEANFILES= ioctl.c Modified: head/usr.bin/truss/Makefile.depend.amd64 ============================================================================== --- head/usr.bin/truss/Makefile.depend.amd64 Mon Dec 14 23:25:31 2015 (r292235) +++ head/usr.bin/truss/Makefile.depend.amd64 Tue Dec 15 00:05:07 2015 (r292236) @@ -11,6 +11,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libsysdecode \ .include Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Dec 14 23:25:31 2015 (r292235) +++ head/usr.bin/truss/syscalls.c Tue Dec 15 00:05:07 2015 (r292236) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -75,9 +76,6 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "syscall.h" -/* usr.bin/kdump/utrace.c */ -int kdump_print_utrace(FILE *, void *, size_t, int); - /* 64-bit alignment on 32-bit platforms. */ #if !defined(__LP64__) && defined(__powerpc__) #define QUAD_ALIGN 1 @@ -1108,7 +1106,7 @@ print_utrace(FILE *fp, void *utrace_addr unsigned char *utrace_buffer; fprintf(fp, "{ "); - if (kdump_print_utrace(fp, utrace_addr, len, 0)) { + if (sysdecode_utrace(fp, utrace_addr, len)) { fprintf(fp, " }"); return; } From owner-svn-src-all@freebsd.org Tue Dec 15 00:16:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAB65A4425B; Tue, 15 Dec 2015 00:16:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CBB0135D; Tue, 15 Dec 2015 00:16:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF0GYVa001504; Tue, 15 Dec 2015 00:16:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF0GYxR001503; Tue, 15 Dec 2015 00:16:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150016.tBF0GYxR001503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 00:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292237 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 00:16:35 -0000 Author: bdrewery Date: Tue Dec 15 00:16:34 2015 New Revision: 292237 URL: https://svnweb.freebsd.org/changeset/base/292237 Log: Follow-up r291739: Don't suggest LDADD on private libs to use LIBADD. This is because LDADD+=-lFOO is not the same as LDADD+=-lprivateFOO which is what the private libs in LIBADD are. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Dec 15 00:05:07 2015 (r292236) +++ head/share/mk/src.libnames.mk Tue Dec 15 00:16:34 2015 (r292237) @@ -348,8 +348,9 @@ DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. +_BADLDADD= .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} -.if ${_LIBRARIES:M${_l}} +.if ${_LIBRARIES:M${_l}} && !${_PRIVATELIBS:M${_l}} _BADLDADD+= ${_l} .endif .endfor From owner-svn-src-all@freebsd.org Tue Dec 15 00:40:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B71A47ED2; Tue, 15 Dec 2015 00:40:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3752F1244; Tue, 15 Dec 2015 00:40:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF0e4so009406; Tue, 15 Dec 2015 00:40:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF0e4li009405; Tue, 15 Dec 2015 00:40:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150040.tBF0e4li009405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 00:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292238 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 00:40:05 -0000 Author: bdrewery Date: Tue Dec 15 00:40:04 2015 New Revision: 292238 URL: https://svnweb.freebsd.org/changeset/base/292238 Log: Add comment about OBJTOP not yet being defined outside of META MODE. It is fine for the purpose of the check though. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Dec 15 00:16:34 2015 (r292237) +++ head/share/mk/src.libnames.mk Tue Dec 15 00:40:04 2015 (r292238) @@ -519,6 +519,8 @@ _BADLIBADD+= ${_l} (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) .error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') .endif +# Note that OBJTOP is not yet defined here but for the purpose of the check +# it is fine as it resolves to the SRC directory. .if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) .error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} .endif From owner-svn-src-all@freebsd.org Tue Dec 15 01:19:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7400FA44661; Tue, 15 Dec 2015 01:19:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 413931441; Tue, 15 Dec 2015 01:19:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF1JKbg023929; Tue, 15 Dec 2015 01:19:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF1JKNA023928; Tue, 15 Dec 2015 01:19:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150119.tBF1JKNA023928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 01:19: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: r292239 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 01:19:21 -0000 Author: bdrewery Date: Tue Dec 15 01:19:19 2015 New Revision: 292239 URL: https://svnweb.freebsd.org/changeset/base/292239 Log: Add SRCTOP and RELDIR support. This is a direct commit to stable/10. It allows simpler MFCing from head where these are being used more frequently. Sponsored by: EMC / Isilon Storage Division Added: stable/10/share/mk/local.sys.mk (contents, props changed) Added: stable/10/share/mk/local.sys.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/mk/local.sys.mk Tue Dec 15 01:19:19 2015 (r292239) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.if defined(.PARSEDIR) +SRCTOP:= ${.PARSEDIR:tA:H:H} +.else +SRCTOP:= ${.MAKE.MAKEFILES:M*/local.sys.mk:H:H:H} +.endif + +.if ${.CURDIR} == ${SRCTOP} +RELDIR = . +.elif ${.CURDIR:M${SRCTOP}/*} +RELDIR := ${.CURDIR:S,${SRCTOP}/,,} +.endif From owner-svn-src-all@freebsd.org Tue Dec 15 01:37:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAD1A47EFE; Tue, 15 Dec 2015 01:37:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D616F2000; Tue, 15 Dec 2015 01:37:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF1blDU031296; Tue, 15 Dec 2015 01:37:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF1blJ3031295; Tue, 15 Dec 2015 01:37:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150137.tBF1blJ3031295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 01:37: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: r292240 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 01:37:48 -0000 Author: bdrewery Date: Tue Dec 15 01:37:46 2015 New Revision: 292240 URL: https://svnweb.freebsd.org/changeset/base/292240 Log: Partial MFC r291349: Standardize on OBJTOP in and outside of META MODE. For stable/10 this means bringing OBJTOP support in which simplifies MFCs. Modified: stable/10/share/mk/bsd.obj.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.obj.mk ============================================================================== --- stable/10/share/mk/bsd.obj.mk Tue Dec 15 01:19:19 2015 (r292239) +++ stable/10/share/mk/bsd.obj.mk Tue Dec 15 01:37:46 2015 (r292240) @@ -46,10 +46,13 @@ ____: CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} .elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" CANONICALOBJDIR:=${MAKEOBJDIR} +OBJTOP?= ${MAKEOBJDIR} .else CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif +OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} + # # Warn of unorthodox object directory. # From owner-svn-src-all@freebsd.org Tue Dec 15 01:43:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EBA3A4343D; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 722CF152E; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6B13E13C0; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 23A5910D53; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id r_rrmJjh0Tqr; Tue, 15 Dec 2015 01:43:04 +0000 (UTC) Subject: Re: svn commit: r292225 - stable/10/usr.bin/bmake DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4828810D4A To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201512142133.tBELXVJD041194@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <566F7024.3050800@FreeBSD.org> Date: Mon, 14 Dec 2015 17:43:00 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512142133.tBELXVJD041194@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 01:43:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/14/2015 1:33 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Dec 14 21:33:31 2015 > New Revision: 292225 > URL: https://svnweb.freebsd.org/changeset/base/292225 >=20 > Log: > MFC r266566: > =20 > Add .../share/mk to the default system make path. This will fix the= problem > with broken in-tree builds (which are used far more pervasively tha= n I'd > known outside the tree). However, weird results may now happen if a= t any > point in the tree above you there happens to be a directory that ha= s > subdirectory of share/mk, as unpredictable results will follow. Thi= s was > considered the lessor of the two evils, at least for now. In the fu= ture this > will be removed again when the underlying issues are resolved. > =20 > For MFCing, this is to ensure that when upgrading to head the share= /mk > in-tree is always used. Otherwise several build features will not = work. > This passes a build using head's bmake which has this as the defaul= t > already. > =20 > Relnotes: yes >=20 > Modified: > stable/10/usr.bin/bmake/Makefile > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/usr.bin/bmake/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 > --- stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:30:28 2015 (r292224)= > +++ stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:33:31 2015 (r292225)= > @@ -167,7 +167,6 @@ accept test: > # override some simple things > BINDIR=3D /usr/bin > MANDIR=3D /usr/share/man/man > -DEFAULT_SYS_PATH=3D /usr/share/mk > =20 > # make sure we get this > CFLAGS+=3D ${COPTS.${.IMPSRC:T}} >=20 It's possible r279247 is needed, but I have not run into a case where it is. For the intent of using in-tree share/mk fully for building head from stable/10, it will already have r279247. A problem might come from building stable/10 on stable/10 without r279247, but everything seems fine to me. --=20 Regards, Bryan Drewery --SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWb3AkAAoJEDXXcbtuRpfPHmEIAKaKpL4QxgHL5g8CMId6E8GJ Iuoprr8vhqoGDlJt6KBDmh8IHIrLimVSsiLOMf89dTaBVLqSt7w5U4Tx0p803iAB gHnqnteHsjxzSnkZWe/QEUqMcMPMh0RdqATrqjMFZbQLFQmNnzkR/cyy5YnFB+9D OZKx3c5Vlu10kQMsvW46VsQhG8zZ1WiQGHt4afKaeJjas2Q7iS5lVjYht0wYvdZK F27g2NWwyc0BOZhHYcwZzBUsk4+aexdkmJuLH4RgMCJp0MGGXubyX53T+yvJdE9c yAEhZQTeuPHWJelxSQgnjqIEnfW2FcLi0H0IjmCexqhcg1PRcuDB118+VQY1EDc= =dSvR -----END PGP SIGNATURE----- --SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL-- From owner-svn-src-all@freebsd.org Tue Dec 15 02:27:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29AE6A4313D; Tue, 15 Dec 2015 02:27:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAF341AE2; Tue, 15 Dec 2015 02:27:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF2RVpU047818; Tue, 15 Dec 2015 02:27:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF2RV11047817; Tue, 15 Dec 2015 02:27:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150227.tBF2RV11047817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 02:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292241 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 02:27:33 -0000 Author: bdrewery Date: Tue Dec 15 02:27:31 2015 New Revision: 292241 URL: https://svnweb.freebsd.org/changeset/base/292241 Log: DIRDEPS_BUILD: Avoid duplicates in DIRDEPS for bootstrapping. This logic is potentially included multiple times, so overwrite the temporary variable rather than append to it. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Tue Dec 15 01:37:46 2015 (r292240) +++ head/share/mk/local.dirdeps.mk Tue Dec 15 02:27:31 2015 (r292241) @@ -134,7 +134,7 @@ DIRDEPS+= usr.bin/yacc.host # BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. -_DP_DIRDEPS+= \ +_DP_DIRDEPS= \ ${DPADD:M${OBJTOP}*:H:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs From owner-svn-src-all@freebsd.org Tue Dec 15 03:40:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8117DA432C8; Tue, 15 Dec 2015 03:40:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3813F1299; Tue, 15 Dec 2015 03:40:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF2p5MD055675; Tue, 15 Dec 2015 02:51:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF2p5xW055674; Tue, 15 Dec 2015 02:51:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150251.tBF2p5xW055674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 02:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292243 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 03:40:06 -0000 Author: bdrewery Date: Tue Dec 15 02:51:05 2015 New Revision: 292243 URL: https://svnweb.freebsd.org/changeset/base/292243 Log: DIRDEPS_BUILD: Support bootstrapping from PROGS.(DPADD|LIBADD). Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Tue Dec 15 02:46:14 2015 (r292242) +++ head/share/mk/local.dirdeps.mk Tue Dec 15 02:51:05 2015 (r292243) @@ -129,14 +129,28 @@ DIRDEPS+= lib/msun .if !empty(SRCS:M*.y) DIRDEPS+= usr.bin/yacc.host .endif +# Gather PROGS dependencies +.if !empty(PROGS) +_PROGS_LIBADD= +_PROGS_DPADD= +.for _prog in ${PROGS} +.if !empty(LIBADD.${_prog}) +_PROGS_LIBADD+= ${LIBADD.${_prog}} +.endif +.if !empty(DPADD.${_prog}) +_PROGS_DPADD+= ${DPADD.${_prog}} +.endif +.endfor +.endif # !empty(PROGS) .if !empty(DPADD) # Taken from meta.autodep.mk (where it only does something with # BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. +_DPADD= ${DPADD} ${_PROGS_DPADD} _DP_DIRDEPS= \ - ${DPADD:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ - ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} + ${_DPADD:O:u:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ + ${_DPADD:O:u:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs .if !empty(_DP_DIRDEPS) DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} @@ -144,7 +158,8 @@ DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,: .endif # !empty(DPADD) .if !empty(LIBADD) # Also handle LIBADD for non-internal libraries. -.for _lib in ${LIBADD} +_ALL_LIBADD= ${LIBADD} ${_PROGS_LIBADD} +.for _lib in ${_ALL_LIBADD:O:u} _lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,} .if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \ exists(${SRCTOP}/${_lib${_lib}reldir}) From owner-svn-src-all@freebsd.org Tue Dec 15 03:40:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 032C2A432C3; Tue, 15 Dec 2015 03:40:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C81BD1298; Tue, 15 Dec 2015 03:40:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF2kEOt053548; Tue, 15 Dec 2015 02:46:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF2kENE053547; Tue, 15 Dec 2015 02:46:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150246.tBF2kENE053547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 02:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292242 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 03:40:06 -0000 Author: bdrewery Date: Tue Dec 15 02:46:14 2015 New Revision: 292242 URL: https://svnweb.freebsd.org/changeset/base/292242 Log: DIRDEPS_BUILD: Fix incorrectly adding in RELDIR for DIRDEPS in bootstrapping. This is not wrong, but was unexpected. Using :H results in '.' which then using the rest of the conversion was added in RELDIR. This was also causing an empty _DP_DIRDEPS to resolve to SRCTOP for DIRDEPS. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Tue Dec 15 02:27:31 2015 (r292241) +++ head/share/mk/local.dirdeps.mk Tue Dec 15 02:46:14 2015 (r292242) @@ -135,11 +135,13 @@ DIRDEPS+= usr.bin/yacc.host # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. _DP_DIRDEPS= \ - ${DPADD:M${OBJTOP}*:H:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ + ${DPADD:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs +.if !empty(_DP_DIRDEPS) DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} .endif +.endif # !empty(DPADD) .if !empty(LIBADD) # Also handle LIBADD for non-internal libraries. .for _lib in ${LIBADD} From owner-svn-src-all@freebsd.org Tue Dec 15 04:28:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 081CAA44DC7; Tue, 15 Dec 2015 04:28:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C94BC1B16; Tue, 15 Dec 2015 04:28:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF4SVTD082769; Tue, 15 Dec 2015 04:28:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF4SVwB082768; Tue, 15 Dec 2015 04:28:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512150428.tBF4SVwB082768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 15 Dec 2015 04:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292244 - head/tools/tools/ath/athratestats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 04:28:33 -0000 Author: adrian Date: Tue Dec 15 04:28:31 2015 New Revision: 292244 URL: https://svnweb.freebsd.org/changeset/base/292244 Log: Flip this over to ncurses. Modified: head/tools/tools/ath/athratestats/Makefile Modified: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- head/tools/tools/ath/athratestats/Makefile Tue Dec 15 02:51:05 2015 (r292243) +++ head/tools/tools/ath/athratestats/Makefile Tue Dec 15 04:28:31 2015 (r292244) @@ -7,7 +7,7 @@ PROG= athratestats SRCS= main.c opt_ah.h ah_osdep.h -LIBADD+= curses +LIBADD+= ncurses CLEANFILES+= opt_ah.h ah_osdep.h From owner-svn-src-all@freebsd.org Tue Dec 15 04:43:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E7FBA43DF4; Tue, 15 Dec 2015 04:43:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F57D1F8E; Tue, 15 Dec 2015 04:43:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF4hS1T088612; Tue, 15 Dec 2015 04:43:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF4hSrA088611; Tue, 15 Dec 2015 04:43:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512150443.tBF4hSrA088611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 15 Dec 2015 04:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292245 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 04:43:29 -0000 Author: adrian Date: Tue Dec 15 04:43:28 2015 New Revision: 292245 URL: https://svnweb.freebsd.org/changeset/base/292245 Log: [arge] add a comment about needing mdio busses in order to use the interface. This is a holdover from how reset is handled in the ARGE_MDIO world. You need to define the mdio bus device if you want to use the ethernet device or the arge setup path doesn't bring the MAC out of reset. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Tue Dec 15 04:28:31 2015 (r292244) +++ head/sys/mips/atheros/if_arge.c Tue Dec 15 04:43:28 2015 (r292245) @@ -885,6 +885,11 @@ arge_attach(device_t dev) /* * Don't do this for the MDIO bus case - it's already done * as part of the MDIO bus attachment. + * + * XXX TODO: if we don't do this, we don't ever release the MAC + * from reset and we can't use the port. Now, if we define ARGE_MDIO + * but we /don't/ define two MDIO busses, then we can't actually + * use both MACs. */ #if !defined(ARGE_MDIO) /* Initialize the MAC block */ From owner-svn-src-all@freebsd.org Tue Dec 15 04:44:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 094BAA43E79; Tue, 15 Dec 2015 04:44:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D08601133; Tue, 15 Dec 2015 04:44:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF4i74U088693; Tue, 15 Dec 2015 04:44:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF4i7iI088692; Tue, 15 Dec 2015 04:44:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512150444.tBF4i7iI088692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 15 Dec 2015 04:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292246 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 04:44:08 -0000 Author: adrian Date: Tue Dec 15 04:44:06 2015 New Revision: 292246 URL: https://svnweb.freebsd.org/changeset/base/292246 Log: [ar71xx] always count interrupts, spurious or otherwise. This aids in debugging. Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Tue Dec 15 04:43:28 2015 (r292245) +++ head/sys/mips/atheros/apb.c Tue Dec 15 04:44:06 2015 (r292246) @@ -378,6 +378,8 @@ apb_filter(void *arg) } event = sc->sc_eventstab[irq]; + /* always count interrupts; spurious or otherwise */ + mips_intrcnt_inc(sc->sc_intr_counter[irq]); if (!event || TAILQ_EMPTY(&event->ie_handlers)) { if (irq == APB_INTR_PMC) { td = PCPU_GET(curthread); @@ -385,9 +387,6 @@ apb_filter(void *arg) if (pmc_intr) (*pmc_intr)(PCPU_GET(cpuid), tf); - - mips_intrcnt_inc(sc->sc_intr_counter[irq]); - continue; } /* Ignore timer interrupts */ @@ -397,7 +396,6 @@ apb_filter(void *arg) } intr_event_handle(event, PCPU_GET(curthread)->td_intr_frame); - mips_intrcnt_inc(sc->sc_intr_counter[irq]); } } From owner-svn-src-all@freebsd.org Tue Dec 15 04:45:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDBD0A43F45; Tue, 15 Dec 2015 04:45:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B07A712EF; Tue, 15 Dec 2015 04:45:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF4j0ms088769; Tue, 15 Dec 2015 04:45:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF4j0WT088768; Tue, 15 Dec 2015 04:45:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512150445.tBF4j0WT088768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 15 Dec 2015 04:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292247 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 04:45:02 -0000 Author: adrian Date: Tue Dec 15 04:45:00 2015 New Revision: 292247 URL: https://svnweb.freebsd.org/changeset/base/292247 Log: [qca953x] remove unneeded initialisation. This was copied from another chip file and it's not required on Honeybee. Tested: * AP143, QCA9531 SoC. Obtained from: OpenWRT Modified: head/sys/mips/atheros/qca953x_chip.c Modified: head/sys/mips/atheros/qca953x_chip.c ============================================================================== --- head/sys/mips/atheros/qca953x_chip.c Tue Dec 15 04:44:06 2015 (r292246) +++ head/sys/mips/atheros/qca953x_chip.c Tue Dec 15 04:45:00 2015 (r292247) @@ -196,7 +196,7 @@ qca953x_chip_set_pll_ge(int unit, int sp ATH_WRITE_REG(QCA953X_PLL_ETH_XMII_CONTROL_REG, pll); break; case 1: - ATH_WRITE_REG(QCA953X_PLL_ETH_SGMII_CONTROL_REG, pll); + /* nothing */ break; default: printf("%s: invalid PLL set for arge unit: %d\n", From owner-svn-src-all@freebsd.org Tue Dec 15 04:46:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A150A440AF; Tue, 15 Dec 2015 04:46:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A61B1528; Tue, 15 Dec 2015 04:46:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF4knm0088864; Tue, 15 Dec 2015 04:46:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF4knLr088863; Tue, 15 Dec 2015 04:46:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512150446.tBF4knLr088863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 15 Dec 2015 04:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292248 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 04:46:50 -0000 Author: adrian Date: Tue Dec 15 04:46:48 2015 New Revision: 292248 URL: https://svnweb.freebsd.org/changeset/base/292248 Log: [arswitch] bump the number of ports on the ar934x internal switch. It indeed has more ports by default. Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Tue Dec 15 04:45:00 2015 (r292247) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Tue Dec 15 04:46:48 2015 (r292248) @@ -154,10 +154,10 @@ ar9340_hw_global_setup(struct arswitch_s arswitch_modifyreg(sc->sc_dev, AR934X_REG_OPER_MODE1, AR934X_REG_OPER_MODE1_PHY4_MII_EN, AR934X_REG_OPER_MODE1_PHY4_MII_EN); - sc->info.es_nports = 4; + sc->info.es_nports = 5; } else { device_printf(sc->sc_dev, "%s: PHY4 - Local\n", __func__); - sc->info.es_nports = 5; + sc->info.es_nports = 6; } /* Settle time */ From owner-svn-src-all@freebsd.org Tue Dec 15 04:51:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 358C4A44526; Tue, 15 Dec 2015 04:51:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBCF41A9A; Tue, 15 Dec 2015 04:51:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF4ppsV091503; Tue, 15 Dec 2015 04:51:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF4ppTu091502; Tue, 15 Dec 2015 04:51:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512150451.tBF4ppTu091502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 15 Dec 2015 04:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292249 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 04:51:52 -0000 Author: mav Date: Tue Dec 15 04:51:50 2015 New Revision: 292249 URL: https://svnweb.freebsd.org/changeset/base/292249 Log: Add MSI-X support for 26XX cards. Unlike previous, this generation does not support regular MSIs any more. Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Tue Dec 15 04:46:48 2015 (r292248) +++ head/sys/dev/isp/isp_pci.c Tue Dec 15 04:51:50 2015 (r292249) @@ -373,11 +373,14 @@ struct isp_pcisoftc { ispsoftc_t pci_isp; device_t pci_dev; struct resource * regs; + struct resource * regs1; struct resource * regs2; void * irq; int iqd; int rtp; int rgd; + int rtp1; + int rgd1; int rtp2; int rgd2; void * ih; @@ -829,6 +832,10 @@ isp_pci_attach(device_t dev) pcs->rgd = PCIR_BAR(0); pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); + pcs->rtp1 = SYS_RES_MEMORY; + pcs->rgd1 = PCIR_BAR(2); + pcs->regs1 = bus_alloc_resource_any(dev, pcs->rtp1, &pcs->rgd1, + RF_ACTIVE); pcs->rtp2 = SYS_RES_MEMORY; pcs->rgd2 = PCIR_BAR(4); pcs->regs2 = bus_alloc_resource_any(dev, pcs->rtp2, &pcs->rgd2, @@ -936,20 +943,28 @@ isp_pci_attach(device_t dev) data &= ~1; pci_write_config(dev, PCIR_ROMADDR, data, 4); - /* - * Do MSI - * - * NB: MSI-X needs to be disabled for the 2432 (PCI-Express) - */ - if (IS_24XX(isp) || IS_2322(isp)) { - pcs->msicount = pci_msi_count(dev); - if (pcs->msicount > 1) { - pcs->msicount = 1; + if (IS_26XX(isp)) { + /* 26XX chips support only MSI-X, so start from them. */ + pcs->msicount = imin(pci_msix_count(dev), 1); + if (pcs->msicount > 0 && + (i = pci_alloc_msix(dev, &pcs->msicount)) == 0) { + pcs->iqd = 1; + } else { + pcs->msicount = 0; } - if (pci_alloc_msi(dev, &pcs->msicount) == 0) { + } + if (pcs->msicount == 0 && (IS_24XX(isp) || IS_2322(isp))) { + /* + * Older chips support both MSI and MSI-X, but I have + * feeling that older firmware may not support MSI-X, + * but we have no way to check the firmware flag here. + */ + pcs->msicount = imin(pci_msi_count(dev), 1); + if (pcs->msicount > 0 && + pci_alloc_msi(dev, &pcs->msicount) == 0) { pcs->iqd = 1; } else { - pcs->iqd = 0; + pcs->msicount = 0; } } pcs->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &pcs->iqd, RF_ACTIVE | RF_SHAREABLE); @@ -1006,6 +1021,8 @@ bad: } if (pcs->regs) (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); + if (pcs->regs1) + (void) bus_release_resource(dev, pcs->rtp1, pcs->rgd1, pcs->regs1); if (pcs->regs2) (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2); if (pcs->pci_isp.isp_param) { @@ -1046,6 +1063,8 @@ isp_pci_detach(device_t dev) pci_release_msi(dev); } (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); + if (pcs->regs1) + (void) bus_release_resource(dev, pcs->rtp1, pcs->rgd1, pcs->regs1); if (pcs->regs2) (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2); /* From owner-svn-src-all@freebsd.org Tue Dec 15 05:37:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4272DA44056; Tue, 15 Dec 2015 05:37:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02FB810FE; Tue, 15 Dec 2015 05:37:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF5bAwG004281; Tue, 15 Dec 2015 05:37:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF5b93G004276; Tue, 15 Dec 2015 05:37:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512150537.tBF5b93G004276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 05:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292250 - head/lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 05:37:11 -0000 Author: ngie Date: Tue Dec 15 05:37:09 2015 New Revision: 292250 URL: https://svnweb.freebsd.org/changeset/base/292250 Log: Allow users override `DEBUG` on the command line via DEBUG_FLAGS="-DDEBUG" with lib/libc/resolv by conditionalizing its definition MFC after: 3 days Reviewed by: ume, vangyzen Differential Revision: https://reviews.freebsd.org/D4519 Modified: head/lib/libc/resolv/res_init.c head/lib/libc/resolv/res_mkquery.c head/lib/libc/resolv/res_mkupdate.c head/lib/libc/resolv/res_query.c head/lib/libc/resolv/res_send.c Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Tue Dec 15 04:51:50 2015 (r292249) +++ head/lib/libc/resolv/res_init.c Tue Dec 15 05:37:09 2015 (r292250) @@ -116,7 +116,9 @@ __FBSDID("$FreeBSD$"); /*% Options. Should all be left alone. */ #define RESOLVSORT -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #ifdef SOLARIS2 #include Modified: head/lib/libc/resolv/res_mkquery.c ============================================================================== --- head/lib/libc/resolv/res_mkquery.c Tue Dec 15 04:51:50 2015 (r292249) +++ head/lib/libc/resolv/res_mkquery.c Tue Dec 15 05:37:09 2015 (r292250) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif extern const char *_res_opcodes[]; Modified: head/lib/libc/resolv/res_mkupdate.c ============================================================================== --- head/lib/libc/resolv/res_mkupdate.c Tue Dec 15 04:51:50 2015 (r292249) +++ head/lib/libc/resolv/res_mkupdate.c Tue Dec 15 05:37:09 2015 (r292250) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #define MAXPORT 1024 static int getnum_str(u_char **, u_char *); Modified: head/lib/libc/resolv/res_query.c ============================================================================== --- head/lib/libc/resolv/res_query.c Tue Dec 15 04:51:50 2015 (r292249) +++ head/lib/libc/resolv/res_query.c Tue Dec 15 05:37:09 2015 (r292250) @@ -88,7 +88,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ Modified: head/lib/libc/resolv/res_send.c ============================================================================== --- head/lib/libc/resolv/res_send.c Tue Dec 15 04:51:50 2015 (r292249) +++ head/lib/libc/resolv/res_send.c Tue Dec 15 05:37:09 2015 (r292250) @@ -119,7 +119,9 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #include "res_debug.h" #include "res_private.h" From owner-svn-src-all@freebsd.org Tue Dec 15 05:47:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D6DA446F1; Tue, 15 Dec 2015 05:47:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DFBB1604; Tue, 15 Dec 2015 05:47:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF5l5U2007095; Tue, 15 Dec 2015 05:47:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF5l5cB007094; Tue, 15 Dec 2015 05:47:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512150547.tBF5l5cB007094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 05:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292251 - stable/10/tools/regression/mac/mac_portacl 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 05:47:06 -0000 Author: ngie Date: Tue Dec 15 05:47:05 2015 New Revision: 292251 URL: https://svnweb.freebsd.org/changeset/base/292251 Log: MFC r291982: Skip the MAC portacl tests if MAC_PORTACL support is missing instead of marking them failed Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/mac/mac_portacl/misc.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/mac/mac_portacl/misc.sh ============================================================================== --- stable/10/tools/regression/mac/mac_portacl/misc.sh Tue Dec 15 05:37:09 2015 (r292250) +++ stable/10/tools/regression/mac/mac_portacl/misc.sh Tue Dec 15 05:47:05 2015 (r292251) @@ -3,8 +3,7 @@ sysctl security.mac.portacl >/dev/null 2>&1 if [ $? -ne 0 ]; then - echo "1..1" - echo "not ok 1 # MAC_PORTACL is unavailable." + echo "1..0 # SKIP MAC_PORTACL is unavailable." exit 0 fi From owner-svn-src-all@freebsd.org Tue Dec 15 05:47:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C304AA44795; Tue, 15 Dec 2015 05:47:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9019D182B; Tue, 15 Dec 2015 05:47:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF5lu4M007183; Tue, 15 Dec 2015 05:47:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF5luRu007182; Tue, 15 Dec 2015 05:47:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512150547.tBF5luRu007182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 05:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292252 - stable/9/tools/regression/mac/mac_portacl 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 05:47:57 -0000 Author: ngie Date: Tue Dec 15 05:47:56 2015 New Revision: 292252 URL: https://svnweb.freebsd.org/changeset/base/292252 Log: MFstable/10 r292251: MFC r291982: Skip the MAC portacl tests if MAC_PORTACL support is missing instead of marking them failed Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/mac/mac_portacl/misc.sh Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/mac/mac_portacl/misc.sh ============================================================================== --- stable/9/tools/regression/mac/mac_portacl/misc.sh Tue Dec 15 05:47:05 2015 (r292251) +++ stable/9/tools/regression/mac/mac_portacl/misc.sh Tue Dec 15 05:47:56 2015 (r292252) @@ -3,8 +3,7 @@ sysctl security.mac.portacl >/dev/null 2>&1 if [ $? -ne 0 ]; then - echo "1..1" - echo "not ok 1 # MAC_PORTACL is unavailable." + echo "1..0 # SKIP MAC_PORTACL is unavailable." exit 0 fi From owner-svn-src-all@freebsd.org Tue Dec 15 06:01:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C023A477FF; Tue, 15 Dec 2015 06:01:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 188D21D4D; Tue, 15 Dec 2015 06:01:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF6132G012902; Tue, 15 Dec 2015 06:01:03 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF613n0012901; Tue, 15 Dec 2015 06:01:03 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512150601.tBF613n0012901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 15 Dec 2015 06:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292253 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 06:01:04 -0000 Author: kevlo Date: Tue Dec 15 06:01:02 2015 New Revision: 292253 URL: https://svnweb.freebsd.org/changeset/base/292253 Log: Fix a typo (opencrypto -> crypto) and remove useless comment. Modified: head/share/man/man4/crypto.4 Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Tue Dec 15 05:47:56 2015 (r292252) +++ head/share/man/man4/crypto.4 Tue Dec 15 06:01:02 2015 (r292253) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2014 +.Dd December 15, 2015 .Dt CRYPTO 4 .Os .Sh NAME @@ -79,7 +79,7 @@ The .Nm driver gives user-mode applications access to hardware-accelerated cryptographic transforms, as implemented by the -.Xr opencrypto 9 +.Xr crypto 9 in-kernel interface. .Pp The @@ -99,9 +99,6 @@ variables, .Ic kern.userasymcrypto and .Ic kern.cryptodevallowsoft . -See -.Xr sysctl 7 -for additional details. .Pp The .Nm From owner-svn-src-all@freebsd.org Tue Dec 15 09:02:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2EA9A434D5; Tue, 15 Dec 2015 09:02:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9179F1FD8; Tue, 15 Dec 2015 09:02:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF925eK064764; Tue, 15 Dec 2015 09:02:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF925cx064761; Tue, 15 Dec 2015 09:02:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512150902.tBF925cx064761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Dec 2015 09:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292254 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 09:02:07 -0000 Author: hselasky Date: Tue Dec 15 09:02:05 2015 New Revision: 292254 URL: https://svnweb.freebsd.org/changeset/base/292254 Log: Properly drain callouts in the IPFW subsystem to avoid use after free panics when unloading the dummynet and IPFW modules: - The callout drain function can sleep and should not be called having a non-sleepable lock locked. Remove locks around "ipfw_dyn_uninit(0)". - Add a new "dn_gone" variable to prevent asynchronous restart of dummynet callouts when unloading the dummynet kernel module. - Call "dn_reschedule()" locked so that "dn_gone" can be set and checked atomically with regard to starting a new callout. Reviewed by: hiren MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3855 Modified: head/sys/netpfil/ipfw/ip_dn_io.c head/sys/netpfil/ipfw/ip_dummynet.c head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Tue Dec 15 06:01:02 2015 (r292253) +++ head/sys/netpfil/ipfw/ip_dn_io.c Tue Dec 15 09:02:05 2015 (r292254) @@ -711,8 +711,8 @@ dummynet_task(void *context, int pending dn_drain_queue(); } - DN_BH_WUNLOCK(); dn_reschedule(); + DN_BH_WUNLOCK(); if (q.head != NULL) dummynet_send(q.head); CURVNET_RESTORE(); Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Tue Dec 15 06:01:02 2015 (r292253) +++ head/sys/netpfil/ipfw/ip_dummynet.c Tue Dec 15 09:02:05 2015 (r292254) @@ -75,6 +75,7 @@ struct schk_new_arg { /*---- callout hooks. ----*/ static struct callout dn_timeout; +static int dn_gone; static struct task dn_task; static struct taskqueue *dn_tq = NULL; @@ -90,6 +91,8 @@ void dn_reschedule(void) { + if (dn_gone != 0) + return; callout_reset_sbt(&dn_timeout, tick_sbt, 0, dummynet, NULL, C_HARDCLOCK | C_DIRECT_EXEC); } @@ -2179,9 +2182,11 @@ ip_dn_init(void) static void ip_dn_destroy(int last) { - callout_drain(&dn_timeout); - DN_BH_WLOCK(); + /* ensure no more callouts are started */ + dn_gone = 1; + + /* check for last */ if (last) { ND("removing last instance\n"); ip_dn_ctl_ptr = NULL; @@ -2190,6 +2195,8 @@ ip_dn_destroy(int last) dummynet_flush(); DN_BH_WUNLOCK(); + + callout_drain(&dn_timeout); taskqueue_drain(dn_tq, &dn_task); taskqueue_free(dn_tq); Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Tue Dec 15 06:01:02 2015 (r292253) +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Dec 15 09:02:05 2015 (r292254) @@ -2814,11 +2814,10 @@ vnet_ipfw_uninit(const void *unused) IPFW_UH_WLOCK(chain); IPFW_UH_WUNLOCK(chain); - IPFW_UH_WLOCK(chain); - IPFW_WLOCK(chain); ipfw_dyn_uninit(0); /* run the callout_drain */ - IPFW_WUNLOCK(chain); + + IPFW_UH_WLOCK(chain); reap = NULL; IPFW_WLOCK(chain); From owner-svn-src-all@freebsd.org Tue Dec 15 09:58:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 559F8A43AFF; Tue, 15 Dec 2015 09:58:26 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 1D8AF1CCE; Tue, 15 Dec 2015 09:58:25 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: by vlakno.cz (Postfix, from userid 1002) id 3E1B01E2232B; Tue, 15 Dec 2015 10:56:04 +0100 (CET) Date: Tue, 15 Dec 2015 10:56:04 +0100 From: Roman Divacky To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292236 - in head: contrib/mdocml lib lib/libc/sys lib/libsysdecode share/mk usr.bin/kdump usr.bin/truss Message-ID: <20151215095604.GA28067@vlakno.cz> References: <201512150005.tBF057l2097434@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512150005.tBF057l2097434@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 09:58:26 -0000 On Tue, Dec 15, 2015 at 12:05:07AM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Dec 15 00:05:07 2015 > New Revision: 292236 > URL: https://svnweb.freebsd.org/changeset/base/292236 > > Log: > Start on a new library (libsysdecode) that provides routines for decoding > system call information such as system call arguments. Initially this > will consist of pulling duplicated code out of truss and kdump though it > may prove useful for other utilities in the future. > > This commit moves the shared utrace(2) record parser out of kdump into > the library and updates kdump and truss to use it. One difference from > the previous version is that the library version treats unknown events > that start with the "RTLD" signature as unknown events. This simplifies > the interface and allows the consumer to decide how to handle all > non-recognized events. Instead, this function only generates a string > description for known malloc() and RTLD records. > > Reviewed by: bdrewery > Differential Revision: https://reviews.freebsd.org/D4537 > > Added: > head/lib/libsysdecode/ > head/lib/libsysdecode/Makefile (contents, props changed) > head/lib/libsysdecode/sysdecode.3 (contents, props changed) > head/lib/libsysdecode/sysdecode.h (contents, props changed) > head/lib/libsysdecode/sysdecode_utrace.3 (contents, props changed) > head/lib/libsysdecode/utrace.c > - copied, changed from r292235, head/usr.bin/kdump/utrace.c > Deleted: > head/usr.bin/kdump/utrace.c > Modified: > head/contrib/mdocml/lib.in > head/lib/Makefile > head/lib/libc/sys/utrace.2 > head/share/mk/bsd.libnames.mk > head/share/mk/src.libnames.mk > head/usr.bin/kdump/Makefile > head/usr.bin/kdump/Makefile.depend > head/usr.bin/kdump/kdump.c > head/usr.bin/truss/Makefile > head/usr.bin/truss/Makefile.depend.amd64 > head/usr.bin/truss/syscalls.c > > Modified: head/contrib/mdocml/lib.in > ============================================================================== > --- head/contrib/mdocml/lib.in Mon Dec 14 23:25:31 2015 (r292235) > +++ head/contrib/mdocml/lib.in Tue Dec 15 00:05:07 2015 (r292236) > @@ -110,6 +110,7 @@ LINE("libsdp", "Bluetooth Service Disco > LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") > LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") > LINE("libSystem", "System Library (libSystem, \\-lSystem)") > +LINE("libsysdcode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") Is this a typo? From owner-svn-src-all@freebsd.org Tue Dec 15 10:07:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA3DAA441FC; Tue, 15 Dec 2015 10:07:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD25412F9; Tue, 15 Dec 2015 10:07:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFA73CF082482; Tue, 15 Dec 2015 10:07:03 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFA73tp082481; Tue, 15 Dec 2015 10:07:03 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512151007.tBFA73tp082481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 15 Dec 2015 10:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292255 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 10:07:05 -0000 Author: royger Date: Tue Dec 15 10:07:03 2015 New Revision: 292255 URL: https://svnweb.freebsd.org/changeset/base/292255 Log: x86/bounce: try to always completely fill bounce pages Current code doesn't try to make use of the full page when bouncing because the size is only expanded to be a multiple of the alignment. Instead try to always create segments of PAGE_SIZE when using bounce pages. This allows us to remove the specific casing done for BUS_DMA_KEEP_PG_OFFSET, since the requirement is to make sure the offsets into contiguous segments are aligned, and now this is done by default. Sponsored by: Citrix Systems R&D Reviewed by: hps, kib Differential revision: https://reviews.freebsd.org/D4119 Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue Dec 15 09:02:05 2015 (r292254) +++ head/sys/x86/x86/busdma_bounce.c Tue Dec 15 10:07:03 2015 (r292255) @@ -476,8 +476,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma while (buflen != 0) { sgsize = MIN(buflen, dmat->common.maxsegsz); if (bus_dma_run_filter(&dmat->common, curaddr)) { - sgsize = MIN(sgsize, - PAGE_SIZE - (curaddr & PAGE_MASK)); + sgsize = MIN(PAGE_SIZE, sgsize); map->pagesneeded++; } curaddr += sgsize; @@ -517,8 +516,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm else paddr = pmap_extract(pmap, vaddr); if (bus_dma_run_filter(&dmat->common, paddr) != 0) { - sg_len = roundup2(sg_len, - dmat->common.alignment); + sg_len = PAGE_SIZE; map->pagesneeded++; } vaddr += sg_len; @@ -554,9 +552,7 @@ _bus_dmamap_count_ma(bus_dma_tag_t dmat, max_sgsize = MIN(buflen, dmat->common.maxsegsz); sg_len = MIN(sg_len, max_sgsize); if (bus_dma_run_filter(&dmat->common, paddr) != 0) { - sg_len = roundup2(sg_len, - dmat->common.alignment); - sg_len = MIN(sg_len, max_sgsize); + sg_len = MIN(PAGE_SIZE, max_sgsize); KASSERT((sg_len & (dmat->common.alignment - 1)) == 0, ("Segment size is not aligned")); map->pagesneeded++; @@ -652,7 +648,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ int *segp) { bus_size_t sgsize; - bus_addr_t curaddr; + bus_addr_t curaddr, nextaddr; int error; if (map == NULL) @@ -676,9 +672,12 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { - sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); - curaddr = add_bounce_page(dmat, map, 0, curaddr, 0, - sgsize); + nextaddr = 0; + sgsize = MIN(PAGE_SIZE, sgsize); + if ((curaddr & PAGE_MASK) + sgsize > PAGE_SIZE) + nextaddr = roundup2(curaddr, PAGE_SIZE); + curaddr = add_bounce_page(dmat, map, 0, curaddr, + nextaddr, sgsize); } sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, segp); @@ -744,8 +743,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { - sgsize = roundup2(sgsize, dmat->common.alignment); - sgsize = MIN(sgsize, max_sgsize); + sgsize = MIN(PAGE_SIZE, max_sgsize); curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, 0, sgsize); } else { @@ -774,17 +772,6 @@ bounce_bus_dmamap_load_ma(bus_dma_tag_t int error, page_index; bus_size_t sgsize, max_sgsize; - if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { - /* - * If we have to keep the offset of each page this function - * is not suitable, switch back to bus_dmamap_load_ma_triv - * which is going to do the right thing in this case. - */ - error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs, - flags, segs, segp); - return (error); - } - if (map == NULL) map = &nobounce_dmamap; @@ -811,10 +798,7 @@ bounce_bus_dmamap_load_ma(bus_dma_tag_t if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, paddr)) { - sgsize = roundup2(sgsize, dmat->common.alignment); - sgsize = MIN(sgsize, max_sgsize); - KASSERT((sgsize & (dmat->common.alignment - 1)) == 0, - ("Segment size is not aligned")); + sgsize = MIN(PAGE_SIZE, max_sgsize); /* * Check if two pages of the user provided buffer * are used. @@ -1175,13 +1159,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bz->active_bpages++; mtx_unlock(&bounce_lock); - if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { - /* Page offset needs to be preserved. */ - bpage->vaddr |= addr1 & PAGE_MASK; - bpage->busaddr |= addr1 & PAGE_MASK; - KASSERT(addr2 == 0, - ("Trying to bounce multiple pages with BUS_DMA_KEEP_PG_OFFSET")); - } bpage->datavaddr = vaddr; bpage->datapage[0] = PHYS_TO_VM_PAGE(addr1); KASSERT((addr2 & PAGE_MASK) == 0, ("Second page is not aligned")); @@ -1201,15 +1178,6 @@ free_bounce_page(bus_dma_tag_t dmat, str bz = dmat->bounce_zone; bpage->datavaddr = 0; bpage->datacount = 0; - if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { - /* - * Reset the bounce page to start at offset 0. Other uses - * of this bounce page may need to store a full page of - * data and/or assume it starts on a page boundary. - */ - bpage->vaddr &= ~PAGE_MASK; - bpage->busaddr &= ~PAGE_MASK; - } mtx_lock(&bounce_lock); STAILQ_INSERT_HEAD(&bz->bounce_page_list, bpage, links); From owner-svn-src-all@freebsd.org Tue Dec 15 10:24:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5395AA47864; Tue, 15 Dec 2015 10:24:49 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 230DF129D; Tue, 15 Dec 2015 10:24:49 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFAOm4m088353; Tue, 15 Dec 2015 10:24:48 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFAOmuC088352; Tue, 15 Dec 2015 10:24:48 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512151024.tBFAOmuC088352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 15 Dec 2015 10:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292256 - head/lib/lib80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 10:24:49 -0000 Author: brueffer Date: Tue Dec 15 10:24:48 2015 New Revision: 292256 URL: https://svnweb.freebsd.org/changeset/base/292256 Log: Minor spelling, mdoc and style cleanup. Modified: head/lib/lib80211/lib80211.3 Modified: head/lib/lib80211/lib80211.3 ============================================================================== --- head/lib/lib80211/lib80211.3 Tue Dec 15 10:07:03 2015 (r292255) +++ head/lib/lib80211/lib80211.3 Tue Dec 15 10:24:48 2015 (r292256) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2015 +.Dd December 15, 2015 .Dt 80211 3 .Os .Sh NAME @@ -87,14 +87,14 @@ The .Fn lib80211_regdomain_findbysku and .Fn lib80211_regdomain_findbyname -functions lookup a regulatory domain entry by SKU enum and SKU name +functions look up a regulatory domain entry by SKU enum and SKU name respectively. .Pp The .Fn lib80211_country_findbycc and .Fn lib80211_country_findbyname -functions lookup a country information entry by ISO country enum and +functions look up a country information entry by ISO country enum and ISO country code string respectively. .Sh RETURN VALUES The @@ -104,11 +104,12 @@ The .Fn lib80211_regdomain_findbyname , .Fn lib80211_country_findbycc , .Fn lib80211_country_findbyname -return NULL upon error. - +return +.Dv NULL +upon error. .Sh SEE ALSO -.Xr ifconfig 8 , -.Xr net80211 4 +.Xr net80211 4 , +.Xr ifconfig 8 .Sh HISTORY The .Nm lib80211 From owner-svn-src-all@freebsd.org Tue Dec 15 10:26:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D4CBA47D1D; Tue, 15 Dec 2015 10:26:49 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2E1814CA; Tue, 15 Dec 2015 10:26:48 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFAQloP088460; Tue, 15 Dec 2015 10:26:47 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFAQllD088459; Tue, 15 Dec 2015 10:26:47 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512151026.tBFAQllD088459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 15 Dec 2015 10:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292257 - head/contrib/mdocml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 10:26:49 -0000 Author: brueffer Date: Tue Dec 15 10:26:47 2015 New Revision: 292257 URL: https://svnweb.freebsd.org/changeset/base/292257 Log: Add entry for lib80211; fix a typo in libsysdecode. Modified: head/contrib/mdocml/lib.in Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Tue Dec 15 10:24:48 2015 (r292256) +++ head/contrib/mdocml/lib.in Tue Dec 15 10:26:47 2015 (r292257) @@ -24,6 +24,7 @@ * Be sure to escape strings. */ +LINE("lib80211", "802.11 Wireless Network Management Library (lib80211, \\-l80211)") LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") @@ -110,7 +111,7 @@ LINE("libsdp", "Bluetooth Service Disco LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") LINE("libSystem", "System Library (libSystem, \\-lSystem)") -LINE("libsysdcode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") +LINE("libsysdecode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") LINE("libtacplus", "TACACS+ Client Library (libtacplus, \\-ltacplus)") LINE("libtcplay", "TrueCrypt-compatible API library (libtcplay, \\-ltcplay)") LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)") From owner-svn-src-all@freebsd.org Tue Dec 15 10:28:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAC9EA47E8D; Tue, 15 Dec 2015 10:28:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (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 31BAA174D; Tue, 15 Dec 2015 10:28:04 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from [130.235.5.34] ([130.235.5.34]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0M4Nqe-1aRIDw3pwS-00yj2I; Tue, 15 Dec 2015 11:27:57 +0100 Subject: Re: svn commit: r292236 - in head: contrib/mdocml lib lib/libc/sys lib/libsysdecode share/mk usr.bin/kdump usr.bin/truss To: Roman Divacky , John Baldwin References: <201512150005.tBF057l2097434@repo.freebsd.org> <20151215095604.GA28067@vlakno.cz> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Christian Brueffer Message-ID: <566FE95B.4010702@FreeBSD.org> Date: Tue, 15 Dec 2015 11:20:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151215095604.GA28067@vlakno.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:IVT2/dyNOVmlEClbfu6z+pHJxvls5fv1SbycJKn3DmV9QBnM+oS asyfn6Kg7BPkdoxVUCd4efW36C6Cnann5fhCLjyyvvts6w4yKEZ4CorKuA2I/LPzTxxanjr kpHP+Uhlmi56UEjNJnMsR8yOaFkPRTrdLLU8iyHdIZG1iuio1PqSKyEMdmvhji9tUsij7HY gNjW5JI03AtkEFIfsmLaw== X-UI-Out-Filterresults: notjunk:1;V01:K0:nKDLAuH7QL8=:TGQFKtucDuAw7cbjTIThWE px/yZrls4+WxZvE6G4XUAeKHOcuaewSdEyXifYxtK0BsA/erB+Is1mxg8FnOQPyzigoQIPg7c R9wkroVqHrfx7qpqZQapfOQLJKYofR3OX0qzXJeyB/VqQr6T58+Ng1zyTtg93vO3IvqkiPAY3 XQvGzxBuOv05UkDNdQK44R03Eq1dR3NfvzxDsVAykDQs559+YO5HKE8xu6mMmRMf0Hjoe7JW5 QZZ+aCD0fJfZcncM9aQLPm3eo8HCPenztGs+pkvXzNV/qMBXKq9qQqX0B12JDhSZdJdvfgqbi wYQAWS5kYo5wYXMb+CtTzDXU1RjIDi0DprtHedHD8BXukmPWOnRHQ27FmMDJWtGo5Ah6qGxlG EPQVuV9r0TAWNasCbqP240Vim+k0gO2uo1upyJIF/NGVsVj3AVeb60KFWf6mgwNMY7xdRqmRt 9NV6/tG6tpbpZ6EgaBI0j2RubD/a1TFrg36419vv4YoF/IUiA7BN4E+QyD6TD5iuILlAWv+rs kUkizm3DVi/fjIbY33HgxsQ6ty3MVE53MuZ2zpX/2NtP1sFo/E2gcN4/TXt+BpGjKv+fMHXay coEGcyIcRSLlv87/QTFzHZDgX272yx9cNw1EyaEo2Qi4nV1fW1cKbgtmrs4xaFIzXFKV8EY04 K7+fI7PibMMveffZMHqN7al7i+OOKD1Rczu2fh4gY0ncgbRrMueIIptHTaqt+fDDrt/+KraLS 8d1ROGOuHclUYHWf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 10:28:05 -0000 On 2015-12-15 10:56, Roman Divacky wrote: > On Tue, Dec 15, 2015 at 12:05:07AM +0000, John Baldwin wrote: >> Author: jhb >> Date: Tue Dec 15 00:05:07 2015 >> New Revision: 292236 >> URL: https://svnweb.freebsd.org/changeset/base/292236 >> >> Log: >> Start on a new library (libsysdecode) that provides routines for decoding >> system call information such as system call arguments. Initially this >> will consist of pulling duplicated code out of truss and kdump though it >> may prove useful for other utilities in the future. >> >> This commit moves the shared utrace(2) record parser out of kdump into >> the library and updates kdump and truss to use it. One difference from >> the previous version is that the library version treats unknown events >> that start with the "RTLD" signature as unknown events. This simplifies >> the interface and allows the consumer to decide how to handle all >> non-recognized events. Instead, this function only generates a string >> description for known malloc() and RTLD records. >> >> Reviewed by: bdrewery >> Differential Revision: https://reviews.freebsd.org/D4537 >> >> Added: >> head/lib/libsysdecode/ >> head/lib/libsysdecode/Makefile (contents, props changed) >> head/lib/libsysdecode/sysdecode.3 (contents, props changed) >> head/lib/libsysdecode/sysdecode.h (contents, props changed) >> head/lib/libsysdecode/sysdecode_utrace.3 (contents, props changed) >> head/lib/libsysdecode/utrace.c >> - copied, changed from r292235, head/usr.bin/kdump/utrace.c >> Deleted: >> head/usr.bin/kdump/utrace.c >> Modified: >> head/contrib/mdocml/lib.in >> head/lib/Makefile >> head/lib/libc/sys/utrace.2 >> head/share/mk/bsd.libnames.mk >> head/share/mk/src.libnames.mk >> head/usr.bin/kdump/Makefile >> head/usr.bin/kdump/Makefile.depend >> head/usr.bin/kdump/kdump.c >> head/usr.bin/truss/Makefile >> head/usr.bin/truss/Makefile.depend.amd64 >> head/usr.bin/truss/syscalls.c >> >> Modified: head/contrib/mdocml/lib.in >> ============================================================================== >> --- head/contrib/mdocml/lib.in Mon Dec 14 23:25:31 2015 (r292235) >> +++ head/contrib/mdocml/lib.in Tue Dec 15 00:05:07 2015 (r292236) >> @@ -110,6 +110,7 @@ LINE("libsdp", "Bluetooth Service Disco >> LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") >> LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") >> LINE("libSystem", "System Library (libSystem, \\-lSystem)") >> +LINE("libsysdcode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") > > Is this a typo? > It is; fixed in r292257. Good spotting! Chris From owner-svn-src-all@freebsd.org Tue Dec 15 11:20:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61C6BA47D05; Tue, 15 Dec 2015 11:20:21 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5881375; Tue, 15 Dec 2015 11:20:21 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFBKKSF003308; Tue, 15 Dec 2015 11:20:20 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFBKK4S003307; Tue, 15 Dec 2015 11:20:20 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512151120.tBFBKK4S003307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 15 Dec 2015 11:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292258 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 11:20:21 -0000 Author: royger Date: Tue Dec 15 11:20:20 2015 New Revision: 292258 URL: https://svnweb.freebsd.org/changeset/base/292258 Log: hyperv/kvp: wake up the daemon if it's sleeping due to poll() Without the patch, there is a race condition: when poll() is invoked(), if kvp_globals.daemon_busy is false, the daemon won't be timely woke up, because hv_kvp_send_msg_to_daemon() can't wake up the daemon in this case. Submitted by: Dexuan Cui Sponsored by: Microsoft OSTC Reviewed by: delphij, royger MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D4258 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Tue Dec 15 10:26:47 2015 (r292257) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Tue Dec 15 11:20:20 2015 (r292258) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,6 +115,8 @@ static struct cdev *hv_kvp_dev; static struct hv_kvp_msg *hv_kvp_dev_buf; struct proc *daemon_task; +static struct selinfo hv_kvp_selinfo; + /* * Global state to track and synchronize multiple * KVP transaction requests from the host. @@ -628,6 +631,9 @@ hv_kvp_send_msg_to_daemon(void) /* Send the msg to user via function deamon_read - setting sema */ sema_post(&kvp_globals.dev_sema); + + /* We should wake up the daemon, in case it's doing poll() */ + selwakeup(&hv_kvp_selinfo); } @@ -940,7 +946,7 @@ hv_kvp_dev_daemon_write(struct cdev *dev * for daemon to read. */ static int -hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td __unused) +hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td) { int revents = 0; @@ -953,6 +959,9 @@ hv_kvp_dev_daemon_poll(struct cdev *dev */ if (kvp_globals.daemon_busy == true) revents = POLLIN; + else + selrecord(td, &hv_kvp_selinfo); + mtx_unlock(&kvp_globals.pending_mutex); return (revents); From owner-svn-src-all@freebsd.org Tue Dec 15 12:52:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2481FA4317A; Tue, 15 Dec 2015 12:52:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAD5819E0; Tue, 15 Dec 2015 12:51:59 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFCpxoZ031739; Tue, 15 Dec 2015 12:51:59 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFCpxIY031738; Tue, 15 Dec 2015 12:51:59 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201512151251.tBFCpxIY031738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Dec 2015 12:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292259 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 12:52:00 -0000 Author: mmel Date: Tue Dec 15 12:51:58 2015 New Revision: 292259 URL: https://svnweb.freebsd.org/changeset/base/292259 Log: ARM: option PPC_PROBE_CHIPSET is applicable only for x86. Don't enable it for ARM LINT config. Approved by: kib (mentor) Modified: head/sys/arm/conf/NOTES Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Tue Dec 15 11:20:20 2015 (r292258) +++ head/sys/arm/conf/NOTES Tue Dec 15 12:51:58 2015 (r292259) @@ -58,6 +58,7 @@ nooptions SMP nooptions MAXCPU nooptions COMPAT_FREEBSD4 +nooption PPC_PROBE_CHIPSET nodevice fdc nodevice sym From owner-svn-src-all@freebsd.org Tue Dec 15 12:52:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E65AA4323A; Tue, 15 Dec 2015 12:52:46 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FDF11BC7; Tue, 15 Dec 2015 12:52:46 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFCqjPk031811; Tue, 15 Dec 2015 12:52:45 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFCqjns031809; Tue, 15 Dec 2015 12:52:45 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201512151252.tBFCqjns031809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Dec 2015 12:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292260 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 12:52:46 -0000 Author: mmel Date: Tue Dec 15 12:52:45 2015 New Revision: 292260 URL: https://svnweb.freebsd.org/changeset/base/292260 Log: ARM: Remove outdated katelib.h. Approved by: kib (mentor) Deleted: head/sys/arm/include/katelib.h Modified: head/sys/arm/arm/trap.c head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Tue Dec 15 12:51:58 2015 (r292259) +++ head/sys/arm/arm/trap.c Tue Dec 15 12:52:45 2015 (r292260) @@ -109,6 +109,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define ReadWord(a) (*((volatile unsigned int *)(a))) + extern char fusubailout[]; #ifdef DEBUG Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue Dec 15 12:51:58 2015 (r292259) +++ head/sys/arm/include/cpufunc.h Tue Dec 15 12:52:45 2015 (r292260) @@ -49,7 +49,6 @@ #include #include #include -#include /* For in[bwl] and out[bwl] */ static __inline void breakpoint(void) From owner-svn-src-all@freebsd.org Tue Dec 15 12:58:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37785A43619; Tue, 15 Dec 2015 12:58:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA2581E52; Tue, 15 Dec 2015 12:58:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFCwYrk032046; Tue, 15 Dec 2015 12:58:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFCwYUl032045; Tue, 15 Dec 2015 12:58:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512151258.tBFCwYUl032045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Dec 2015 12:58: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: r292261 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 12:58:35 -0000 Author: kib Date: Tue Dec 15 12:58:33 2015 New Revision: 292261 URL: https://svnweb.freebsd.org/changeset/base/292261 Log: MFC r291576: Handle invalid pages found during the sleepable collapse scan, do not free the shadow page swap space. Combine the sleep code. Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Tue Dec 15 12:52:45 2015 (r292260) +++ stable/10/sys/vm/vm_object.c Tue Dec 15 12:58:33 2015 (r292261) @@ -1424,13 +1424,40 @@ retry: #define OBSC_COLLAPSE_NOWAIT 0x0002 #define OBSC_COLLAPSE_WAIT 0x0004 -static int +static vm_page_t +vm_object_backing_scan_wait(vm_object_t object, vm_page_t p, vm_page_t next, + int op) +{ + vm_object_t backing_object; + + VM_OBJECT_ASSERT_WLOCKED(object); + backing_object = object->backing_object; + VM_OBJECT_ASSERT_WLOCKED(backing_object); + + KASSERT(p == NULL || vm_page_busied(p), ("unbusy page %p", p)); + KASSERT(p == NULL || p->object == object || p->object == backing_object, + ("invalid ownership %p %p %p", p, object, backing_object)); + if ((op & OBSC_COLLAPSE_NOWAIT) != 0) + return (next); + if (p != NULL) + vm_page_lock(p); + VM_OBJECT_WUNLOCK(object); + VM_OBJECT_WUNLOCK(backing_object); + if (p == NULL) + VM_WAIT; + else + vm_page_busy_sleep(p, "vmocol"); + VM_OBJECT_WLOCK(object); + VM_OBJECT_WLOCK(backing_object); + return (TAILQ_FIRST(&backing_object->memq)); +} + +static bool vm_object_backing_scan(vm_object_t object, int op) { - int r = 1; - vm_page_t p; vm_object_t backing_object; - vm_pindex_t backing_offset_index; + vm_page_t next, p, pp; + vm_pindex_t backing_offset_index, new_pindex; VM_OBJECT_ASSERT_WLOCKED(object); VM_OBJECT_ASSERT_WLOCKED(object->backing_object); @@ -1452,7 +1479,7 @@ vm_object_backing_scan(vm_object_t objec * shadow test may succeed! XXX */ if (backing_object->type != OBJT_DEFAULT) { - return (0); + return (false); } } if (op & OBSC_COLLAPSE_WAIT) { @@ -1464,24 +1491,19 @@ vm_object_backing_scan(vm_object_t objec */ p = TAILQ_FIRST(&backing_object->memq); while (p) { - vm_page_t next = TAILQ_NEXT(p, listq); - vm_pindex_t new_pindex = p->pindex - backing_offset_index; - + next = TAILQ_NEXT(p, listq); + new_pindex = p->pindex - backing_offset_index; if (op & OBSC_TEST_ALL_SHADOWED) { - vm_page_t pp; - /* * Ignore pages outside the parent object's range * and outside the parent object's mapping of the * backing object. * - * note that we do not busy the backing object's + * Note that we do not busy the backing object's * page. */ - if ( - p->pindex < backing_offset_index || - new_pindex >= object->size - ) { + if (p->pindex < backing_offset_index || + new_pindex >= object->size) { p = next; continue; } @@ -1497,55 +1519,26 @@ vm_object_backing_scan(vm_object_t objec */ pp = vm_page_lookup(object, new_pindex); - if ( - (pp == NULL || pp->valid == 0) && - !vm_pager_has_page(object, new_pindex, NULL, NULL) - ) { - r = 0; - break; - } + if ((pp == NULL || pp->valid == 0) && + !vm_pager_has_page(object, new_pindex, NULL, NULL)) + return (false); } /* * Check for busy page */ if (op & (OBSC_COLLAPSE_WAIT | OBSC_COLLAPSE_NOWAIT)) { - vm_page_t pp; - - if (op & OBSC_COLLAPSE_NOWAIT) { - if (!p->valid || vm_page_busied(p)) { - p = next; - continue; - } - } else if (op & OBSC_COLLAPSE_WAIT) { - if (vm_page_busied(p)) { - VM_OBJECT_WUNLOCK(object); - vm_page_lock(p); - VM_OBJECT_WUNLOCK(backing_object); - vm_page_busy_sleep(p, "vmocol"); - VM_OBJECT_WLOCK(object); - VM_OBJECT_WLOCK(backing_object); - /* - * If we slept, anything could have - * happened. Since the object is - * marked dead, the backing offset - * should not have changed so we - * just restart our scan. - */ - p = TAILQ_FIRST(&backing_object->memq); - continue; - } + if (vm_page_busied(p)) { + p = vm_object_backing_scan_wait(object, p, + next, op); + continue; } - KASSERT( - p->object == backing_object, - ("vm_object_backing_scan: object mismatch") - ); - - if ( - p->pindex < backing_offset_index || - new_pindex >= object->size - ) { + KASSERT(p->object == backing_object, + ("vm_object_backing_scan: object mismatch")); + + if (p->pindex < backing_offset_index || + new_pindex >= object->size) { if (backing_object->type == OBJT_SWAP) swap_pager_freespace(backing_object, p->pindex, 1); @@ -1567,43 +1560,45 @@ vm_object_backing_scan(vm_object_t objec } pp = vm_page_lookup(object, new_pindex); - if ( - (op & OBSC_COLLAPSE_NOWAIT) != 0 && - (pp != NULL && pp->valid == 0) - ) { - if (backing_object->type == OBJT_SWAP) - swap_pager_freespace(backing_object, - p->pindex, 1); - + if (pp != NULL && vm_page_busied(pp)) { /* - * The page in the parent is not (yet) valid. - * We don't know anything about the state of - * the original page. It might be mapped, - * so we must avoid the next if here. + * The page in the parent is busy and + * possibly not (yet) valid. Until + * its state is finalized by the busy + * bit owner, we can't tell whether it + * shadows the original page. + * Therefore, we must either skip it + * and the original (backing_object) + * page or wait for its state to be + * finalized. * - * This is due to a race in vm_fault() where - * we must unbusy the original (backing_obj) - * page before we can (re)lock the parent. - * Hence we can get here. + * This is due to a race with vm_fault() + * where we must unbusy the original + * (backing_obj) page before we can + * (re)lock the parent. Hence we can + * get here. */ - p = next; + p = vm_object_backing_scan_wait(object, pp, + next, op); continue; } - if ( - pp != NULL || - vm_pager_has_page(object, new_pindex, NULL, NULL) - ) { - if (backing_object->type == OBJT_SWAP) - swap_pager_freespace(backing_object, - p->pindex, 1); + KASSERT(pp == NULL || pp->valid != 0, + ("unbusy invalid page %p", pp)); + + if (pp != NULL || vm_pager_has_page(object, + new_pindex, NULL, NULL)) { /* - * page already exists in parent OR swap exists - * for this location in the parent. Destroy - * the original page from the backing object. - * - * Leave the parent's page alone + * The page already exists in the + * parent OR swap exists for this + * location in the parent. Leave the + * parent's page alone. Destroy the + * original page from the backing + * object. */ + if (backing_object->type == OBJT_SWAP) + swap_pager_freespace(backing_object, + p->pindex, 1); vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); @@ -1625,16 +1620,8 @@ vm_object_backing_scan(vm_object_t objec * vm_page_rename() will handle dirty and cache. */ if (vm_page_rename(p, object, new_pindex)) { - if (op & OBSC_COLLAPSE_NOWAIT) { - p = next; - continue; - } - VM_OBJECT_WUNLOCK(backing_object); - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); - VM_OBJECT_WLOCK(backing_object); - p = TAILQ_FIRST(&backing_object->memq); + p = vm_object_backing_scan_wait(object, NULL, + next, op); continue; } @@ -1653,7 +1640,7 @@ vm_object_backing_scan(vm_object_t objec } p = next; } - return (r); + return (true); } @@ -1820,8 +1807,8 @@ vm_object_collapse(vm_object_t object) * there is nothing we can do so we give up. */ if (object->resident_page_count != object->size && - vm_object_backing_scan(object, - OBSC_TEST_ALL_SHADOWED) == 0) { + !vm_object_backing_scan(object, + OBSC_TEST_ALL_SHADOWED)) { VM_OBJECT_WUNLOCK(backing_object); break; } From owner-svn-src-all@freebsd.org Tue Dec 15 13:01:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F18F8A439D2; Tue, 15 Dec 2015 13:01:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF88D1183; Tue, 15 Dec 2015 13:01:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFD1EVx032205; Tue, 15 Dec 2015 13:01:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFD1EZZ032204; Tue, 15 Dec 2015 13:01:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512151301.tBFD1EZZ032204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 15 Dec 2015 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292262 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 13:01:16 -0000 Author: bapt Date: Tue Dec 15 13:01:14 2015 New Revision: 292262 URL: https://svnweb.freebsd.org/changeset/base/292262 Log: Show the enclosure name and id in sesutil map Sponsored by: Gandi.net Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Tue Dec 15 12:58:33 2015 (r292261) +++ head/usr.sbin/sesutil/sesutil.c Tue Dec 15 13:01:14 2015 (r292262) @@ -302,6 +302,7 @@ static int objmap(int argc, char **argv __unused) { struct sbuf *extra; + encioc_string_t stri; encioc_elm_devnames_t e_devname; encioc_elm_status_t e_status; encioc_elm_desc_t e_desc; @@ -310,6 +311,7 @@ objmap(int argc, char **argv __unused) int fd; unsigned int j, nobj; size_t i; + char str[32]; if (argc != 1) { usage(stderr, "map"); @@ -355,6 +357,15 @@ objmap(int argc, char **argv __unused) } printf("%s:\n", g.gl_pathv[i] + 5); + stri.bufsiz = sizeof(str); + stri.buf = &str[0]; + if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0) + printf("\tEnclosure Name: %s\n", stri.buf); + stri.bufsiz = sizeof(str); + stri.buf = &str[0]; + if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0) + printf("\tEnclosure ID: %s\n", stri.buf); + for (j = 0; j < nobj; j++) { /* Get the status of the element */ memset(&e_status, 0, sizeof(e_status)); From owner-svn-src-all@freebsd.org Tue Dec 15 13:04:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B6CA43CC6; Tue, 15 Dec 2015 13:04:45 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4503B1583; Tue, 15 Dec 2015 13:04:45 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFD4ioe034898; Tue, 15 Dec 2015 13:04:44 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFD4i0J034896; Tue, 15 Dec 2015 13:04:44 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512151304.tBFD4i0J034896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 15 Dec 2015 13:04:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292263 - in head: contrib/smbfs tools/debugscripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 13:04:45 -0000 Author: brueffer Date: Tue Dec 15 13:04:44 2015 New Revision: 292263 URL: https://svnweb.freebsd.org/changeset/base/292263 Log: Assorted grammar, spelling and punctuation fixes. PR: 203336, 203339 Submitted by: espeyb@rpi.edu, themesta@gmail.com MFC after: 1 week Modified: head/contrib/smbfs/README head/tools/debugscripts/README Modified: head/contrib/smbfs/README ============================================================================== --- head/contrib/smbfs/README Tue Dec 15 13:01:14 2015 (r292262) +++ head/contrib/smbfs/README Tue Dec 15 13:04:44 2015 (r292263) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. - I'm would be very grateful for any feedback, bug reports etc. + I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp - An updated versions of this package can be retrieved from ftp server: + An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz - Perfomance + Performance ========== - There is some perfomance benchmarks over 10Mbit network: + These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: head/tools/debugscripts/README ============================================================================== --- head/tools/debugscripts/README Tue Dec 15 13:01:14 2015 (r292262) +++ head/tools/debugscripts/README Tue Dec 15 13:04:44 2015 (r292263) @@ -14,8 +14,8 @@ perform kernel debugging, you would do: (kgdb) -This directory also contains a kgdb script that given a crash dump number -automatically extract the path to the kernel source, run gdb to extract -information about kernel modules loaded, and then rerun gdb loading the +This directory also contains a kgdb script that, given a crash dump number, +automatically extracts the path to the kernel source, runs gdb to extract +information about kernel modules loaded, and then reruns gdb loading the necessary symbols for the modules. You need to make sure you build the modules w/ debugging symbols separately to get things to work. From owner-svn-src-all@freebsd.org Tue Dec 15 13:17:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACB6FA446FD; Tue, 15 Dec 2015 13:17:41 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79C531EA0; Tue, 15 Dec 2015 13:17:41 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFDHeCp037948; Tue, 15 Dec 2015 13:17:40 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFDHeHJ037947; Tue, 15 Dec 2015 13:17:40 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201512151317.tBFDHeHJ037947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 15 Dec 2015 13:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292264 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 13:17:41 -0000 Author: skra Date: Tue Dec 15 13:17:40 2015 New Revision: 292264 URL: https://svnweb.freebsd.org/changeset/base/292264 Log: Flush intermediate TLB cache when L2 page table is unlinked. This fixes an issue observed on Cortex A7 (RPi2) and on Cortex A15 (Jetson TK1) causing various memory corruptions. It turned out that even L2 page table with no valid mapping might be a subject of such caching. Note that not all platforms have intermediate TLB caching implemented. An open question is if this fix is sufficient for all platforms with this feature. Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Dec 15 13:04:44 2015 (r292263) +++ head/sys/arm/arm/pmap-v6-new.c Tue Dec 15 13:17:40 2015 (r292264) @@ -2508,8 +2508,13 @@ pmap_unwire_pt2pg(pmap_t pmap, vm_offset KASSERT(m->md.pt2_wirecount[i] == 0, ("%s: pmap %p PT2 %u (PG %p) wired", __func__, pmap, i, m)); opte1 = pte1_load(pte1p); - if (pte1_is_link(opte1)) + if (pte1_is_link(opte1)) { pte1_clear(pte1p); + /* + * Flush intermediate TLB cache. + */ + pmap_tlb_flush(pmap, (m->pindex + i) << PTE1_SHIFT); + } #ifdef INVARIANTS else KASSERT((opte1 == 0) || pte1_is_section(opte1), From owner-svn-src-all@freebsd.org Tue Dec 15 13:29:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA61DA47848; Tue, 15 Dec 2015 13:29:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ACA1162A; Tue, 15 Dec 2015 13:29:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFDT5vw040797; Tue, 15 Dec 2015 13:29:05 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFDT5Yf040793; Tue, 15 Dec 2015 13:29:05 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512151329.tBFDT5Yf040793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 15 Dec 2015 13:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292265 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 13:29:06 -0000 Author: brueffer Date: Tue Dec 15 13:29:05 2015 New Revision: 292265 URL: https://svnweb.freebsd.org/changeset/base/292265 Log: Fix example code rendering, \n needs escaping to show up. PR: 203536 Submitted by: Fabian Keil Modified: head/share/man/man4/dtrace_io.4 head/share/man/man4/dtrace_ip.4 head/share/man/man4/dtrace_tcp.4 head/share/man/man4/dtrace_udp.4 Modified: head/share/man/man4/dtrace_io.4 ============================================================================== --- head/share/man/man4/dtrace_io.4 Tue Dec 15 13:17:40 2015 (r292264) +++ head/share/man/man4/dtrace_io.4 Tue Dec 15 13:29:05 2015 (r292265) @@ -91,8 +91,8 @@ io:::start END { - printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES"); - printa("%10s %20s %10d %15@d\n", @); + printf("%10s %20s %10s %15s\\n", "DEVICE", "APP", "PID", "BYTES"); + printa("%10s %20s %10d %15@d\\n", @); } .Ed .Sh COMPATIBILITY Modified: head/share/man/man4/dtrace_ip.4 ============================================================================== --- head/share/man/man4/dtrace_ip.4 Tue Dec 15 13:17:40 2015 (r292264) +++ head/share/man/man4/dtrace_ip.4 Tue Dec 15 13:29:05 2015 (r292265) @@ -239,7 +239,7 @@ by the kernel: dtrace:::BEGIN { - printf(" %10s %30s %-30s %8s %6s\n", "DELTA(us)", "SOURCE", + printf(" %10s %30s %-30s %8s %6s\\n", "DELTA(us)", "SOURCE", "DEST", "INT", "BYTES"); last = timestamp; } @@ -247,7 +247,7 @@ dtrace:::BEGIN ip:::send { this->elapsed = (timestamp - last) / 1000; - printf(" %10d %30s -> %-30s %8s %6d\n", this->elapsed, + printf(" %10d %30s -> %-30s %8s %6d\\n", this->elapsed, args[2]->ip_saddr, args[2]->ip_daddr, args[3]->if_name, args[2]->ip_plength); last = timestamp; @@ -256,7 +256,7 @@ ip:::send ip:::receive { this->elapsed = (timestamp - last) / 1000; - printf(" %10d %30s <- %-30s %8s %6d\n", this->elapsed, + printf(" %10d %30s <- %-30s %8s %6d\\n", this->elapsed, args[2]->ip_daddr, args[2]->ip_saddr, args[3]->if_name, args[2]->ip_plength); last = timestamp; Modified: head/share/man/man4/dtrace_tcp.4 ============================================================================== --- head/share/man/man4/dtrace_tcp.4 Tue Dec 15 13:17:40 2015 (r292264) +++ head/share/man/man4/dtrace_tcp.4 Tue Dec 15 13:29:05 2015 (r292265) @@ -300,7 +300,7 @@ The following script logs TCP segments i dtrace:::BEGIN { - printf(" %3s %15s:%-5s %15s:%-5s %6s %s\n", "CPU", + printf(" %3s %15s:%-5s %15s:%-5s %6s %s\\n", "CPU", "LADDR", "LPORT", "RADDR", "RPORT", "BYTES", "FLAGS"); } @@ -317,7 +317,7 @@ tcp:::send printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : ""); printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : ""); printf("%s", args[4]->tcp_flags == 0 ? "null " : ""); - printf("\b)\n"); + printf("\b)\\n"); } tcp:::receive @@ -333,7 +333,7 @@ tcp:::receive printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : ""); printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : ""); printf("%s", args[4]->tcp_flags == 0 ? "null " : ""); - printf("\b)\n"); + printf("\b)\\n"); } .Ed The following script logs TCP connection state changes as they occur: @@ -345,14 +345,14 @@ int last[int]; dtrace:::BEGIN { - printf(" %12s %-20s %-20s %s\n", + printf(" %12s %-20s %-20s %s\\n", "DELTA(us)", "OLD", "NEW", "TIMESTAMP"); } tcp:::state-change { this->elapsed = (timestamp - last[args[1]->cs_cid]) / 1000; - printf(" %12d %-20s -> %-20s %d\n", this->elapsed, + printf(" %12d %-20s -> %-20s %d\\n", this->elapsed, tcp_state_string[args[5]->tcps_state], tcp_state_string[args[3]->tcps_state], timestamp); last[args[1]->cs_cid] = timestamp; @@ -361,7 +361,7 @@ tcp:::state-change tcp:::state-change /last[args[1]->cs_cid] == 0/ { - printf(" %12s %-20s -> %-20s %d\n", "-", + printf(" %12s %-20s -> %-20s %d\\n", "-", tcp_state_string[args[5]->tcps_state], tcp_state_string[args[3]->tcps_state], timestamp); last[args[1]->cs_cid] = timestamp; Modified: head/share/man/man4/dtrace_udp.4 ============================================================================== --- head/share/man/man4/dtrace_udp.4 Tue Dec 15 13:17:40 2015 (r292264) +++ head/share/man/man4/dtrace_udp.4 Tue Dec 15 13:29:05 2015 (r292265) @@ -151,7 +151,7 @@ by the kernel: dtrace:::BEGIN { - printf(" %10s %36s %-36s %6s\n", "DELTA(us)", "SOURCE", + printf(" %10s %36s %-36s %6s\\n", "DELTA(us)", "SOURCE", "DEST", "BYTES"); last = timestamp; } @@ -161,7 +161,7 @@ udp:::send this->elapsed = (timestamp - last) / 1000; self->dest = strjoin(strjoin(args[2]->ip_daddr, ":"), lltostr(args[4]->udp_dport)); - printf(" %10d %30s:%-5d -> %-36s %6d\n", this->elapsed, + printf(" %10d %30s:%-5d -> %-36s %6d\\n", this->elapsed, args[2]->ip_saddr, args[4]->udp_sport, self->dest, args[4]->udp_length); last = timestamp; @@ -172,7 +172,7 @@ udp:::receive this->elapsed = (timestamp - last) / 1000; self->dest = strjoin(strjoin(args[2]->ip_saddr, ":"), lltostr(args[4]->udp_sport)); - printf(" %10d %30s:%-5d <- %-36s %6d\n", this->elapsed, + printf(" %10d %30s:%-5d <- %-36s %6d\\n", this->elapsed, args[2]->ip_daddr, args[4]->udp_dport, self->dest, args[4]->udp_length); last = timestamp; From owner-svn-src-all@freebsd.org Tue Dec 15 14:17:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D374DA43CDA; Tue, 15 Dec 2015 14:17:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 936521456; Tue, 15 Dec 2015 14:17:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFEH7gN055361; Tue, 15 Dec 2015 14:17:07 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFEH7i3055359; Tue, 15 Dec 2015 14:17:07 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512151417.tBFEH7i3055359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 15 Dec 2015 14:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292266 - head/sbin/reboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 14:17:09 -0000 Author: smh Date: Tue Dec 15 14:17:07 2015 New Revision: 292266 URL: https://svnweb.freebsd.org/changeset/base/292266 Log: Add flag to disable inital reboot(8) userland sync Add -N flag to reboot(8) which bypasses the userland sync(2) during reboot(8) while still allow the kernel sync during the reboot(2) syscall to occur. An example use of this is when rebooting with disconnected iSCSI sessions which would otherwise cause the reboot to hang on BIOs that will never complete. Reviewed by: bjk MFC after: 2 weeks Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4449 Modified: head/sbin/reboot/reboot.8 head/sbin/reboot/reboot.c Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Tue Dec 15 13:29:05 2015 (r292265) +++ head/sbin/reboot/reboot.8 Tue Dec 15 14:17:07 2015 (r292266) @@ -28,7 +28,7 @@ .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd May 22, 2015 +.Dd Dec 12, 2015 .Dt REBOOT 8 .Os .Sh NAME @@ -39,16 +39,16 @@ .Nd stopping and restarting the system .Sh SYNOPSIS .Nm halt -.Op Fl lnpq +.Op Fl lNnpq .Op Fl k Ar kernel .Nm -.Op Fl dlnpqr +.Op Fl dlNnpqr .Op Fl k Ar kernel .Nm fasthalt -.Op Fl lnpq +.Op Fl lNnpq .Op Fl k Ar kernel .Nm fastboot -.Op Fl dlnpq +.Op Fl dlNnpq .Op Fl k Ar kernel .Sh DESCRIPTION The @@ -94,6 +94,16 @@ that call or .Nm halt and log this themselves. +.It Fl N +The file system cache is not flushed during the initial process clean-up, +however the kernel level +.Xr reboot 2 +is still processed with a sync. +This option can be useful for performing a +.Dq best-effort +reboot when devices might be unavailable. +This can happen when devices have been disconnected, such as with +.Xr iscsi 4 . .It Fl n The file system cache is not flushed. This option should probably not be used. Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Tue Dec 15 13:29:05 2015 (r292265) +++ head/sbin/reboot/reboot.c Tue Dec 15 14:17:07 2015 (r292266) @@ -67,7 +67,7 @@ main(int argc, char *argv[]) { struct utmpx utx; const struct passwd *pw; - int ch, howto, i, fd, lflag, nflag, qflag, sverrno; + int ch, howto, i, fd, lflag, nflag, qflag, sverrno, Nflag; u_int pageins; const char *user, *kernel = NULL; @@ -77,7 +77,7 @@ main(int argc, char *argv[]) } else howto = 0; lflag = nflag = qflag = 0; - while ((ch = getopt(argc, argv, "dk:lnpqr")) != -1) + while ((ch = getopt(argc, argv, "dk:lNnpqr")) != -1) switch(ch) { case 'd': howto |= RB_DUMP; @@ -92,6 +92,10 @@ main(int argc, char *argv[]) nflag = 1; howto |= RB_NOSYNC; break; + case 'N': + nflag = 1; + Nflag = 1; + break; case 'p': howto |= RB_POWEROFF; break; @@ -110,6 +114,8 @@ main(int argc, char *argv[]) if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); + if (Nflag && (howto & RB_NOSYNC) != 0) + errx(1, "-N cannot be used with -n"); if ((howto & RB_REROOT) != 0 && howto != RB_REROOT) errx(1, "-r cannot be used with -d, -n, or -p"); if (geteuid()) { From owner-svn-src-all@freebsd.org Tue Dec 15 15:08:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62CCA47DEF; Tue, 15 Dec 2015 15:08:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 830081F1F; Tue, 15 Dec 2015 15:08:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFF8TOM071637; Tue, 15 Dec 2015 15:08:29 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFF8TIM071635; Tue, 15 Dec 2015 15:08:29 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512151508.tBFF8TIM071635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 15 Dec 2015 15:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292267 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:08:30 -0000 Author: kevlo Date: Tue Dec 15 15:08:29 2015 New Revision: 292267 URL: https://svnweb.freebsd.org/changeset/base/292267 Log: Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h. Reviewed by: bde Modified: head/lib/libc/sys/getuid.2 head/lib/libc/sys/setuid.2 Modified: head/lib/libc/sys/getuid.2 ============================================================================== --- head/lib/libc/sys/getuid.2 Tue Dec 15 14:17:07 2015 (r292266) +++ head/lib/libc/sys/getuid.2 Tue Dec 15 15:08:29 2015 (r292267) @@ -28,7 +28,7 @@ .\" @(#)getuid.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 15, 2015 .Dt GETUID 2 .Os .Sh NAME @@ -39,7 +39,6 @@ .Lb libc .Sh SYNOPSIS .In unistd.h -.In sys/types.h .Ft uid_t .Fn getuid void .Ft uid_t Modified: head/lib/libc/sys/setuid.2 ============================================================================== --- head/lib/libc/sys/setuid.2 Tue Dec 15 14:17:07 2015 (r292266) +++ head/lib/libc/sys/setuid.2 Tue Dec 15 15:08:29 2015 (r292267) @@ -28,7 +28,7 @@ .\" @(#)setuid.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 13, 2015 +.Dd December 15, 2015 .Dt SETUID 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft int .Fn setuid "uid_t uid" From owner-svn-src-all@freebsd.org Tue Dec 15 15:19:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B79A43688; Tue, 15 Dec 2015 15:19:07 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9551E19A0; Tue, 15 Dec 2015 15:19:07 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFJ6tI074990; Tue, 15 Dec 2015 15:19:06 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFJ6Yu074985; Tue, 15 Dec 2015 15:19:06 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512151519.tBFFJ6Yu074985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 15 Dec 2015 15:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292268 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:19:08 -0000 Author: kevlo Date: Tue Dec 15 15:19:06 2015 New Revision: 292268 URL: https://svnweb.freebsd.org/changeset/base/292268 Log: Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h. Modified: head/lib/libc/sys/brk.2 head/lib/libc/sys/getgid.2 head/lib/libc/sys/getpid.2 head/lib/libc/sys/read.2 head/lib/libc/sys/write.2 Modified: head/lib/libc/sys/brk.2 ============================================================================== --- head/lib/libc/sys/brk.2 Tue Dec 15 15:08:29 2015 (r292267) +++ head/lib/libc/sys/brk.2 Tue Dec 15 15:19:06 2015 (r292268) @@ -28,7 +28,7 @@ .\" @(#)brk.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd July 12, 1999 +.Dd December 15, 2015 .Dt BRK 2 .Os .Sh NAME @@ -38,7 +38,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft int .Fn brk "const void *addr" Modified: head/lib/libc/sys/getgid.2 ============================================================================== --- head/lib/libc/sys/getgid.2 Tue Dec 15 15:08:29 2015 (r292267) +++ head/lib/libc/sys/getgid.2 Tue Dec 15 15:19:06 2015 (r292268) @@ -28,7 +28,7 @@ .\" @(#)getgid.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 15, 2015 .Dt GETGID 2 .Os .Sh NAME @@ -38,7 +38,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft gid_t .Fn getgid void Modified: head/lib/libc/sys/getpid.2 ============================================================================== --- head/lib/libc/sys/getpid.2 Tue Dec 15 15:08:29 2015 (r292267) +++ head/lib/libc/sys/getpid.2 Tue Dec 15 15:19:06 2015 (r292268) @@ -28,7 +28,7 @@ .\" @(#)getpid.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 2, 2006 +.Dd December 15, 2015 .Dt GETPID 2 .Os .Sh NAME @@ -38,7 +38,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft pid_t .Fn getpid void Modified: head/lib/libc/sys/read.2 ============================================================================== --- head/lib/libc/sys/read.2 Tue Dec 15 15:08:29 2015 (r292267) +++ head/lib/libc/sys/read.2 Tue Dec 15 15:19:06 2015 (r292268) @@ -28,7 +28,7 @@ .\" @(#)read.2 8.4 (Berkeley) 2/26/94 .\" $FreeBSD$ .\" -.Dd September 11, 2013 +.Dd December 15, 2015 .Dt READ 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft ssize_t .Fn read "int fd" "void *buf" "size_t nbytes" Modified: head/lib/libc/sys/write.2 ============================================================================== --- head/lib/libc/sys/write.2 Tue Dec 15 15:08:29 2015 (r292267) +++ head/lib/libc/sys/write.2 Tue Dec 15 15:19:06 2015 (r292268) @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd September 11, 2013 +.Dd December 15, 2015 .Dt WRITE 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft ssize_t .Fn write "int fd" "const void *buf" "size_t nbytes" From owner-svn-src-all@freebsd.org Tue Dec 15 15:22:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DD3AA439F0; Tue, 15 Dec 2015 15:22:34 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A3501E31; Tue, 15 Dec 2015 15:22:34 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFMXfH077406; Tue, 15 Dec 2015 15:22:33 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFMXfP077405; Tue, 15 Dec 2015 15:22:33 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201512151522.tBFFMXfP077405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 15 Dec 2015 15:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292269 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:22:34 -0000 Author: skra Date: Tue Dec 15 15:22:33 2015 New Revision: 292269 URL: https://svnweb.freebsd.org/changeset/base/292269 Log: Replace all postponed TLB flushes by immediate ones except the one in pmap_remove_pages(). Some points were considered: (1) There is no range TLB flush cp15 function. (2) There is no target selection for hardware TLB flush broadcasting. (3) Some memory ranges could be mapped sparsely. (4) Some memory ranges could be quite large. Tested by buildworld on RPi2 and Jetson TK1, i.e. 4 core platforms. It turned out that the buildworld time is faster. On the other hand, when the postponed TLB flush was also removed from pmap_remove_pages(), the result was worse. But pmap_remove_pages() is called for removing all user mapping from a process, thus it's quite expected. Note that the postponed TLB flushes came here from i386 pmap where hardware TLB flush broadcasting is not available. Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Dec 15 15:19:06 2015 (r292268) +++ head/sys/arm/arm/pmap-v6-new.c Tue Dec 15 15:22:33 2015 (r292269) @@ -2748,7 +2748,6 @@ pmap_pv_reclaim(pmap_t locked_pmap) TAILQ_REMOVE(&pv_chunks, pc, pc_lru); if (pmap != pc->pc_pmap) { if (pmap != NULL) { - pmap_tlb_flush_ng(pmap); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } @@ -2786,8 +2785,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) KASSERT(tpte2 != 0, ("pmap_pv_reclaim: pmap %p va %#x zero pte", pmap, va)); - if (pte2_is_global(tpte2)) - tlb_flush(va); + pmap_tlb_flush(pmap, va); m = PHYS_TO_VM_PAGE(pte2_pa(tpte2)); if (pte2_is_dirty(tpte2)) vm_page_dirty(m); @@ -2845,7 +2843,6 @@ pmap_pv_reclaim(pmap_t locked_pmap) out: TAILQ_CONCAT(&pv_chunks, &newtail, pc_lru); if (pmap != NULL) { - pmap_tlb_flush_ng(pmap); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } @@ -3375,18 +3372,16 @@ pmap_remove_pte1(pmap_t pmap, pt1_entry_ KASSERT((sva & PTE1_OFFSET) == 0, ("%s: sva is not 1mpage aligned", __func__)); + /* + * Clear and invalidate the mapping. It should occupy one and only TLB + * entry. So, pmap_tlb_flush() called with aligned address should be + * sufficient. + */ opte1 = pte1_load_clear(pte1p); + pmap_tlb_flush(pmap, sva); + if (pte1_is_wired(opte1)) pmap->pm_stats.wired_count -= PTE1_SIZE / PAGE_SIZE; - - /* - * If the mapping was global, invalidate it even if given pmap - * is not active (kernel_pmap is active always). The mapping should - * occupy one and only TLB entry. So, pmap_tlb_flush() called - * with aligned address should be sufficient. - */ - if (pte1_is_global(opte1)) - tlb_flush(sva); pmap->pm_stats.resident_count -= PTE1_SIZE / PAGE_SIZE; if (pte1_is_managed(opte1)) { pvh = pa_to_pvh(pte1_pa(opte1)); @@ -3470,7 +3465,6 @@ pmap_demote_pte1(pmap_t pmap, pt1_entry_ VM_ALLOC_NORMAL | VM_ALLOC_WIRED)) == NULL) { SLIST_INIT(&free); pmap_remove_pte1(pmap, pte1p, pte1_trunc(va), &free); - pmap_tlb_flush(pmap, pte1_trunc(va)); pmap_free_zero_pages(&free); CTR3(KTR_PMAP, "%s: failure for va %#x in pmap %p", __func__, va, pmap); @@ -3856,17 +3850,15 @@ pmap_remove_pte2(pmap_t pmap, pt2_entry_ rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* Clear and invalidate the mapping. */ opte2 = pte2_load_clear(pte2p); + pmap_tlb_flush(pmap, va); + KASSERT(pte2_is_valid(opte2), ("%s: pmap %p va %#x not link pte2 %#x", __func__, pmap, va, opte2)); + if (opte2 & PTE2_W) pmap->pm_stats.wired_count -= 1; - /* - * If the mapping was global, invalidate it even if given pmap - * is not active (kernel_pmap is active always). - */ - if (pte2_is_global(opte2)) - tlb_flush(va); pmap->pm_stats.resident_count -= 1; if (pte2_is_managed(opte2)) { m = PHYS_TO_VM_PAGE(pte2_pa(opte2)); @@ -3895,7 +3887,6 @@ pmap_remove_page(pmap_t pmap, vm_offset_ !pte2_is_valid(pte2_load(pte2p))) return; pmap_remove_pte2(pmap, pte2p, va, free); - pmap_tlb_flush(pmap, va); } /* @@ -3911,7 +3902,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva pt1_entry_t *pte1p, pte1; pt2_entry_t *pte2p, pte2; struct spglist free; - int anyvalid; /* * Perform an unsynchronized read. This is, however, safe. @@ -3919,7 +3909,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva if (pmap->pm_stats.resident_count == 0) return; - anyvalid = 0; SLIST_INIT(&free); rw_wlock(&pvh_global_lock); @@ -3964,12 +3953,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * demote the mapping and fall through. */ if (sva + PTE1_SIZE == nextva && eva >= nextva) { - /* - * The TLB entry for global mapping is - * invalidated by pmap_remove_pte1(). - */ - if (!pte1_is_global(pte1)) - anyvalid = 1; pmap_remove_pte1(pmap, pte1p, sva, &free); continue; } else if (!pmap_demote_pte1(pmap, pte1p, sva)) { @@ -4000,21 +3983,12 @@ pmap_remove(pmap_t pmap, vm_offset_t sva pte2 = pte2_load(pte2p); if (!pte2_is_valid(pte2)) continue; - - /* - * The TLB entry for global mapping is invalidated - * by pmap_remove_pte2(). - */ - if (!pte2_is_global(pte2)) - anyvalid = 1; if (pmap_remove_pte2(pmap, pte2p, sva, &free)) break; } } out: sched_unpin(); - if (anyvalid) - pmap_tlb_flush_ng(pmap); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); @@ -4070,6 +4044,7 @@ small_mappings: "a 1mpage in page %p's pv list", __func__, m)); pte2p = pmap_pte2_quick(pmap, pv->pv_va); opte2 = pte2_load_clear(pte2p); + pmap_tlb_flush(pmap, pv->pv_va); KASSERT(pte2_is_valid(opte2), ("%s: pmap %p va %x zero pte2", __func__, pmap, pv->pv_va)); if (pte2_is_wired(opte2)) @@ -4083,7 +4058,6 @@ small_mappings: if (pte2_is_dirty(opte2)) vm_page_dirty(m); pmap_unuse_pt2(pmap, pv->pv_va, &free); - pmap_tlb_flush(pmap, pv->pv_va); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); @@ -4602,19 +4576,17 @@ pmap_object_init_pt(pmap_t pmap, vm_offs /* * Do the things to protect a 1mpage in a process. */ -static boolean_t +static void pmap_protect_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t sva, vm_prot_t prot) { pt1_entry_t npte1, opte1; vm_offset_t eva, va; vm_page_t m; - boolean_t anychanged; PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((sva & PTE1_OFFSET) == 0, ("%s: sva is not 1mpage aligned", __func__)); - anychanged = FALSE; retry: opte1 = npte1 = pte1_load(pte1p); if (pte1_is_managed(opte1)) { @@ -4638,12 +4610,8 @@ retry: if (npte1 != opte1) { if (!pte1_cmpset(pte1p, opte1, npte1)) goto retry; - if (pte1_is_global(opte1)) - tlb_flush(sva); - else - anychanged = TRUE; + pmap_tlb_flush(pmap, sva); } - return (anychanged); } /* @@ -4653,7 +4621,7 @@ retry: void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - boolean_t anychanged, pv_lists_locked; + boolean_t pv_lists_locked; vm_offset_t nextva; pt1_entry_t *pte1p, pte1; pt2_entry_t *pte2p, opte2, npte2; @@ -4676,7 +4644,6 @@ resume: rw_wlock(&pvh_global_lock); sched_pin(); } - anychanged = FALSE; PMAP_LOCK(pmap); for (; sva < eva; sva = nextva) { @@ -4703,19 +4670,12 @@ resume: * demote the mapping and fall through. */ if (sva + PTE1_SIZE == nextva && eva >= nextva) { - /* - * The TLB entry for global mapping is - * invalidated by pmap_protect_pte1(). - */ - if (pmap_protect_pte1(pmap, pte1p, sva, prot)) - anychanged = TRUE; + pmap_protect_pte1(pmap, pte1p, sva, prot); continue; } else { if (!pv_lists_locked) { pv_lists_locked = TRUE; if (!rw_try_wlock(&pvh_global_lock)) { - if (anychanged) - pmap_tlb_flush_ng(pmap); PMAP_UNLOCK(pmap); goto resume; } @@ -4778,16 +4738,10 @@ retry: if (!pte2_cmpset(pte2p, opte2, npte2)) goto retry; - - if (pte2_is_global(opte2)) - tlb_flush(sva); - else - anychanged = TRUE; + pmap_tlb_flush(pmap, sva); } } } - if (anychanged) - pmap_tlb_flush_ng(pmap); if (pv_lists_locked) { sched_unpin(); rw_wunlock(&pvh_global_lock); @@ -5294,7 +5248,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva pt2_entry_t *pte2p, pte2; vm_offset_t pdnxt; vm_page_t m; - boolean_t anychanged, pv_lists_locked; + boolean_t pv_lists_locked; if (advice != MADV_DONTNEED && advice != MADV_FREE) return; @@ -5306,7 +5260,6 @@ resume: rw_wlock(&pvh_global_lock); sched_pin(); } - anychanged = FALSE; PMAP_LOCK(pmap); for (; sva < eva; sva = pdnxt) { pdnxt = pte1_trunc(sva + PTE1_SIZE); @@ -5322,8 +5275,6 @@ resume: if (!pv_lists_locked) { pv_lists_locked = TRUE; if (!rw_try_wlock(&pvh_global_lock)) { - if (anychanged) - pmap_tlb_flush_ng(pmap); PMAP_UNLOCK(pmap); goto resume; } @@ -5348,7 +5299,6 @@ resume: KASSERT(pte2_is_valid(pte2_load(pte2p)), ("%s: invalid PTE2", __func__)); pmap_remove_pte2(pmap, pte2p, sva, NULL); - anychanged = TRUE; } } if (pdnxt > eva) @@ -5374,14 +5324,9 @@ resume: pte2_clear_bit(pte2p, PTE2_A); else continue; - if (pte2_is_global(pte2)) - tlb_flush(sva); - else - anychanged = TRUE; + pmap_tlb_flush(pmap, sva); } } - if (anychanged) - pmap_tlb_flush_ng(pmap); if (pv_lists_locked) { sched_unpin(); rw_wunlock(&pvh_global_lock); From owner-svn-src-all@freebsd.org Tue Dec 15 15:37:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC07A4850A; Tue, 15 Dec 2015 15:37:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F42018E7; Tue, 15 Dec 2015 15:37:59 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFbwQG080771; Tue, 15 Dec 2015 15:37:58 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFbw36080768; Tue, 15 Dec 2015 15:37:58 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512151537.tBFFbw36080768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 15 Dec 2015 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292270 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:37:59 -0000 Author: araujo Date: Tue Dec 15 15:37:58 2015 New Revision: 292270 URL: https://svnweb.freebsd.org/changeset/base/292270 Log: EAGAIN handling for imsg_read. Approved by: bapt (mentor) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D4547 Modified: head/usr.sbin/ypldap/ldapclient.c head/usr.sbin/ypldap/ypldap.c head/usr.sbin/ypldap/ypldap_dns.c Modified: head/usr.sbin/ypldap/ldapclient.c ============================================================================== --- head/usr.sbin/ypldap/ldapclient.c Tue Dec 15 15:22:33 2015 (r292269) +++ head/usr.sbin/ypldap/ldapclient.c Tue Dec 15 15:37:58 2015 (r292270) @@ -172,7 +172,7 @@ client_dispatch_dns(int fd, short events fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsg_read(ibuf)) == -1) + if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) fatal("imsg_read error"); if (n == 0) shut = 1; @@ -275,7 +275,7 @@ client_dispatch_parent(int fd, short eve fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsg_read(ibuf)) == -1) + if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) fatal("imsg_read error"); if (n == 0) shut = 1; @@ -377,8 +377,10 @@ ldapclient(int pipe_main2client[2]) bzero(&env, sizeof(env)); TAILQ_INIT(&env.sc_idms); - if ((pw = getpwnam(YPLDAP_USER)) == NULL) + if ((pw = getpwnam(YPLDAP_USER)) == NULL) { + printf("ldapclient.c error\n"); fatal("getpwnam"); + } if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1) fatal("socketpair"); Modified: head/usr.sbin/ypldap/ypldap.c ============================================================================== --- head/usr.sbin/ypldap/ypldap.c Tue Dec 15 15:22:33 2015 (r292269) +++ head/usr.sbin/ypldap/ypldap.c Tue Dec 15 15:37:58 2015 (r292270) @@ -361,7 +361,7 @@ main_dispatch_client(int fd, short event fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsg_read(ibuf)) == -1) + if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) fatal("imsg_read error"); if (n == 0) shut = 1; Modified: head/usr.sbin/ypldap/ypldap_dns.c ============================================================================== --- head/usr.sbin/ypldap/ypldap_dns.c Tue Dec 15 15:22:33 2015 (r292269) +++ head/usr.sbin/ypldap/ypldap_dns.c Tue Dec 15 15:37:58 2015 (r292270) @@ -140,7 +140,7 @@ dns_dispatch_imsg(int fd, short events, fatalx("unknown event"); if (events & EV_READ) { - if ((n = imsg_read(ibuf)) == -1) + if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) fatal("imsg_read error"); if (n == 0) shut = 1; From owner-svn-src-all@freebsd.org Tue Dec 15 15:41:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2681A4868C; Tue, 15 Dec 2015 15:41:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2BC61B3C; Tue, 15 Dec 2015 15:41:10 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFf9GV080938; Tue, 15 Dec 2015 15:41:09 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFf9Rh080937; Tue, 15 Dec 2015 15:41:09 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512151541.tBFFf9Rh080937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 15 Dec 2015 15:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292271 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:41:11 -0000 Author: araujo Date: Tue Dec 15 15:41:09 2015 New Revision: 292271 URL: https://svnweb.freebsd.org/changeset/base/292271 Log: Remove wrong header and the NULL check before free(). Approved by: bapt (mentor) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D4548 Modified: head/usr.sbin/ypldap/ber.c Modified: head/usr.sbin/ypldap/ber.c ============================================================================== --- head/usr.sbin/ypldap/ber.c Tue Dec 15 15:37:58 2015 (r292270) +++ head/usr.sbin/ypldap/ber.c Tue Dec 15 15:41:09 2015 (r292271) @@ -27,7 +27,6 @@ #include /* XXX for debug output */ #include /* XXX for debug output */ #include -#include #include #include @@ -1219,8 +1218,7 @@ ber_set_application(struct ber *b, unsig void ber_free(struct ber *b) { - if (b->br_wbuf != NULL) - free (b->br_wbuf); + free(b->br_wbuf); } static ssize_t From owner-svn-src-all@freebsd.org Tue Dec 15 15:42:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3744A4883A; Tue, 15 Dec 2015 15:42:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 727E21F4C; Tue, 15 Dec 2015 15:42:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFggln083461; Tue, 15 Dec 2015 15:42:42 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFggW0083460; Tue, 15 Dec 2015 15:42:42 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512151542.tBFFggW0083460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 15 Dec 2015 15:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292272 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:42:43 -0000 Author: araujo Date: Tue Dec 15 15:42:42 2015 New Revision: 292272 URL: https://svnweb.freebsd.org/changeset/base/292272 Log: Remove the null checker before free. Approved by: bapt (mentor) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D4549 Modified: head/usr.sbin/ypldap/aldap.c Modified: head/usr.sbin/ypldap/aldap.c ============================================================================== --- head/usr.sbin/ypldap/aldap.c Tue Dec 15 15:41:09 2015 (r292271) +++ head/usr.sbin/ypldap/aldap.c Tue Dec 15 15:42:42 2015 (r292272) @@ -353,8 +353,7 @@ aldap_parse_page_control(struct ber_elem void aldap_freepage(struct aldap_page_control *page) { - if (page->cookie) - free(page->cookie); + free(page->cookie); free(page); } From owner-svn-src-all@freebsd.org Tue Dec 15 15:46:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F0BBA48A13; Tue, 15 Dec 2015 15:46:16 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F4251186; Tue, 15 Dec 2015 15:46:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFkFri083648; Tue, 15 Dec 2015 15:46:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFkF2S083647; Tue, 15 Dec 2015 15:46:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512151546.tBFFkF2S083647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 15 Dec 2015 15:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292273 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:46:16 -0000 Author: araujo Date: Tue Dec 15 15:46:14 2015 New Revision: 292273 URL: https://svnweb.freebsd.org/changeset/base/292273 Log: Remove a garbage printf used for debug. Approved by: bapt (mentor implicit) Modified: head/usr.sbin/ypldap/ldapclient.c Modified: head/usr.sbin/ypldap/ldapclient.c ============================================================================== --- head/usr.sbin/ypldap/ldapclient.c Tue Dec 15 15:42:42 2015 (r292272) +++ head/usr.sbin/ypldap/ldapclient.c Tue Dec 15 15:46:14 2015 (r292273) @@ -377,10 +377,8 @@ ldapclient(int pipe_main2client[2]) bzero(&env, sizeof(env)); TAILQ_INIT(&env.sc_idms); - if ((pw = getpwnam(YPLDAP_USER)) == NULL) { - printf("ldapclient.c error\n"); + if ((pw = getpwnam(YPLDAP_USER)) == NULL) fatal("getpwnam"); - } if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1) fatal("socketpair"); From owner-svn-src-all@freebsd.org Tue Dec 15 15:48:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4389EA48AF3; Tue, 15 Dec 2015 15:48:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 166521359; Tue, 15 Dec 2015 15:48:05 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFFm4DN083752; Tue, 15 Dec 2015 15:48:04 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFFm4od083751; Tue, 15 Dec 2015 15:48:04 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512151548.tBFFm4od083751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 15 Dec 2015 15:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r292274 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 15:48:05 -0000 Author: royger Date: Tue Dec 15 15:48:03 2015 New Revision: 292274 URL: https://svnweb.freebsd.org/changeset/base/292274 Log: Free Wei Hu (whu@) from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Dec 15 15:46:14 2015 (r292273) +++ svnadmin/conf/mentors Tue Dec 15 15:48:03 2015 (r292274) @@ -38,4 +38,3 @@ skra kib torek rpaulo venkat delphij Co-mentor: luigi, jhb versus gavin Co-mentor: fjoe -whu royger Co-mentor: gibbs From owner-svn-src-all@freebsd.org Tue Dec 15 16:02:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75AE6A482C7; Tue, 15 Dec 2015 16:02:13 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 453291C65; Tue, 15 Dec 2015 16:02:13 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFG2CX5089562; Tue, 15 Dec 2015 16:02:12 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFG2BTX089543; Tue, 15 Dec 2015 16:02:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512151602.tBFG2BTX089543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 15 Dec 2015 16:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292275 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 16:02:13 -0000 Author: smh Date: Tue Dec 15 16:02:11 2015 New Revision: 292275 URL: https://svnweb.freebsd.org/changeset/base/292275 Log: Fix lagg failover due to missing notifications When using lagg failover mode neither Gratuitous ARP (IPv4) or Unsolicited Neighbour Advertisements (IPv6) are sent to notify other nodes that the address may have moved. This results is slow failover, dropped packets and network outages for the lagg interface when the primary link goes down. We now use the new if_link_state_change_cond with the force param set to allow lagg to force through link state changes and hence fire a ifnet_link_event which are now monitored by rip and nd6. Upon receiving these events each protocol trigger the relevant notifications: * inet4 => Gratuitous ARP * inet6 => Unsolicited Neighbour Announce This also fixes the carp IPv6 NA's that stopped working after r251584 which added the ipv6_route__llma route. The new behavour can be controlled using the sysctls: * net.link.ether.inet.arp_on_link * net.inet6.icmp6.nd6_on_link Also removed unused param from lagg_port_state and added descriptions for the sysctls while here. PR: 156226 MFC after: 1 month Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4111 Modified: head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_var.h head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/net/if.c Tue Dec 15 16:02:11 2015 (r292275) @@ -126,7 +126,7 @@ SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifn void (*bridge_linkstate_p)(struct ifnet *ifp); void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); -void (*lagg_linkstate_p)(struct ifnet *ifp, int state); +void (*lagg_linkstate_p)(struct ifnet *ifp); /* These are external hooks for CARP. */ void (*carp_linkstate_p)(struct ifnet *ifp); void (*carp_demote_adj_p)(int, char *); @@ -1984,6 +1984,8 @@ if_unroute(struct ifnet *ifp, int flag, if (ifp->if_carp) (*carp_linkstate_p)(ifp); + if (ifp->if_lagg) + (*lagg_linkstate_p)(ifp); rt_ifmsg(ifp); } @@ -2005,6 +2007,8 @@ if_route(struct ifnet *ifp, int flag, in pfctlinput(PRC_IFUP, ifa->ifa_addr); if (ifp->if_carp) (*carp_linkstate_p)(ifp); + if (ifp->if_lagg) + (*lagg_linkstate_p)(ifp); rt_ifmsg(ifp); #ifdef INET6 in6_if_up(ifp); @@ -2019,17 +2023,27 @@ int (*vlan_tag_p)(struct ifnet *, uint16 int (*vlan_setcookie_p)(struct ifnet *, void *); void *(*vlan_cookie_p)(struct ifnet *); +void +if_link_state_change(struct ifnet *ifp, int link_state) +{ + + return if_link_state_change_cond(ifp, link_state, 0); +} + /* * Handle a change in the interface link state. To avoid LORs * between driver lock and upper layer locks, as well as possible * recursions, we post event to taskqueue, and all job * is done in static do_link_state_change(). + * + * If the current link state matches link_state and force isn't + * specified no action is taken. */ void -if_link_state_change(struct ifnet *ifp, int link_state) +if_link_state_change_cond(struct ifnet *ifp, int link_state, int force) { - /* Return if state hasn't changed. */ - if (ifp->if_link_state == link_state) + + if (ifp->if_link_state == link_state && !force) return; ifp->if_link_state = link_state; @@ -2057,7 +2071,7 @@ do_link_state_change(void *arg, int pend if (ifp->if_bridge) (*bridge_linkstate_p)(ifp); if (ifp->if_lagg) - (*lagg_linkstate_p)(ifp, link_state); + (*lagg_linkstate_p)(ifp); if (IS_DEFAULT_VNET(curvnet)) devctl_notify("IFNET", ifp->if_xname, Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/net/if_lagg.c Tue Dec 15 16:02:11 2015 (r292275) @@ -106,7 +106,7 @@ static int lagg_port_create(struct lagg_ static int lagg_port_destroy(struct lagg_port *, int); static struct mbuf *lagg_input(struct ifnet *, struct mbuf *); static void lagg_linkstate(struct lagg_softc *); -static void lagg_port_state(struct ifnet *, int); +static void lagg_port_state(struct ifnet *); static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t); static int lagg_port_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); @@ -1774,7 +1774,12 @@ lagg_linkstate(struct lagg_softc *sc) break; } } - if_link_state_change(sc->sc_ifp, new_link); + + /* + * Force state change to ensure ifnet_link_event is generated allowing + * protocols to notify other nodes of potential address move. + */ + if_link_state_change_cond(sc->sc_ifp, new_link, 1); /* Update if_baudrate to reflect the max possible speed */ switch (sc->sc_proto) { @@ -1797,7 +1802,7 @@ lagg_linkstate(struct lagg_softc *sc) } static void -lagg_port_state(struct ifnet *ifp, int state) +lagg_port_state(struct ifnet *ifp) { struct lagg_port *lp = (struct lagg_port *)ifp->if_lagg; struct lagg_softc *sc = NULL; @@ -1813,7 +1818,7 @@ lagg_port_state(struct ifnet *ifp, int s LAGG_WUNLOCK(sc); } -struct lagg_port * +static struct lagg_port * lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) { struct lagg_port *lp_next, *rval = NULL; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/net/if_lagg.h Tue Dec 15 16:02:11 2015 (r292275) @@ -281,7 +281,7 @@ struct lagg_port { #define LAGG_UNLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_UNLOCKED) extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); -extern void (*lagg_linkstate_p)(struct ifnet *, int ); +extern void (*lagg_linkstate_p)(struct ifnet *); int lagg_enqueue(struct ifnet *, struct mbuf *); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/net/if_var.h Tue Dec 15 16:02:11 2015 (r292275) @@ -500,6 +500,7 @@ struct ifmultiaddr * void if_free(struct ifnet *); void if_initname(struct ifnet *, const char *, int); void if_link_state_change(struct ifnet *, int); +void if_link_state_change_cond(struct ifnet *, int, int); int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); void if_ref(struct ifnet *); void if_rele(struct ifnet *); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet/if_ether.c Tue Dec 15 16:02:11 2015 (r292275) @@ -107,6 +107,7 @@ VNET_PCPUSTAT_SYSUNINIT(arpstat); #endif /* VIMAGE */ static VNET_DEFINE(int, arp_maxhold) = 1; +static VNET_DEFINE(int, arp_on_link) = 1; #define V_arpt_keep VNET(arpt_keep) #define V_arpt_down VNET(arpt_down) @@ -114,6 +115,7 @@ static VNET_DEFINE(int, arp_maxhold) = 1 #define V_arp_maxtries VNET(arp_maxtries) #define V_arp_proxyall VNET(arp_proxyall) #define V_arp_maxhold VNET(arp_maxhold) +#define V_arp_on_link VNET(arp_on_link) SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arpt_keep), 0, @@ -136,6 +138,9 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT CTLFLAG_RW, &arp_maxpps, 0, "Maximum number of remotely triggered ARP messages that can be " "logged per second"); +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, arp_on_link, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(arp_on_link), 0, + "Send gratuitous ARP's on interface link up events"); #define ARP_LOG(pri, ...) do { \ if (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ @@ -156,6 +161,7 @@ static void arp_mark_lle_reachable(struc static void arp_iflladdr(void *arg __unused, struct ifnet *ifp); static eventhandler_tag iflladdr_tag; +static eventhandler_tag ifnet_link_event_tag; static const struct netisr_handler arp_nh = { .nh_name = "arp", @@ -1176,43 +1182,96 @@ arp_ifinit(struct ifnet *ifp, struct ifa if (ntohl(dst_in->sin_addr.s_addr) == INADDR_ANY) return; - arp_announce_ifaddr(ifp, dst_in->sin_addr, IF_LLADDR(ifp)); + arp_announce_addr(ifp, &dst_in->sin_addr, IF_LLADDR(ifp)); arp_add_ifa_lle(ifp, dst); } -void -arp_announce_ifaddr(struct ifnet *ifp, struct in_addr addr, u_char *enaddr) +void __noinline +arp_announce_addr(struct ifnet *ifp, const struct in_addr *addr, u_char *enaddr) { - if (ntohl(addr.s_addr) != INADDR_ANY) - arprequest(ifp, &addr, &addr, enaddr); + if (ntohl(addr->s_addr) != INADDR_ANY) + arprequest(ifp, addr, addr, enaddr); } /* - * Sends gratuitous ARPs for each ifaddr to notify other - * nodes about the address change. + * Send gratuitous ARPs for all interfaces addresses to notify other nodes of + * changes. + * + * This is a noop if the interface isn't up or has been flagged for no ARP. */ -static __noinline void -arp_handle_ifllchange(struct ifnet *ifp) +void __noinline +arp_announce(struct ifnet *ifp) { + int i, cnt, entries; + u_char *lladdr; struct ifaddr *ifa; + struct in_addr *addr, *head; + if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP)) + return; + + entries = 8; + cnt = 0; + head = malloc(sizeof(*addr) * entries, M_TEMP, M_NOWAIT); + if (head == NULL) { + log(LOG_INFO, "arp_announce: malloc %d entries failed\n", + entries); + return; + } + + /* Take a copy then process to avoid locking issues. */ + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family == AF_INET) - arp_ifinit(ifp, ifa); + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + if (cnt == entries) { + addr = (struct in_addr *)realloc(head, sizeof(*addr) * + (entries + 8), M_TEMP, M_NOWAIT); + if (addr == NULL) { + log(LOG_INFO, "arp_announce: realloc to %d " + "entries failed\n", entries + 8); + /* Process what we have. */ + break; + } + entries += 8; + head = addr; + } + + addr = head + cnt; + bcopy(IFA_IN(ifa), addr, sizeof(*addr)); + cnt++; } + IF_ADDR_RUNLOCK(ifp); + + lladdr = IF_LLADDR(ifp); + for (i = 0; i < cnt; i++) { + arp_announce_addr(ifp, head + i, lladdr); + } + free(head, M_TEMP); +} + +/* + * A handler for interface linkstate change events. + */ +static void +arp_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate) +{ + + if (linkstate == LINK_STATE_UP && V_arp_on_link) + arp_announce(ifp); } /* - * A handler for interface link layer address change event. + * A handler for interface link layer address change events. */ static __noinline void arp_iflladdr(void *arg __unused, struct ifnet *ifp) { - if ((ifp->if_flags & IFF_UP) != 0) - arp_handle_ifllchange(ifp); + arp_announce(ifp); } static void @@ -1220,8 +1279,12 @@ arp_init(void) { netisr_register(&arp_nh); - if (IS_DEFAULT_VNET(curvnet)) + + if (IS_DEFAULT_VNET(curvnet)) { iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); + ifnet_link_event_tag = EVENTHANDLER_REGISTER(ifnet_link_event, + arp_ifnet_link_event, 0, EVENTHANDLER_PRI_ANY); + } } SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet/if_ether.h Tue Dec 15 16:02:11 2015 (r292275) @@ -119,7 +119,8 @@ int arpresolve(struct ifnet *ifp, int is void arprequest(struct ifnet *, const struct in_addr *, const struct in_addr *, u_char *); void arp_ifinit(struct ifnet *, struct ifaddr *); -void arp_announce_ifaddr(struct ifnet *, struct in_addr addr, u_char *); +void arp_announce(struct ifnet *); +void arp_announce_addr(struct ifnet *, const struct in_addr *addr, u_char *); #endif #endif Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet/in_var.h Tue Dec 15 16:02:11 2015 (r292275) @@ -129,6 +129,9 @@ extern struct rmlock in_ifaddr_lock; #define IN_IFADDR_WLOCK_ASSERT() rm_assert(&in_ifaddr_lock, RA_WLOCKED) #define IN_IFADDR_WUNLOCK() rm_wunlock(&in_ifaddr_lock) +#define IFA_IN(ifa) \ + (&((struct sockaddr_in *)ifa->ifa_addr)->sin_addr) + /* * Macro for finding the internet address structure (in_ifaddr) * corresponding to one of our IP addresses (in_addr). Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet/ip_carp.c Tue Dec 15 16:02:11 2015 (r292275) @@ -1009,13 +1009,12 @@ static void carp_send_arp(struct carp_softc *sc) { struct ifaddr *ifa; - struct in_addr addr; CARP_FOREACH_IFA(sc, ifa) { if (ifa->ifa_addr->sa_family != AF_INET) continue; - addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; - arp_announce_ifaddr(sc->sc_carpdev, addr, LLADDR(&sc->sc_addr)); + arp_announce_addr(sc->sc_carpdev, IFA_IN(ifa), + LLADDR(&sc->sc_addr)); } } @@ -1037,18 +1036,16 @@ carp_iamatch(struct ifaddr *ifa, uint8_t static void carp_send_na(struct carp_softc *sc) { - static struct in6_addr mcast = IN6ADDR_LINKLOCAL_ALLNODES_INIT; struct ifaddr *ifa; - struct in6_addr *in6; CARP_FOREACH_IFA(sc, ifa) { - if (ifa->ifa_addr->sa_family != AF_INET6) + if (ifa->ifa_addr->sa_family != AF_INET6 || + IFA_ND6_NA_UNSOLICITED_SKIP(ifa)) continue; - in6 = IFA_IN6(ifa); - nd6_na_output(sc->sc_carpdev, &mcast, in6, - ND_NA_FLAG_OVERRIDE, 1, NULL); - DELAY(1000); /* XXX */ + nd6_na_output_unsolicited_addr(sc->sc_carpdev, IFA_IN6(ifa), + IFA_ND6_NA_BASE_FLAGS(sc->sc_carpdev, ifa)); + nd6_na_unsolicited_addr_delay(ifa); } } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet6/in6.c Tue Dec 15 16:02:11 2015 (r292275) @@ -114,7 +114,7 @@ VNET_DECLARE(int, icmp6_nodeinfo_oldmcpr #define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix) /* - * Definitions of some costant IP6 addresses. + * Definitions of some constant IP6 addresses. */ const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet6/in6_var.h Tue Dec 15 16:02:11 2015 (r292275) @@ -399,6 +399,16 @@ struct in6_rrenumreq { #define IA6_SIN6(ia) (&((ia)->ia_addr)) #define IA6_DSTSIN6(ia) (&((ia)->ia_dstaddr)) #define IFA_IN6(x) (&((struct sockaddr_in6 *)((x)->ifa_addr))->sin6_addr) +#define IFA_IN6_FLAGS(ifa) ((struct in6_ifaddr *)ifa)->ia6_flags +#define IFA_ND6_NA_BASE_FLAGS(ifp, ifa) \ + (IFA_IN6_FLAGS(ifa) & IN6_IFF_ANYCAST ? 0 : ND_NA_FLAG_OVERRIDE) | \ + ((V_ip6_forwarding && !(ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && \ + V_ip6_norbit_raif)) ? ND_NA_FLAG_ROUTER : 0) +#define IFA_ND6_NA_UNSOLICITED_SKIP(ifa) \ + (IFA_IN6_FLAGS(ifa) & (IN6_IFF_DUPLICATED | IN6_IFF_DEPRECATED | \ + IN6_IFF_TENTATIVE)) != 0 +#define IN6_MAX_ANYCAST_DELAY_TIME_MS 1000000 +#define IN6_BROADCAST_DELAY_TIME_MS 1000 #define IFA_DSTIN6(x) (&((struct sockaddr_in6 *)((x)->ifa_dstaddr))->sin6_addr) #define IFPR_IN6(x) (&((struct sockaddr_in6 *)((x)->ifpr_prefix))->sin6_addr) Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet6/nd6.c Tue Dec 15 16:02:11 2015 (r292275) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -102,8 +103,12 @@ VNET_DEFINE(int, nd6_maxnudhint) = 0; /* * layer hints */ static VNET_DEFINE(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved * ND entries */ + +static VNET_DEFINE(int, nd6_on_link) = 1; /* Send unsolicited ND's on link up */ + #define V_nd6_maxndopt VNET(nd6_maxndopt) #define V_nd6_maxqueuelen VNET(nd6_maxqueuelen) +#define V_nd6_on_link VNET(nd6_on_link) #ifdef ND6_DEBUG VNET_DEFINE(int, nd6_debug) = 1; @@ -112,6 +117,7 @@ VNET_DEFINE(int, nd6_debug) = 0; #endif static eventhandler_tag lle_event_eh; +static eventhandler_tag ifnet_link_event_eh; /* for debugging? */ #if 0 @@ -196,6 +202,13 @@ nd6_lle_event(void *arg __unused, struct type == RTM_ADD ? RTF_UP: 0), 0, RT_DEFAULT_FIB); } +static void +nd6_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate) +{ + + if (linkstate == LINK_STATE_UP && V_nd6_on_link) + nd6_na_output_unsolicited(ifp); +} void nd6_init(void) { @@ -211,9 +224,12 @@ nd6_init(void) nd6_slowtimo, curvnet); nd6_dad_init(); - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { lle_event_eh = EVENTHANDLER_REGISTER(lle_event, nd6_lle_event, NULL, EVENTHANDLER_PRI_ANY); + ifnet_link_event_eh = EVENTHANDLER_REGISTER(ifnet_link_event, + nd6_ifnet_link_event, NULL, EVENTHANDLER_PRI_ANY); + } } #ifdef VIMAGE @@ -223,8 +239,10 @@ nd6_destroy() callout_drain(&V_nd6_slowtimo_ch); callout_drain(&V_nd6_timer_ch); - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); + EVENTHANDLER_DEREGISTER(ifnet_link_event, ifnet_link_event_eh); + } } #endif @@ -2457,13 +2475,18 @@ static int nd6_sysctl_prlist(SYSCTL_HAND SYSCTL_DECL(_net_inet6_icmp6); #endif SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_DRLIST, nd6_drlist, - CTLFLAG_RD, nd6_sysctl_drlist, ""); + CTLFLAG_RD, nd6_sysctl_drlist, "List default routers"); SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_PRLIST, nd6_prlist, - CTLFLAG_RD, nd6_sysctl_prlist, ""); + CTLFLAG_RD, nd6_sysctl_prlist, "List prefixes"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXQLEN, nd6_maxqueuelen, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, + "Max packets cached in unresolved ND entries"); SYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_gctimer, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), ""); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), + "Interface in seconds between garbage collection passes"); +SYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_on_link, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(nd6_on_link), 0, + "Send unsolicited neighbor discovery on interface link up events"); static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet6/nd6.h Tue Dec 15 16:02:11 2015 (r292275) @@ -398,6 +398,10 @@ void nd6_init(void); #ifdef VIMAGE void nd6_destroy(void); #endif +void nd6_na_output_unsolicited(struct ifnet *); +void nd6_na_output_unsolicited_addr(struct ifnet *, const struct in6_addr *, + u_long); +int nd6_na_unsolicited_addr_delay(struct ifaddr *); struct nd_ifinfo *nd6_ifattach(struct ifnet *); void nd6_ifdetach(struct nd_ifinfo *); int nd6_is_addr_neighbor(const struct sockaddr_in6 *, struct ifnet *); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Tue Dec 15 15:48:03 2015 (r292274) +++ head/sys/netinet6/nd6_nbr.c Tue Dec 15 16:02:11 2015 (r292275) @@ -124,20 +124,16 @@ nd6_ns_input(struct mbuf *m, int off, in struct in6_addr saddr6 = ip6->ip6_src; struct in6_addr daddr6 = ip6->ip6_dst; struct in6_addr taddr6; - struct in6_addr myaddr6; char *lladdr = NULL; struct ifaddr *ifa = NULL; + u_long flags; int lladdrlen = 0; - int anycast = 0, proxy = 0, tentative = 0; + int proxy = 0; int tlladdr; - int rflag; union nd_opts ndopts; struct sockaddr_dl proxydl; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; - rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; - if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) - rflag = 0; #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off); @@ -229,10 +225,7 @@ nd6_ns_input(struct mbuf *m, int off, in * In implementation, we add target link-layer address by default. * We do not add one in MUST NOT cases. */ - if (!IN6_IS_ADDR_MULTICAST(&daddr6)) - tlladdr = 0; - else - tlladdr = 1; + tlladdr = !IN6_IS_ADDR_MULTICAST(&daddr6); /* * Target address (taddr6) must be either: @@ -289,9 +282,6 @@ nd6_ns_input(struct mbuf *m, int off, in */ goto freeit; } - myaddr6 = *IFA_IN6(ifa); - anycast = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST; - tentative = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE; if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DUPLICATED) goto freeit; @@ -303,7 +293,7 @@ nd6_ns_input(struct mbuf *m, int off, in goto bad; } - if (IN6_ARE_ADDR_EQUAL(&myaddr6, &saddr6)) { + if (IN6_ARE_ADDR_EQUAL(IFA_IN6(ifa), &saddr6)) { nd6log((LOG_INFO, "nd6_ns_input: duplicate IP6 address %s\n", ip6_sprintf(ip6bufs, &saddr6))); goto freeit; @@ -321,7 +311,7 @@ nd6_ns_input(struct mbuf *m, int off, in * * The processing is defined in RFC 2462. */ - if (tentative) { + if (IFA_IN6_FLAGS(ifa) & IN6_IFF_TENTATIVE) { /* * If source address is unspecified address, it is for * duplicate address detection. @@ -335,6 +325,10 @@ nd6_ns_input(struct mbuf *m, int off, in goto freeit; } + flags = IFA_ND6_NA_BASE_FLAGS(ifp, ifa); + if (proxy || !tlladdr) + flags &= ~ND_NA_FLAG_OVERRIDE; + /* * If the source address is unspecified address, entries must not * be created or updated. @@ -349,20 +343,16 @@ nd6_ns_input(struct mbuf *m, int off, in in6_all = in6addr_linklocal_allnodes; if (in6_setscope(&in6_all, ifp, NULL) != 0) goto bad; - nd6_na_output_fib(ifp, &in6_all, &taddr6, - ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | - rflag, tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL, - M_GETFIB(m)); + nd6_na_output_fib(ifp, &in6_all, &taddr6, flags, tlladdr, + proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); goto freeit; } nd6_cache_lladdr(ifp, &saddr6, lladdr, lladdrlen, ND_NEIGHBOR_SOLICIT, 0); - nd6_na_output_fib(ifp, &saddr6, &taddr6, - ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | - rflag | ND_NA_FLAG_SOLICITED, tlladdr, - proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); + nd6_na_output_fib(ifp, &saddr6, &taddr6, flags | ND_NA_FLAG_SOLICITED, + tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); freeit: if (ifa != NULL) ifa_free(ifa); @@ -1597,3 +1587,110 @@ nd6_dad_na_input(struct ifaddr *ifa) nd6_dad_rele(dp); } } + +/* + * Send unsolicited neighbor advertisements for all interface addresses to + * notify other nodes of changes. + * + * This is a noop if the interface isn't up. + */ +void __noinline +nd6_na_output_unsolicited(struct ifnet *ifp) +{ + int i, cnt, entries; + struct ifaddr *ifa; + struct ann { + struct in6_addr addr; + u_long flags; + int delay; + } *ann1, *head; + + if (!(ifp->if_flags & IFF_UP)) + return; + + entries = 8; + cnt = 0; + head = malloc(sizeof(struct ann) * entries, M_TEMP, M_WAITOK); + + /* Take a copy then process to avoid locking issues. */ + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6 || + IFA_ND6_NA_UNSOLICITED_SKIP(ifa)) + continue; + + if (cnt == entries) { + ann1 = (struct ann*)realloc(head, sizeof(struct ann) * + (entries + 8), M_TEMP, M_NOWAIT); + if (ann1 == NULL) { + log(LOG_INFO, "nd6_announce: realloc to %d " + "entries failed\n", entries + 8); + /* Process what we have. */ + break; + } + entries += 8; + head = ann1; + } + + ann1 = head + cnt; + bcopy(IFA_IN6(ifa), &ann1->addr, sizeof(ann1->addr)); + ann1->flags = IFA_ND6_NA_BASE_FLAGS(ifp, ifa); + ann1->delay = nd6_na_unsolicited_addr_delay(ifa); + cnt++; + } + IF_ADDR_RUNLOCK(ifp); + + for (i = 0; i < cnt;) { + ann1 = head + i; + nd6_na_output_unsolicited_addr(ifp, &ann1->addr, ann1->flags); + i++; + if (i == cnt) + break; + DELAY(ann1->delay); + } + free(head, M_TEMP); +} + +/* + * Return the delay required for announcements of the address as per RFC 4861. + */ +int +nd6_na_unsolicited_addr_delay(struct ifaddr *ifa) +{ + + if (IFA_IN6_FLAGS(ifa) & IN6_IFF_ANYCAST) { + /* + * Random value between 0 and MAX_ANYCAST_DELAY_TIME + * as per section 7.2.7. + */ + return (random() % IN6_MAX_ANYCAST_DELAY_TIME_MS); + } + + /* Small delay as per section 7.2.6. */ + return (IN6_BROADCAST_DELAY_TIME_MS); +} + +/* + * Send an unsolicited neighbor advertisement for an address to notify other + * nodes of changes. + */ +void __noinline +nd6_na_output_unsolicited_addr(struct ifnet *ifp, const struct in6_addr *addr, + u_long flags) +{ + int error; + struct in6_addr mcast; + + mcast = in6addr_linklocal_allnodes; + if ((error = in6_setscope(&mcast, ifp, NULL)) != 0) { + /* + * This shouldn't by possible as the only error is for loopback + * address which we're not using. + */ + log(LOG_INFO, "in6_setscope: on mcast failed: %d\n", error); + return; + } + nd6_na_output(ifp, &mcast, addr, flags, 1, NULL); +} + + From owner-svn-src-all@freebsd.org Tue Dec 15 16:04:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 443EFA484C7; Tue, 15 Dec 2015 16:04:47 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBDCE127F; Tue, 15 Dec 2015 16:04:46 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFG4ktw089710; Tue, 15 Dec 2015 16:04:46 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFG4j64089708; Tue, 15 Dec 2015 16:04:45 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201512151604.tBFG4j64089708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Tue, 15 Dec 2015 16:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292276 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 16:04:47 -0000 Author: skra Date: Tue Dec 15 16:04:45 2015 New Revision: 292276 URL: https://svnweb.freebsd.org/changeset/base/292276 Log: Local TLB flush is sufficient in pmap_remove_pages(). (1) The pmap argument passed to the function must be current pmap only. (2) The process must be single threaded as the function is called either when a process is exiting or from exec_new_vmspace(). Remove pmap_tlb_flush_ng() which is not used anywhere now. Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c head/sys/arm/include/pmap-v6.h Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Tue Dec 15 16:02:11 2015 (r292275) +++ head/sys/arm/arm/pmap-v6-new.c Tue Dec 15 16:04:45 2015 (r292276) @@ -1380,14 +1380,6 @@ pmap_tlb_flush_range(pmap_t pmap, vm_off tlb_flush_range(sva, size); } -PMAP_INLINE void -pmap_tlb_flush_ng(pmap_t pmap) -{ - - if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) - tlb_flush_all_ng(); -} - /* * Abuse the pte2 nodes for unmapped kva to thread a kva freelist through. * Requirements: @@ -4233,8 +4225,8 @@ pmap_remove_pages(pmap_t pmap) free_pv_chunk(pc); } } + tlb_flush_all_ng_local(); sched_unpin(); - pmap_tlb_flush_ng(pmap); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Tue Dec 15 16:02:11 2015 (r292275) +++ head/sys/arm/include/pmap-v6.h Tue Dec 15 16:04:45 2015 (r292276) @@ -196,7 +196,6 @@ void pmap_set_pcb_pagedir(pmap_t , struc void pmap_tlb_flush(pmap_t , vm_offset_t ); void pmap_tlb_flush_range(pmap_t , vm_offset_t , vm_size_t ); -void pmap_tlb_flush_ng(pmap_t ); void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t ); From owner-svn-src-all@freebsd.org Tue Dec 15 17:25:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCF90A48901; Tue, 15 Dec 2015 17:25:01 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9628614CE; Tue, 15 Dec 2015 17:25:01 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFHP0Lo016589; Tue, 15 Dec 2015 17:25:00 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFHP0RU016588; Tue, 15 Dec 2015 17:25:00 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201512151725.tBFHP0RU016588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 15 Dec 2015 17:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292277 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 17:25:01 -0000 Author: jamie Date: Tue Dec 15 17:25:00 2015 New Revision: 292277 URL: https://svnweb.freebsd.org/changeset/base/292277 Log: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 MFC after: 3 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Dec 15 16:04:45 2015 (r292276) +++ head/sys/kern/kern_jail.c Tue Dec 15 17:25:00 2015 (r292277) @@ -1580,11 +1580,14 @@ kern_jail_set(struct thread *td, struct #endif onamelen = namelen = 0; if (name != NULL) { - /* Give a default name of the jid. */ + /* Give a default name of the jid. Also allow the name to be + * explicitly the jid - but not any other number, and only in + * normal form (no leading zero/etc). + */ if (name[0] == '\0') snprintf(name = numbuf, sizeof(numbuf), "%d", jid); - else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid && - *p == '\0')) { + else if ((strtoul(namelc, &p, 10) != jid || + namelc[0] < '1' || namelc[0] > '9') && *p == '\0') { error = EINVAL; vfs_opterror(opts, "name cannot be numeric (unless it is the jid)"); From owner-svn-src-all@freebsd.org Tue Dec 15 17:58:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 902C8A48E58; Tue, 15 Dec 2015 17:58:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D3231848; Tue, 15 Dec 2015 17:58:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFHwA4j028560; Tue, 15 Dec 2015 17:58:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFHwAOc028557; Tue, 15 Dec 2015 17:58:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151758.tBFHwAOc028557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 17:58: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: r292278 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 17:58:11 -0000 Author: ngie Date: Tue Dec 15 17:58:10 2015 New Revision: 292278 URL: https://svnweb.freebsd.org/changeset/base/292278 Log: MFC r284408,r289151,r289158: r284408: Ensure TESTSDIR is defined before bsd.test.mk is .include'd r289151: Simplify netbsd-tests.test.mk - projects/bmake and subsequent commits provide SRCTOP; there's no need to manually specify it now. - Compute a sane default for OBJTOP based on .OBJDIR and RELDIR. Manually specifying this is probably no longer needed, but it persists just in case (supporting commits will need to be made to move it out of some of the meta .mk files). - Compute a sane default for TESTSRC. Error out if the path cannot be found. Sponsored by: EMC / Isilon Storage Division r289158: Default TESTSDIR to /usr/tests/${RELDIR:H} When run from bin/ls/tests, for example, the value of TESTSDIR would be ${TESTSBASE}/${RELDIR:H} -> /usr/tests/bin/ls/tests/.. -> /usr/tests/bin/ls Document the new behavior in bsd.README. While here, also document TESTSBASE Relnotes: yes Differential Revision: D1022 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/bsd.README stable/10/share/mk/bsd.test.mk stable/10/share/mk/netbsd-tests.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Tue Dec 15 17:25:00 2015 (r292277) +++ stable/10/share/mk/bsd.README Tue Dec 15 17:58:10 2015 (r292278) @@ -425,10 +425,16 @@ It has seven targets: It sets/uses the following variables, among many others: -TESTDIR Path to the installed tests. Must be a subdirectory of +TESTSBASE Installation prefix for tests. Defaults to /usr/tests + +TESTSDIR Path to the installed tests. Must be a subdirectory of TESTSBASE and the subpath should match the relative location of the tests within the src tree. + The value of TESTSDIR defaults to + ${TESTSBASE}/${RELDIR:H} , e.g. /usr/tests/bin/ls when + included from bin/ls/tests . + KYUAFILE If 'auto' (the default), generate a Kyuafile out of the test programs defined in the Makefile. If 'yes', then a manually-crafted Kyuafile must be supplied with the Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Tue Dec 15 17:25:00 2015 (r292277) +++ stable/10/share/mk/bsd.test.mk Tue Dec 15 17:58:10 2015 (r292278) @@ -10,6 +10,9 @@ ____: +# Tests install directory +TESTSDIR?= ${TESTSBASE}/${RELDIR:H} + # List of subdirectories containing tests into which to recurse. This has the # same semantics as SUBDIR at build-time. However, the directories listed here # get registered into the run-time test suite definitions so that the test Modified: stable/10/share/mk/netbsd-tests.test.mk ============================================================================== --- stable/10/share/mk/netbsd-tests.test.mk Tue Dec 15 17:25:00 2015 (r292277) +++ stable/10/share/mk/netbsd-tests.test.mk Tue Dec 15 17:58:10 2015 (r292278) @@ -3,16 +3,12 @@ .if !target(__netbsd_tests.test.mk__) __netbsd_tests.test.mk__: -.if !defined(OBJTOP) -.error "Please define OBJTOP to the absolute path of the top of the object tree" -.endif +OBJTOP?= ${.OBJDIR:S/${RELDIR}//} -.if !defined(SRCTOP) -.error "Please define SRCTOP to the absolute path of the top of the source tree" -.endif +TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/${RELDIR:H} -.if !defined(TESTSRC) -.error "Please define TESTSRC to the absolute path of the test sources, e.g. contrib/netbsd-tests/lib/libc/stdio" +.if !exists(${TESTSRC}/) +.error "Please define TESTSRC to the absolute path of the test sources, e.g. $${SRCTOP}/contrib/netbsd-tests/lib/libc/stdio" .endif .PATH: ${TESTSRC} From owner-svn-src-all@freebsd.org Tue Dec 15 17:59:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 456B9A48F2A; Tue, 15 Dec 2015 17:59:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15B3119F6; Tue, 15 Dec 2015 17:59:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFHxENm028825; Tue, 15 Dec 2015 17:59:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFHxEqN028824; Tue, 15 Dec 2015 17:59:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512151759.tBFHxEqN028824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 15 Dec 2015 17:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292279 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 17:59:15 -0000 Author: avos Date: Tue Dec 15 17:59:13 2015 New Revision: 292279 URL: https://svnweb.freebsd.org/changeset/base/292279 Log: urtwn: fix off-by-one error. Reported by: adrian Modified: head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Tue Dec 15 17:58:10 2015 (r292278) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Tue Dec 15 17:59:13 2015 (r292279) @@ -170,7 +170,7 @@ struct urtwn_softc { int, uint8_t, uint32_t); int (*sc_power_on)(struct urtwn_softc *); - struct ieee80211_node *node_list[R88E_MACID_MAX]; + struct ieee80211_node *node_list[R88E_MACID_MAX + 1]; struct mtx nt_mtx; uint8_t board_type; From owner-svn-src-all@freebsd.org Tue Dec 15 18:01:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0202A431C9; Tue, 15 Dec 2015 18:01:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 746371C3E; Tue, 15 Dec 2015 18:01:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFI15CI031187; Tue, 15 Dec 2015 18:01:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFI15Ab031184; Tue, 15 Dec 2015 18:01:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151801.tBFI15Ab031184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 18:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292280 - in stable/10: tools/build/mk tools/build/options usr.sbin 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 18:01:06 -0000 Author: ngie Date: Tue Dec 15 18:01:05 2015 New Revision: 292280 URL: https://svnweb.freebsd.org/changeset/base/292280 Log: MFC r271401: r271401 (by asomers): Conditionalize build of etcupdate(8) on MK_RCS. Since etcupdate calls merge(1), which is part of the RCS package, it must not be installed if WITHOUT_RCS update is set. Otherwise, it will produce confusing errors. CR: https://reviews.freebsd.org/D691 Sponsored by: Spectra Logic Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/tools/build/options/WITHOUT_RCS stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 15 17:59:13 2015 (r292279) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 15 18:01:05 2015 (r292280) @@ -4081,6 +4081,7 @@ OLD_FILES+=usr/bin/rcsdiff OLD_FILES+=usr/bin/rcsfreeze OLD_FILES+=usr/bin/rcsmerge OLD_FILES+=usr/bin/rlog +OLD_FILES+=usr/sbin/etcupdate OLD_FILES+=usr/share/man/man1/ci.1.gz OLD_FILES+=usr/share/man/man1/co.1.gz OLD_FILES+=usr/share/man/man1/ident.1.gz @@ -4093,6 +4094,7 @@ OLD_FILES+=usr/share/man/man1/rcsintro.1 OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz +OLD_FILES+=usr/share/man/man8/etcupdate.8.gz .endif #.if ${MK_RESCUE} == no Modified: stable/10/tools/build/options/WITHOUT_RCS ============================================================================== --- stable/10/tools/build/options/WITHOUT_RCS Tue Dec 15 17:59:13 2015 (r292279) +++ stable/10/tools/build/options/WITHOUT_RCS Tue Dec 15 18:01:05 2015 (r292280) @@ -1,4 +1,6 @@ .\" $FreeBSD$ Set to not build .Xr rcs 1 -and related utilities. +, +.Xr etcupdate 8 +, and related utilities. Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Tue Dec 15 17:59:13 2015 (r292279) +++ stable/10/usr.sbin/Makefile Tue Dec 15 18:01:05 2015 (r292280) @@ -23,7 +23,6 @@ SUBDIR= adduser \ digictl \ diskinfo \ dumpcis \ - etcupdate \ extattr \ extattrctl \ fifolog \ @@ -302,6 +301,10 @@ SUBDIR+= repquota SUBDIR+= rwhod .endif +.if ${MK_RCS} != "no" +SUBDIR+= etcupdate +.endif + .if ${MK_SENDMAIL} != "no" SUBDIR+= editmap SUBDIR+= mailstats From owner-svn-src-all@freebsd.org Tue Dec 15 18:02:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 983F8A43333; Tue, 15 Dec 2015 18:02:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE171F34; Tue, 15 Dec 2015 18:02:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFI2vwT032271; Tue, 15 Dec 2015 18:02:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFI2vox032267; Tue, 15 Dec 2015 18:02:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151802.tBFI2vox032267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 18:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292281 - in stable/9: tools/build/mk tools/build/options usr.sbin 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 18:02:58 -0000 Author: ngie Date: Tue Dec 15 18:02:56 2015 New Revision: 292281 URL: https://svnweb.freebsd.org/changeset/base/292281 Log: MFstable/10 r292280: MFC r271401: r271401 (by asomers): Conditionalize build of etcupdate(8) on MK_RCS. Since etcupdate calls merge(1), which is part of the RCS package, it must not be installed if WITHOUT_RCS update is set. Otherwise, it will produce confusing errors. CR: https://reviews.freebsd.org/D691 Sponsored by: Spectra Logic Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc stable/9/tools/build/options/WITHOUT_RCS stable/9/usr.sbin/Makefile (contents, props changed) Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) stable/9/tools/build/options/ (props changed) stable/9/usr.sbin/ (props changed) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 15 18:01:05 2015 (r292280) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 15 18:02:56 2015 (r292281) @@ -3697,6 +3697,7 @@ OLD_FILES+=usr/bin/rcsdiff OLD_FILES+=usr/bin/rcsfreeze OLD_FILES+=usr/bin/rcsmerge OLD_FILES+=usr/bin/rlog +OLD_FILES+=usr/sbin/etcupdate OLD_FILES+=usr/share/man/man1/ci.1.gz OLD_FILES+=usr/share/man/man1/co.1.gz OLD_FILES+=usr/share/man/man1/ident.1.gz @@ -3709,6 +3710,7 @@ OLD_FILES+=usr/share/man/man1/rcsintro.1 OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz +OLD_FILES+=usr/share/man/man8/etcupdate.8.gz .endif #.if ${MK_RESCUE} == no Modified: stable/9/tools/build/options/WITHOUT_RCS ============================================================================== --- stable/9/tools/build/options/WITHOUT_RCS Tue Dec 15 18:01:05 2015 (r292280) +++ stable/9/tools/build/options/WITHOUT_RCS Tue Dec 15 18:02:56 2015 (r292281) @@ -1,4 +1,6 @@ .\" $FreeBSD$ Set to not build .Xr rcs 1 -and related utilities. +, +.Xr etcupdate 8 +, and related utilities. Modified: stable/9/usr.sbin/Makefile ============================================================================== --- stable/9/usr.sbin/Makefile Tue Dec 15 18:01:05 2015 (r292280) +++ stable/9/usr.sbin/Makefile Tue Dec 15 18:02:56 2015 (r292281) @@ -22,7 +22,6 @@ SUBDIR= adduser \ digictl \ diskinfo \ dumpcis \ - etcupdate \ extattr \ extattrctl \ fifolog \ @@ -304,6 +303,10 @@ SUBDIR+= repquota SUBDIR+= rwhod .endif +.if ${MK_RCS} != "no" +SUBDIR+= etcupdate +.endif + .if ${MK_SENDMAIL} != "no" SUBDIR+= editmap SUBDIR+= mailstats From owner-svn-src-all@freebsd.org Tue Dec 15 18:09:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92D2FA437C2; Tue, 15 Dec 2015 18:09:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45643138F; Tue, 15 Dec 2015 18:09:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFI94bB033173; Tue, 15 Dec 2015 18:09:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFI94nw033170; Tue, 15 Dec 2015 18:09:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151809.tBFI94nw033170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 18:09: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: r292282 - in stable/10: bin/cat bin/cat/tests etc/mtree 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 18:09:05 -0000 Author: ngie Date: Tue Dec 15 18:09:03 2015 New Revision: 292282 URL: https://svnweb.freebsd.org/changeset/base/292282 Log: MFC r276669,r276723: r276669: Integrate bin/cat/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division r276723: Install d_align.{in,out} for the :align test Pointyhat to: me Added: stable/10/bin/cat/tests/ - copied from r276669, head/bin/cat/tests/ Modified: stable/10/bin/cat/Makefile stable/10/bin/cat/tests/Makefile stable/10/etc/mtree/BSD.tests.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/cat/Makefile ============================================================================== --- stable/10/bin/cat/Makefile Tue Dec 15 18:02:56 2015 (r292281) +++ stable/10/bin/cat/Makefile Tue Dec 15 18:09:03 2015 (r292282) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= cat +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/cat/tests/Makefile ============================================================================== --- head/bin/cat/tests/Makefile Sun Jan 4 22:37:44 2015 (r276669) +++ stable/10/bin/cat/tests/Makefile Tue Dec 15 18:09:03 2015 (r292282) @@ -8,6 +8,11 @@ TESTSDIR= ${TESTSBASE}/bin/cat NETBSD_ATF_TESTS_SH= cat_test +FILESDIR= ${TESTSDIR} + +FILES= d_align.in +FILES+= d_align.out + .include .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Dec 15 18:02:56 2015 (r292281) +++ stable/10/etc/mtree/BSD.tests.dist Tue Dec 15 18:09:03 2015 (r292282) @@ -6,6 +6,8 @@ /set type=dir uname=root gname=wheel mode=0755 . bin + cat + .. chown .. date From owner-svn-src-all@freebsd.org Tue Dec 15 18:42:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10C95A4821D; Tue, 15 Dec 2015 18:42:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFFF01E33; Tue, 15 Dec 2015 18:42:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFIgUg0044848; Tue, 15 Dec 2015 18:42:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFIgUo5044847; Tue, 15 Dec 2015 18:42:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512151842.tBFIgUo5044847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 18:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292283 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 18:42:32 -0000 Author: bdrewery Date: Tue Dec 15 18:42:30 2015 New Revision: 292283 URL: https://svnweb.freebsd.org/changeset/base/292283 Log: Correct comment about MAKEOBJDIRPREFIX in src-env.conf. It may only be used with WITH_AUTO_OBJ, which the WITH_DIRDEPS_BUILD does. We could support this in the normal build as well if we forced creating the directory and setting .OBJDIR. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Tue Dec 15 18:09:03 2015 (r292282) +++ head/tools/build/options/makeman Tue Dec 15 18:42:30 2015 (r292283) @@ -197,11 +197,14 @@ for the build can be controlled via the variable, which defaults to .Pa /etc/src-env.conf . Some examples that may only be set in this file are -.Va MAKEOBJDIRPREFIX , .Va WITH_DIRDEPS_BUILD , and .Va WITH_META_MODE as they are environment-only variables. +Note that +.Va MAKEOBJDIRPREFIX +may be set here only when using +.Va WITH_DIRDEPS_BUILD . .Pp The values of variables are ignored regardless of their setting; even if they would be set to From owner-svn-src-all@freebsd.org Tue Dec 15 18:43:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83203A4829F; Tue, 15 Dec 2015 18:43:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 640781FAE; Tue, 15 Dec 2015 18:43:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8B524B96B; Tue, 15 Dec 2015 13:43:03 -0500 (EST) From: John Baldwin To: Christian Brueffer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292257 - head/contrib/mdocml Date: Tue, 15 Dec 2015 10:36:44 -0800 Message-ID: <13868115.8ZgmAJjd2Y@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512151026.tBFAQllD088459@repo.freebsd.org> References: <201512151026.tBFAQllD088459@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 15 Dec 2015 13:43:03 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 18:43:05 -0000 On Tuesday, December 15, 2015 10:26:47 AM Christian Brueffer wrote: > Author: brueffer > Date: Tue Dec 15 10:26:47 2015 > New Revision: 292257 > URL: https://svnweb.freebsd.org/changeset/base/292257 > > Log: > Add entry for lib80211; fix a typo in libsysdecode. Thanks for the fix. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Dec 15 18:44:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41DA2A48361; Tue, 15 Dec 2015 18:44:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F4AF1152; Tue, 15 Dec 2015 18:44:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFIiTmP044971; Tue, 15 Dec 2015 18:44:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFIiTlD044970; Tue, 15 Dec 2015 18:44:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512151844.tBFIiTlD044970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 18:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292284 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 18:44:30 -0000 Author: bdrewery Date: Tue Dec 15 18:44:28 2015 New Revision: 292284 URL: https://svnweb.freebsd.org/changeset/base/292284 Log: Regenerate after r292283. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Dec 15 18:42:30 2015 (r292283) +++ head/share/man/man5/src.conf.5 Tue Dec 15 18:44:28 2015 (r292284) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 291414 2015-11-28 00:41:37Z ume +.\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd December 8, 2015 +.Dd December 15, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -72,11 +72,14 @@ for the build can be controlled via the variable, which defaults to .Pa /etc/src-env.conf . Some examples that may only be set in this file are -.Va MAKEOBJDIRPREFIX , .Va WITH_DIRDEPS_BUILD , and .Va WITH_META_MODE as they are environment-only variables. +Note that +.Va MAKEOBJDIRPREFIX +may be set here only when using +.Va WITH_DIRDEPS_BUILD . .Pp The values of variables are ignored regardless of their setting; even if they would be set to From owner-svn-src-all@freebsd.org Tue Dec 15 19:57:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9BA5A48378; Tue, 15 Dec 2015 19:57:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 997AD12BD; Tue, 15 Dec 2015 19:57:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFJvuKa066551; Tue, 15 Dec 2015 19:57:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFJvunj066550; Tue, 15 Dec 2015 19:57:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512151957.tBFJvunj066550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 19:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292287 - head/secure/lib/libcrypto/engines X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 19:57:57 -0000 Author: bdrewery Date: Tue Dec 15 19:57:56 2015 New Revision: 292287 URL: https://svnweb.freebsd.org/changeset/base/292287 Log: Build engines in parallel. Sponsored by: EMC / Isilon Storage Division Modified: head/secure/lib/libcrypto/engines/Makefile Modified: head/secure/lib/libcrypto/engines/Makefile ============================================================================== --- head/secure/lib/libcrypto/engines/Makefile Tue Dec 15 19:52:02 2015 (r292286) +++ head/secure/lib/libcrypto/engines/Makefile Tue Dec 15 19:57:56 2015 (r292287) @@ -2,5 +2,5 @@ SUBDIR= lib4758cca libaep libatalla libcapi libchil libcswift libgost \ libnuron libsureware libubsec - +SUBDIR_PARALLEL= .include From owner-svn-src-all@freebsd.org Tue Dec 15 21:02:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42033A48C97; Tue, 15 Dec 2015 21:02:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10EB01AAE; Tue, 15 Dec 2015 21:02:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFL2sF8087469; Tue, 15 Dec 2015 21:02:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFL2s4g087468; Tue, 15 Dec 2015 21:02:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512152102.tBFL2s4g087468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 15 Dec 2015 21:02:54 +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: r292288 - stable/10/sbin/pfctl 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 21:02:55 -0000 Author: kp Date: Tue Dec 15 21:02:53 2015 New Revision: 292288 URL: https://svnweb.freebsd.org/changeset/base/292288 Log: MFC r290236 pfctl: Fix uninitialised veriable In pfctl_set_debug() we used 'level' without ever initialising it. We correctly parsed the option, but them failed to actually assign the parsed value to 'level' before performing to ioctl() to configure the debug level. PR: 202996 Submitted by: Andrej Kolontai Modified: stable/10/sbin/pfctl/pfctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/pfctl/pfctl.c ============================================================================== --- stable/10/sbin/pfctl/pfctl.c Tue Dec 15 19:57:56 2015 (r292287) +++ stable/10/sbin/pfctl/pfctl.c Tue Dec 15 21:02:53 2015 (r292288) @@ -1845,6 +1845,7 @@ pfctl_set_debug(struct pfctl *pf, char * } pf->debug_set = 1; + level = pf->debug; if ((pf->opts & PF_OPT_NOACTION) == 0) if (ioctl(dev, DIOCSETDEBUG, &level)) From owner-svn-src-all@freebsd.org Tue Dec 15 21:11:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 947CEA48287; Tue, 15 Dec 2015 21:11:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49CAD1129; Tue, 15 Dec 2015 21:11:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFLBf3C088737; Tue, 15 Dec 2015 21:11:41 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFLBfig088736; Tue, 15 Dec 2015 21:11:41 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512152111.tBFLBfig088736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 15 Dec 2015 21:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292289 - head/sys/geom/multipath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 21:11:42 -0000 Author: smh Date: Tue Dec 15 21:11:41 2015 New Revision: 292289 URL: https://svnweb.freebsd.org/changeset/base/292289 Log: Prevent g_access calls to bad multipath members When a multipath member is orphaned its access members are zeroed before its removed if marked for wither, so prevent any future calls to g_access on such members. This prevents a panic on debug kernels which validates the resultant values aren't negative. Reviewed by: mav MFC after: 2 weeks Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4416 Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Tue Dec 15 21:02:53 2015 (r292288) +++ head/sys/geom/multipath/g_multipath.c Tue Dec 15 21:11:41 2015 (r292289) @@ -107,8 +107,9 @@ struct g_class g_multipath_class = { #define MP_NEW 0x00000004 #define MP_POSTED 0x00000008 #define MP_BAD (MP_FAIL | MP_LOST | MP_NEW) -#define MP_IDLE 0x00000010 -#define MP_IDLE_MASK 0xfffffff0 +#define MP_WITHER 0x00000010 +#define MP_IDLE 0x00000020 +#define MP_IDLE_MASK 0xffffffe0 static int g_multipath_good(struct g_geom *gp) @@ -204,6 +205,7 @@ g_mpd(void *arg, int flags __unused) g_access(cp, -cp->acr, -cp->acw, -cp->ace); if (w > 0 && cp->provider != NULL && (cp->provider->geom->flags & G_GEOM_WITHER) == 0) { + cp->index |= MP_WITHER; g_post_event(g_mpd, cp, M_WAITOK, NULL); return; } @@ -467,23 +469,37 @@ g_multipath_access(struct g_provider *pp gp = pp->geom; + /* Error used if we have no valid consumers. */ + error = ENXIO; + LIST_FOREACH(cp, &gp->consumer, consumer) { + if (cp->index & MP_WITHER) + continue; + error = g_access(cp, dr, dw, de); if (error) { badcp = cp; goto fail; } } + + if (error != 0) + return (error); + sc = gp->softc; sc->sc_opened += dr + dw + de; if (sc->sc_stopping && sc->sc_opened == 0) g_multipath_destroy(gp); + return (0); fail: LIST_FOREACH(cp, &gp->consumer, consumer) { if (cp == badcp) break; + if (cp->index & MP_WITHER) + continue; + (void) g_access(cp, -dr, -dw, -de); } return (error); From owner-svn-src-all@freebsd.org Tue Dec 15 21:19:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C728A486CE; Tue, 15 Dec 2015 21:19:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3931808; Tue, 15 Dec 2015 21:19:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFLJWJa091217; Tue, 15 Dec 2015 21:19:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFLJWYL091216; Tue, 15 Dec 2015 21:19:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512152119.tBFLJWYL091216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 15 Dec 2015 21:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292290 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 21:19:33 -0000 Author: mav Date: Tue Dec 15 21:19:32 2015 New Revision: 292290 URL: https://svnweb.freebsd.org/changeset/base/292290 Log: Set DS flag, required for LPB log page by spec. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 15 21:11:41 2015 (r292289) +++ head/sys/cam/ctl/ctl.c Tue Dec 15 21:19:32 2015 (r292290) @@ -6868,6 +6868,8 @@ ctl_log_sense(struct ctl_scsiio *ctsio) header = (struct scsi_log_header *)ctsio->kern_data_ptr; header->page = page_index->page_code; + if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING) + header->page |= SL_DS; if (page_index->subpage) { header->page |= SL_SPF; header->subpage = page_index->subpage; From owner-svn-src-all@freebsd.org Tue Dec 15 22:15:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 475F4A48D49; Tue, 15 Dec 2015 22:15:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 110CF1DB1; Tue, 15 Dec 2015 22:15:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:584e:4e41:54fa:aebf] (unknown [IPv6:2a02:1811:2419:4e02:584e:4e41:54fa:aebf]) by venus.codepro.be (Postfix) with ESMTPSA id 2C9FA8613; Tue, 15 Dec 2015 23:15:34 +0100 (CET) Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=utf-8 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <201512151602.tBFG2BTX089543@repo.freebsd.org> Date: Tue, 15 Dec 2015 23:15:31 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> References: <201512151602.tBFG2BTX089543@repo.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 22:15:37 -0000 > On 15 Dec 2015, at 17:02, Steven Hartland wrote: >=20 > Author: smh > Date: Tue Dec 15 16:02:11 2015 > New Revision: 292275 > URL: https://svnweb.freebsd.org/changeset/base/292275 >=20 > Log: > Fix lagg failover due to missing notifications >=20 I=E2=80=99ve just built a new image (r292287-based) for my TPLink = tl-wdr3600 device, and see the following panic: uhub0: 1 port with 1 removable, self powered random: harvesting attach, 8 bytes (4 bits) from uhub0 arswitch0: arswitch_miipollstat: port 1: port -> UP arswitch0port2: link state changed to UP Trap cause =3D 2 (TLB miss (load or instr. fetch) - kernel mode) [ thread pid 11 tid 100017 ] Stopped at arp_announce+0x134: lw v0,0(v0) db> bt Tracing pid 11 tid 100017 td 0x80a746c0 db_trace_thread+30 (?,?,?,?) ra c462b8b000000018 sp 0 sz 0 8008c520+114 (0,?,ffffffff,?) ra c462b8c800000020 sp 100000000 sz 1 8008b864+388 (?,?,?,?) ra c462b8e8000000a8 sp 0 sz 0 db_command_loop+70 (?,?,?,?) ra c462b99000000018 sp 0 sz 0 8008e438+f4 (?,?,?,?) ra c462b9a8000001a8 sp 0 sz 0 kdb_trap+100 (?,?,?,?) ra c462bb5000000030 sp 0 sz 0 trap+fac (?,?,?,?) ra c462bb80000000c0 sp 0 sz 0 MipsKernGenException+ec (1,80a746c0,8049fcf8,4df) ra c462bc40000000c8 sp = 100000001 sz 1 arp_announce+134 (?,?,?,?) ra c462bd0800000030 sp 0 sz 0 8031d868+2c (?,?,?,?) ra c462bd3800000018 sp 0 sz 0 802b7e40+1fc (?,?,?,?) ra c462bd5000000028 sp 0 sz 0 8022bc8c+f0 (?,?,?,?) ra c462bd7800000040 sp 0 sz 0 taskqueue_run+58 (?,?,?,?) ra c462bdb800000018 sp 0 sz 0 8022bf5c+18 (?,?,?,?) ra c462bdd000000018 sp 0 sz 0 intr_event_execute_handlers+158 (?,?,?,?) ra c462bde800000028 sp 0 sz 0 801ad9a0+c4 (?,?,?,?) ra c462be1000000048 sp 0 sz 0 fork_exit+b0 (?,?,?,?) ra c462be5800000028 sp 0 sz 0 fork_trampoline+10 (?,?,?,?) ra c462be8000000000 sp 0 sz 0 pid 11 Based on the arp_announce() in the backtrace this commit looks like a = possible cause. I=E2=80=99ll take a look and see what I can figure out, but if something = pops out for you please let me know Regards, Kristof= From owner-svn-src-all@freebsd.org Tue Dec 15 22:58:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 928E9A48A7A; Tue, 15 Dec 2015 22:58:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60F5E1637; Tue, 15 Dec 2015 22:58:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:584e:4e41:54fa:aebf] (unknown [IPv6:2a02:1811:2419:4e02:584e:4e41:54fa:aebf]) by venus.codepro.be (Postfix) with ESMTPSA id 440998662; Tue, 15 Dec 2015 23:58:11 +0100 (CET) Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=utf-8 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> Date: Tue, 15 Dec 2015 23:58:09 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> To: Steven Hartland X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 22:58:15 -0000 > On 15 Dec 2015, at 23:15, Kristof Provost wrote: > Based on the arp_announce() in the backtrace this commit looks like a = possible cause. I see this in arp_announce():=20 KP: arp_announce() ifp->if_addr =3D 0 So that explains why we panic in 'lladdr =3D IF_LLADDR(ifp);=E2=80=99. I=E2=80=99ve done a very quick hack: diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 2214542..9b25356 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1246,9 +1246,15 @@ arp_announce(struct ifnet *ifp) } IF_ADDR_RUNLOCK(ifp); - lladdr =3D IF_LLADDR(ifp); - for (i =3D 0; i < cnt; i++) { - arp_announce_addr(ifp, head + i, lladdr); + printf("KP: %s() ifp =3D %p\n", __FUNCTION__, ifp); + printf("KP: %s() ifp->if_addr =3D %p\n", __FUNCTION__, = ifp->if_addr); + + if (ifp->if_addr) { + printf("KP: %s() ifp->if_addr->ifa_addr =3D %p\n", = __FUNCTION__, ifp->if_addr->ifa_addr); + lladdr =3D IF_LLADDR(ifp); + for (i =3D 0; i < cnt; i++) { + arp_announce_addr(ifp, head + i, lladdr); + } } free(head, M_TEMP); } With this patch the device boots. I haven=E2=80=99t been able to verify = if everything works because of a different issue ("Shared object = "lib80211.so.1" not found, required by =E2=80=9Cifconfig=E2=80=9D=E2=80=9D= , no doubt just a small problem with the freebsd-wifi-build scripts). Regards, Kristof= From owner-svn-src-all@freebsd.org Tue Dec 15 23:06:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC6DEA48FA2; Tue, 15 Dec 2015 23:06:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6575B1CAD; Tue, 15 Dec 2015 23:06:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFN6FnV024509; Tue, 15 Dec 2015 23:06:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFN6FIs024508; Tue, 15 Dec 2015 23:06:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512152306.tBFN6FIs024508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 15 Dec 2015 23:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292291 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 23:06:16 -0000 Author: jhb Date: Tue Dec 15 23:06:15 2015 New Revision: 292291 URL: https://svnweb.freebsd.org/changeset/base/292291 Log: Keep the entries for NFS and the PCI bus code. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Dec 15 21:19:32 2015 (r292290) +++ head/MAINTAINERS Tue Dec 15 23:06:15 2015 (r292291) @@ -51,6 +51,7 @@ lpr gad Pre-commit review requested, pa lpd/recvjob.c and lpd/printjob.c. nanobsd imp Pre-commit phabricator review requested. net80211 adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +nfs freebsd-fs@FreeBSD.org, rmacklem is best for reviews. nis(8), yp(8) araujo Pre-commit review requested. nvd(4) jimharris Pre-commit review requested. nvme(4) jimharris Pre-commit review requested. @@ -59,6 +60,7 @@ opencrypto jmg Pre-commit review request openssh des Pre-commit review requested. openssl benl,jkim Pre-commit review requested. otus(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +pci bus imp,jhb Pre-commit review requested. pmcstudy(8) rrs Pre-commit review requested. procfs des Pre-commit review requested. pseudofs des Pre-commit review requested. @@ -92,7 +94,6 @@ contrib/openbsm rwatson Pre-commit revie sys/security/audit rwatson Pre-commit review requested. ahc(4) gibbs Pre-commit review requested. ahd(4) gibbs Pre-commit review requested. -pci bus imp,jhb Pre-commit review requested. cdboot jhb Pre-commit review requested. pxeboot jhb Pre-commit review requested. witness jhb Pre-commit review requested. @@ -133,7 +134,6 @@ geom_stripe pjd Pre-commit review prefer geom_zero pjd Pre-commit review preferred. sbin/geom pjd Pre-commit review preferred. zfs freebsd-fs@FreeBSD.org -nfs freebsd-fs@FreeBSD.org, rmacklem is best for reviews. linux emul emulation Please discuss changes here. bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. From owner-svn-src-all@freebsd.org Tue Dec 15 23:08:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208C4A4913D; Tue, 15 Dec 2015 23:08:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E819E1F07; Tue, 15 Dec 2015 23:08:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22a.google.com with SMTP id e126so36845296ioa.1; Tue, 15 Dec 2015 15:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Lmx7MMLki3JGeUnZcljMYLEiuP31qY4UGW9RpTLzSxc=; b=vX/G4n2DdVNe753E8m5ygq7MPVYqOUukexCK+T0viTO7d59vcuvSCBAmPTyG8T9m8I X+J7gI2g/CdqrY2xt3YcS9kU210s6BHCCAfFPzApNR0LwtQRCi7vEcHs35tiB5Z/m7Gi t6Y7pf/7yaBCrqT/t06DAEsAzRrq3alYEUBK1zBhH/ggFHTLYHel476S5u2KaijRDQ/C buMZvZvVrpDw/VFOvtIeOWW9HN5ets+EXp9NHiB4zvVQQ/rT2p16IHUEjibQw3OHw7Dq ZQVqnYliXXzbyX1LpG/bEhOUjZ6t/HavARfeCUSm4sWLR8xNG3E1JvFTb7SVut1eAGqD 1YRQ== MIME-Version: 1.0 X-Received: by 10.107.11.147 with SMTP id 19mr36002731iol.165.1450220885408; Tue, 15 Dec 2015 15:08:05 -0800 (PST) Received: by 10.36.121.202 with HTTP; Tue, 15 Dec 2015 15:08:05 -0800 (PST) In-Reply-To: <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> Date: Tue, 15 Dec 2015 15:08:05 -0800 Message-ID: Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 From: Adrian Chadd To: Kristof Provost Cc: Steven Hartland , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 15 Dec 2015 23:08:06 -0000 oops, file a bug at github.com/freebsd/freebsd-wifi-build and I'll fix it asap. -a From owner-svn-src-all@freebsd.org Wed Dec 16 00:13:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706F9A48CB3; Wed, 16 Dec 2015 00:13:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43E291AFC; Wed, 16 Dec 2015 00:13:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0DGj8048911; Wed, 16 Dec 2015 00:13:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0DGhd048910; Wed, 16 Dec 2015 00:13:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512160013.tBG0DGhd048910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 16 Dec 2015 00:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292299 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 00:13:17 -0000 Author: adrian Date: Wed Dec 16 00:13:16 2015 New Revision: 292299 URL: https://svnweb.freebsd.org/changeset/base/292299 Log: Don't call wakeup if we're just returning reserved space; just return the reservation and wait for more space to appear. Submitted by: jeff Reviewed by: kib Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Dec 16 00:09:57 2015 (r292298) +++ head/sys/kern/vfs_bio.c Wed Dec 16 00:13:16 2015 (r292299) @@ -2909,7 +2909,7 @@ getnewbuf(struct vnode *vp, int slpflag, } while(buf_scan(false) == 0); if (reserved) - bufspace_release(maxsize); + atomic_subtract_long(&bufspace, maxsize); if (bp != NULL) { bp->b_flags |= B_INVAL; brelse(bp); From owner-svn-src-all@freebsd.org Wed Dec 16 00:21:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910D0A49075; Wed, 16 Dec 2015 00:21:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6427C12EB; Wed, 16 Dec 2015 00:21:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0LLS2052283; Wed, 16 Dec 2015 00:21:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0LL1V052282; Wed, 16 Dec 2015 00:21:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201512160021.tBG0LL1V052282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 16 Dec 2015 00:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292304 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 00:21:22 -0000 Author: gjb Date: Wed Dec 16 00:21:21 2015 New Revision: 292304 URL: https://svnweb.freebsd.org/changeset/base/292304 Log: Err on the side of caution, and assume *env(3) should require secteam@ review for changes. so@ can remove this entry, if necessary. Submitted by: jhb (via secteam@) Sponsored by: The FreeBSD Foundation Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Dec 16 00:20:20 2015 (r292303) +++ head/MAINTAINERS Wed Dec 16 00:21:21 2015 (r292304) @@ -37,6 +37,8 @@ contrib/llvm/tools/lldb emaste Pre-commi contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. contrib/pjdfstest freebsd-testing,ngie,pjd Pre-commit review requested. dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +*env(3) secteam Due to the problematic security history of this + code, please have patches reviewed by secteam. etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. etc/sendmail gshapiro Pre-commit review requested. Keep in sync with -STABLE. fetch des Pre-commit review requested. @@ -143,8 +145,6 @@ lib/libbluetooth emax Pre-commit review lib/libsdp emax Pre-commit review preferred. usr.bin/bluetooth emax Pre-commit review preferred. usr.sbin/bluetooth emax Pre-commit review preferred. -*env(3) secteam Due to the problematic security history of this - code, please have patches reviewed by secteam. share/zoneinfo edwin Heads-up appreciated, since our data is coming from a third party source. usr.sbin/zic edwin Heads-up appreciated, since this code is From owner-svn-src-all@freebsd.org Wed Dec 16 00:52:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A5CA483C2; Wed, 16 Dec 2015 00:52:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97CF1A1C; Wed, 16 Dec 2015 00:52:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0qZVg066256; Wed, 16 Dec 2015 00:52:35 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0qZjv066253; Wed, 16 Dec 2015 00:52:35 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512160052.tBG0qZjv066253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 16 Dec 2015 00:52: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: r292307 - stable/10/sys/fs/nfs 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 00:52:37 -0000 Author: rmacklem Date: Wed Dec 16 00:52:35 2015 New Revision: 292307 URL: https://svnweb.freebsd.org/changeset/base/292307 Log: MFC: r291638 Fix the memory leak that occurs when the nfscommon.ko module is unloaded. This leak was introduced by r291527 (r292223 in stable/10). Since the nfscommon.ko module is rarely unloaded, this leak would not have been much of an issue. Modified: stable/10/sys/fs/nfs/nfs_commonport.c stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonport.c Wed Dec 16 00:22:58 2015 (r292306) +++ stable/10/sys/fs/nfs/nfs_commonport.c Wed Dec 16 00:52:35 2015 (r292307) @@ -624,6 +624,8 @@ nfscommon_modevent(module_t mod, int typ nfsd_call_nfscommon = NULL; callout_drain(&newnfsd_callout); + /* Clean out the name<-->id cache. */ + nfsrv_cleanusergroup(); /* and get rid of the mutexes */ mtx_destroy(&nfs_nameid_mutex); mtx_destroy(&newnfsd_mtx); Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Wed Dec 16 00:22:58 2015 (r292306) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Wed Dec 16 00:52:35 2015 (r292307) @@ -3539,6 +3539,55 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, } /* + * Free up all the allocations related to the name<-->id cache. + * This function should only be called when the nfsuserd daemon isn't + * running, since it doesn't do any locking. + * This function is meant to be used when the nfscommon module is unloaded. + */ +APPLESTATIC void +nfsrv_cleanusergroup(void) +{ + struct nfsrv_lughash *hp, *hp2; + struct nfsusrgrp *nusrp, *usrp; + int i; + + if (nfsuserhash == NULL) + return; + + for (i = 0; i < nfsrv_lughashsize; i++) { + hp = &nfsuserhash[i]; + TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) { + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp2 = NFSUSERNAMEHASH(usrp->lug_name, + usrp->lug_namelen); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_namehash); + if (usrp->lug_cred != NULL) + crfree(usrp->lug_cred); + free(usrp, M_NFSUSERGROUP); + } + hp = &nfsgrouphash[i]; + TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) { + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp2 = NFSGROUPNAMEHASH(usrp->lug_name, + usrp->lug_namelen); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_namehash); + if (usrp->lug_cred != NULL) + crfree(usrp->lug_cred); + free(usrp, M_NFSUSERGROUP); + } + mtx_destroy(&nfsuserhash[i].mtx); + mtx_destroy(&nfsusernamehash[i].mtx); + mtx_destroy(&nfsgroupnamehash[i].mtx); + mtx_destroy(&nfsgrouphash[i].mtx); + } + free(nfsuserhash, M_NFSUSERGROUP); + free(nfsusernamehash, M_NFSUSERGROUP); + free(nfsgrouphash, M_NFSUSERGROUP); + free(nfsgroupnamehash, M_NFSUSERGROUP); + free(nfsrv_dnsname, M_NFSSTRING); +} + +/* * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Wed Dec 16 00:22:58 2015 (r292306) +++ stable/10/sys/fs/nfs/nfs_var.h Wed Dec 16 00:52:35 2015 (r292307) @@ -283,6 +283,7 @@ void nfsv4_getref(struct nfsv4lock *, in int nfsv4_getref_nonblock(struct nfsv4lock *); int nfsv4_testlock(struct nfsv4lock *); int nfsrv_mtostr(struct nfsrv_descript *, char *, int); +void nfsrv_cleanusergroup(void); int nfsrv_checkutf8(u_int8_t *, int); int newnfs_sndlock(int *); void newnfs_sndunlock(int *); From owner-svn-src-all@freebsd.org Wed Dec 16 00:56:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71991A485D8; Wed, 16 Dec 2015 00:56:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D371CE3; Wed, 16 Dec 2015 00:56:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0ucNp067116; Wed, 16 Dec 2015 00:56:38 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0ucQb067115; Wed, 16 Dec 2015 00:56:38 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201512160056.tBG0ucQb067115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 16 Dec 2015 00:56: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: r292308 - stable/10/sys/sparc64/include 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 00:56:39 -0000 Author: marius Date: Wed Dec 16 00:56:38 2015 New Revision: 292308 URL: https://svnweb.freebsd.org/changeset/base/292308 Log: MFC: r257066 (partial) Mark unused parameters of bus_space_subregion(9) as such. Modified: stable/10/sys/sparc64/include/bus.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sparc64/include/bus.h ============================================================================== --- stable/10/sys/sparc64/include/bus.h Wed Dec 16 00:52:35 2015 (r292307) +++ stable/10/sys/sparc64/include/bus.h Wed Dec 16 00:56:38 2015 (r292308) @@ -146,8 +146,8 @@ bus_space_barrier(bus_space_tag_t t, bus } static __inline int -bus_space_subregion(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - bus_size_t s, bus_space_handle_t *hp) +bus_space_subregion(bus_space_tag_t t __unused, bus_space_handle_t h, + bus_size_t o __unused, bus_size_t s __unused, bus_space_handle_t *hp) { *hp = h + o; From owner-svn-src-all@freebsd.org Wed Dec 16 00:56:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94212A4860B; Wed, 16 Dec 2015 00:56:47 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8781E17; Wed, 16 Dec 2015 00:56:47 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0ukAN067186; Wed, 16 Dec 2015 00:56:46 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0ujqA067178; Wed, 16 Dec 2015 00:56:45 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512160056.tBG0ujqA067178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 16 Dec 2015 00:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 00:56:47 -0000 Author: rrs Date: Wed Dec 16 00:56:45 2015 New Revision: 292309 URL: https://svnweb.freebsd.org/changeset/base/292309 Log: First cut of the modularization of our TCP stack. Still to do is to clean up the timer handling using the async-drain. Other optimizations may be coming to go with this. Whats here will allow differnet tcp implementations (one included). Reviewed by: jtl, hiren, transports Sponsored by: Netflix Inc. Differential Revision: D4055 Added: head/sys/modules/tcp/ head/sys/modules/tcp/fastpath/ head/sys/modules/tcp/fastpath/Makefile (contents, props changed) head/sys/netinet/tcp_stacks/ head/sys/netinet/tcp_stacks/fastpath.c (contents, props changed) Modified: head/sys/modules/Makefile head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/netinet/toecore.c Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Dec 16 00:56:38 2015 (r292308) +++ head/sys/modules/Makefile Wed Dec 16 00:56:45 2015 (r292309) @@ -346,6 +346,7 @@ SUBDIR= \ ${_syscons} \ sysvipc \ ${_ti} \ + tcp/fastpath \ tests/framework \ tests/callout_test \ tl \ Added: head/sys/modules/tcp/fastpath/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tcp/fastpath/Makefile Wed Dec 16 00:56:45 2015 (r292309) @@ -0,0 +1,15 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../netinet/tcp_stacks + +KMOD= fastpath +SRCS= fastpath.c + +# +# Enable full debugging +# +#CFLAGS += -g + +.include Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Wed Dec 16 00:56:38 2015 (r292308) +++ head/sys/netinet/tcp.h Wed Dec 16 00:56:45 2015 (r292309) @@ -167,7 +167,7 @@ struct tcphdr { #define TCP_KEEPCNT 1024 /* L,N number of keepalives before close */ #define TCP_PCAP_OUT 2048 /* number of output packets to keep */ #define TCP_PCAP_IN 4096 /* number of input packets to keep */ - +#define TCP_FUNCTION_BLK 8192 /* Set the tcp function pointers to the specified stack */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR @@ -245,5 +245,11 @@ struct tcp_info { u_int32_t __tcpi_pad[26]; /* Padding. */ }; #endif +#define TCP_FUNCTION_NAME_LEN_MAX 32 + +struct tcp_function_set { + char function_set_name[TCP_FUNCTION_NAME_LEN_MAX]; + uint32_t pcbcnt; +}; #endif /* !_NETINET_TCP_H_ */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Dec 16 00:56:38 2015 (r292308) +++ head/sys/netinet/tcp_input.c Wed Dec 16 00:56:45 2015 (r292309) @@ -230,23 +230,6 @@ VNET_DEFINE(struct inpcbhead, tcb); #define tcb6 tcb /* for KAME src sync over BSD*'s */ VNET_DEFINE(struct inpcbinfo, tcbinfo); -static void tcp_dooptions(struct tcpopt *, u_char *, int, int); -static void tcp_do_segment(struct mbuf *, struct tcphdr *, - struct socket *, struct tcpcb *, int, int, uint8_t, - int); -static void tcp_dropwithreset(struct mbuf *, struct tcphdr *, - struct tcpcb *, int, int); -static void tcp_pulloutofband(struct socket *, - struct tcphdr *, struct mbuf *, int); -static void tcp_xmit_timer(struct tcpcb *, int); -static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -static void inline cc_ack_received(struct tcpcb *tp, struct tcphdr *th, - uint16_t type); -static void inline cc_conn_init(struct tcpcb *tp); -static void inline cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); -static void inline hhook_run_tcp_est_in(struct tcpcb *tp, - struct tcphdr *th, struct tcpopt *to); - /* * TCP statistics are stored in an "array" of counter(9)s. */ @@ -272,7 +255,7 @@ kmod_tcpstat_inc(int statnum) /* * Wrapper for the TCP established input helper hook. */ -static void inline +void hhook_run_tcp_est_in(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) { struct tcp_hhook_data hhook_data; @@ -290,7 +273,7 @@ hhook_run_tcp_est_in(struct tcpcb *tp, s /* * CC wrapper hook functions */ -static void inline +void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type) { INP_WLOCK_ASSERT(tp->t_inpcb); @@ -322,7 +305,7 @@ cc_ack_received(struct tcpcb *tp, struct } } -static void inline +void cc_conn_init(struct tcpcb *tp) { struct hc_metrics_lite metrics; @@ -446,7 +429,7 @@ cc_cong_signal(struct tcpcb *tp, struct } } -static void inline +void inline cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) { INP_WLOCK_ASSERT(tp->t_inpcb); @@ -601,9 +584,6 @@ tcp_input(struct mbuf **mp, int *offp, i struct tcpopt to; /* options in this segment */ char *s = NULL; /* address and port logging */ int ti_locked; -#define TI_UNLOCKED 1 -#define TI_RLOCKED 2 - #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -1175,7 +1155,7 @@ relocked: * contains. tcp_do_segment() consumes * the mbuf chain and unlocks the inpcb. */ - tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, + tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos, ti_locked); INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return (IPPROTO_DONE); @@ -1421,7 +1401,7 @@ relocked: * state. tcp_do_segment() always consumes the mbuf chain, unlocks * the inpcb, and unlocks pcbinfo. */ - tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos, ti_locked); + tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos, ti_locked); INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return (IPPROTO_DONE); @@ -1476,7 +1456,7 @@ drop: return (IPPROTO_DONE); } -static void +void tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, int ti_locked) @@ -1788,7 +1768,7 @@ tcp_do_segment(struct mbuf *m, struct tc tp->t_rxtcur); sowwakeup(so); if (sbavail(&so->so_snd)) - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); goto check_delack; } } else if (th->th_ack == tp->snd_una && @@ -1907,7 +1887,7 @@ tcp_do_segment(struct mbuf *m, struct tc tp->t_flags |= TF_DELACK; } else { tp->t_flags |= TF_ACKNOW; - tcp_output(tp); + tp->t_fb->tfb_tcp_output(tp); } goto check_delack; } @@ -2522,7 +2502,7 @@ tcp_do_segment(struct mbuf *m, struct tc } } else tp->snd_cwnd += tp->t_maxseg; - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } else if (tp->t_dupacks == tcprexmtthresh) { tcp_seq onxt = tp->snd_nxt; @@ -2556,12 +2536,12 @@ tcp_do_segment(struct mbuf *m, struct tc tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; tp->snd_cwnd = tp->t_maxseg; - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); goto drop; } tp->snd_nxt = th->th_ack; tp->snd_cwnd = tp->t_maxseg; - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", __func__)); @@ -2608,7 +2588,7 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->snd_nxt - tp->snd_una); SOCKBUF_UNLOCK(&so->so_snd); if (avail > 0) - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { KASSERT((tp->t_dupacks == 2 && @@ -3074,7 +3054,7 @@ dodata: /* XXX */ * Return any desired output. */ if (needoutput || (tp->t_flags & TF_ACKNOW)) - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); check_delack: KASSERT(ti_locked == TI_UNLOCKED, ("%s: check_delack ti_locked %d", @@ -3122,7 +3102,7 @@ dropafterack: ti_locked = TI_UNLOCKED; tp->t_flags |= TF_ACKNOW; - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); INP_WUNLOCK(tp->t_inpcb); m_freem(m); return; @@ -3168,7 +3148,7 @@ drop: * The mbuf must still include the original packet header. * tp may be NULL. */ -static void +void tcp_dropwithreset(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int tlen, int rstreason) { @@ -3231,7 +3211,7 @@ drop: /* * Parse TCP options and place in tcpopt. */ -static void +void tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags) { int opt, optlen; @@ -3325,7 +3305,7 @@ tcp_dooptions(struct tcpopt *to, u_char * It is still reflected in the segment length for * sequencing purposes. */ -static void +void tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m, int off) { @@ -3358,7 +3338,7 @@ tcp_pulloutofband(struct socket *so, str * Collect new round-trip time estimate * and update averages and current timeout. */ -static void +void tcp_xmit_timer(struct tcpcb *tp, int rtt) { int delta; @@ -3738,7 +3718,7 @@ tcp_mssopt(struct in_conninfo *inc) * By setting snd_nxt to ti_ack, this forces retransmission timer to * be started again. */ -static void +void tcp_newreno_partial_ack(struct tcpcb *tp, struct tcphdr *th) { tcp_seq onxt = tp->snd_nxt; @@ -3755,7 +3735,7 @@ tcp_newreno_partial_ack(struct tcpcb *tp */ tp->snd_cwnd = tp->t_maxseg + BYTES_THIS_ACK(tp, th); tp->t_flags |= TF_ACKNOW; - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); tp->snd_cwnd = ocwnd; if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Wed Dec 16 00:56:38 2015 (r292308) +++ head/sys/netinet/tcp_sack.c Wed Dec 16 00:56:45 2015 (r292309) @@ -599,7 +599,7 @@ tcp_sack_partialack(struct tcpcb *tp, st if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; tp->t_flags |= TF_ACKNOW; - (void) tcp_output(tp); + (void) tp->t_fb->tfb_tcp_output(tp); } #if 0 Added: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Dec 16 00:56:45 2015 (r292309) @@ -0,0 +1,2486 @@ +/*- + * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 2007-2008,2010 + * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2009-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010-2011 Juniper Networks, Inc. + * Copyright (c) 2015 Netflix Inc. + * All rights reserved. + * + * Portions of this software were developed at the Centre for Advanced Internet + * Architectures, Swinburne University of Technology, by Lawrence Stewart, + * James Healy and David Hayes, made possible in part by a grant from the Cisco + * University Research Program Fund at Community Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes under sponsorship from the FreeBSD Foundation. + * + * Portions of this software were developed by Robert N. M. Watson under + * contract to Juniper Networks, Inc. + * + * Portions of this software were developed by Randall R. Stewart while + * working for Netflix Inc. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ipfw.h" /* for ipfw_fwd */ +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipsec.h" +#include "opt_kdtrace.h" +#include "opt_tcpdebug.h" + +#include +#include +#include +#include +#include +#include +#include /* for proc0 declaration */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include /* before tcp_seq.h, for tcp_random18() */ + +#include + +#include +#include +#include +#include + +#define TCPSTATES /* for logging */ + +#include +#include +#include +#include +#include +#include +#include +#include /* required for icmp_var.h */ +#include /* for ICMP_BANDLIM */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef TCPDEBUG +#include +#endif /* TCPDEBUG */ +#ifdef TCP_OFFLOAD +#include +#endif + +#ifdef IPSEC +#include +#include +#endif /*IPSEC*/ + +#include + +#include + +const int tcprexmtthresh; + +VNET_DECLARE(int, tcp_autorcvbuf_inc); +#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) +VNET_DECLARE(int, tcp_autorcvbuf_max); +#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) +VNET_DECLARE(int, tcp_do_rfc3042); +#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) +VNET_DECLARE(int, tcp_do_autorcvbuf); +#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) +VNET_DECLARE(int, tcp_insecure_rst); +#define V_tcp_insecure_rst VNET(tcp_insecure_rst) +VNET_DECLARE(int, tcp_insecure_syn); +#define V_tcp_insecure_syn VNET(tcp_insecure_syn) + + + + +extern void tcp_dooptions(struct tcpopt *, u_char *, int, int); +extern void tcp_dropwithreset(struct mbuf *, struct tcphdr *, + struct tcpcb *, int, int); +extern void tcp_pulloutofband(struct socket *, + struct tcphdr *, struct mbuf *, int); +extern void tcp_xmit_timer(struct tcpcb *, int); +extern void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); +extern void tcp_mss(struct tcpcb *tp, int offer); +extern void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, + uint16_t type); +extern void cc_conn_init(struct tcpcb *tp); +extern void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); +extern void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); +extern void hhook_run_tcp_est_in(struct tcpcb *tp, + struct tcphdr *th, struct tcpopt *to); + +extern void kmod_tcpstat_inc(int statnum); +#ifdef TCP_SIGNATURE +extern int tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen, + struct tcpopt *to, struct tcphdr *th, u_int tcpbflag); +#endif + +static void tcp_do_segment_fastslow(struct mbuf *, struct tcphdr *, + struct socket *, struct tcpcb *, int, int, uint8_t, + int); + +static void tcp_do_segment_fastack(struct mbuf *, struct tcphdr *, + struct socket *, struct tcpcb *, int, int, uint8_t, + int); + +/* + * Indicate whether this ack should be delayed. We can delay the ack if + * following conditions are met: + * - There is no delayed ack timer in progress. + * - Our last ack wasn't a 0-sized window. We never want to delay + * the ack that opens up a 0-sized window. + * - LRO wasn't used for this segment. We make sure by checking that the + * segment size is not larger than the MSS. + * - Delayed acks are enabled or this is a half-synchronized T/TCP + * connection. + */ +#define DELAY_ACK(tp, tlen) \ + ((!tcp_timer_active(tp, TT_DELACK) && \ + (tp->t_flags & TF_RXWIN0SENT) == 0) && \ + (tlen <= tp->t_maxopd) && \ + (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) + +/* + * So how is this faster than the normal fast ack? + * It basically allows us to also stay in the fastpath + * when a window-update ack also arrives. In testing + * we saw only 25-30% of connections doing fastpath + * due to the fact that along with moving forward + * in sequence the window was also updated. + */ +static void +tcp_do_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, + struct tcpcb *tp, struct tcpopt *to, int drop_hdrlen, int tlen, + int ti_locked, u_long tiwin) +{ + int acked; + int winup_only=0; +#ifdef TCPDEBUG + /* + * The size of tcp_saveipgen must be the size of the max ip header, + * now IPv6. + */ + u_char tcp_saveipgen[IP6_HDR_LEN]; + struct tcphdr tcp_savetcp; + short ostate = 0; +#endif + /* + * The following if statment will be true if + * we are doing the win_up_in_fp + * - We have more new data (SEQ_LT(tp->snd_wl1, th->th_seq)) + * - No more new data, but we have an ack for new data + * (tp->snd_wl1 == th->th_seq && SEQ_LT(tp->snd_wl2, th->th_ack)) + * - No more new data, the same ack point but the window grew + * (tp->snd_wl1 == th->th_seq && tp->snd_wl2 == th->th_ack && twin > tp->snd_wnd) + */ + if ((SEQ_LT(tp->snd_wl1, th->th_seq) || + (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) || + (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) { + /* keep track of pure window updates */ + if (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) { + winup_only = 1; + TCPSTAT_INC(tcps_rcvwinupd); + } + tp->snd_wnd = tiwin; + tp->snd_wl1 = th->th_seq; + tp->snd_wl2 = th->th_ack; + if (tp->snd_wnd > tp->max_sndwnd) + tp->max_sndwnd = tp->snd_wnd; + } + /* + * If last ACK falls within this segment's sequence numbers, + * record the timestamp. + * NOTE that the test is modified according to the latest + * proposal of the tcplw@cray.com list (Braden 1993/04/26). + */ + if ((to->to_flags & TOF_TS) != 0 && + SEQ_LEQ(th->th_seq, tp->last_ack_sent)) { + tp->ts_recent_age = tcp_ts_getticks(); + tp->ts_recent = to->to_tsval; + } + /* + * This is a pure ack for outstanding data. + */ + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); + } + ti_locked = TI_UNLOCKED; + + TCPSTAT_INC(tcps_predack); + + /* + * "bad retransmit" recovery. + */ + if (tp->t_rxtshift == 1 && + tp->t_flags & TF_PREVVALID && + (int)(ticks - tp->t_badrxtwin) < 0) { + cc_cong_signal(tp, th, CC_RTO_ERR); + } + + /* + * Recalculate the transmit timer / rtt. + * + * Some boxes send broken timestamp replies + * during the SYN+ACK phase, ignore + * timestamps of 0 or we could calculate a + * huge RTT and blow up the retransmit timer. + */ + if ((to->to_flags & TOF_TS) != 0 && + to->to_tsecr) { + u_int t; + + t = tcp_ts_getticks() - to->to_tsecr; + if (!tp->t_rttlow || tp->t_rttlow > t) + tp->t_rttlow = t; + tcp_xmit_timer(tp, + TCP_TS_TO_TICKS(t) + 1); + } else if (tp->t_rtttime && + SEQ_GT(th->th_ack, tp->t_rtseq)) { + if (!tp->t_rttlow || + tp->t_rttlow > ticks - tp->t_rtttime) + tp->t_rttlow = ticks - tp->t_rtttime; + tcp_xmit_timer(tp, + ticks - tp->t_rtttime); + } + if (winup_only == 0) { + acked = BYTES_THIS_ACK(tp, th); + + /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ + hhook_run_tcp_est_in(tp, th, to); + + TCPSTAT_ADD(tcps_rcvackbyte, acked); + sbdrop(&so->so_snd, acked); + if (SEQ_GT(tp->snd_una, tp->snd_recover) && + SEQ_LEQ(th->th_ack, tp->snd_recover)) + tp->snd_recover = th->th_ack - 1; + + /* + * Let the congestion control algorithm update + * congestion control related information. This + * typically means increasing the congestion + * window. + */ + cc_ack_received(tp, th, CC_ACK); + + tp->snd_una = th->th_ack; + /* + * Pull snd_wl2 up to prevent seq wrap relative + * to th_ack. + */ + tp->snd_wl2 = th->th_ack; + tp->t_dupacks = 0; + m_freem(m); + + /* + * If all outstanding data are acked, stop + * retransmit timer, otherwise restart timer + * using current (possibly backed-off) value. + * If process is waiting for space, + * wakeup/selwakeup/signal. If data + * are ready to send, let tcp_output + * decide between more output or persist. + */ +#ifdef TCPDEBUG + if (so->so_options & SO_DEBUG) + tcp_trace(TA_INPUT, ostate, tp, + (void *)tcp_saveipgen, + &tcp_savetcp, 0); +#endif + if (tp->snd_una == tp->snd_max) + tcp_timer_activate(tp, TT_REXMT, 0); + else if (!tcp_timer_active(tp, TT_PERSIST)) + tcp_timer_activate(tp, TT_REXMT, + tp->t_rxtcur); + } else { + /* + * Window update only, just free the mbufs and + * send out whatever we can. + */ + m_freem(m); + } + sowwakeup(so); + if (sbavail(&so->so_snd)) + (void) tcp_output(tp); + KASSERT(ti_locked == TI_UNLOCKED, ("%s: check_delack ti_locked %d", + __func__, ti_locked)); + INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); + INP_WLOCK_ASSERT(tp->t_inpcb); + + if (tp->t_flags & TF_DELACK) { + tp->t_flags &= ~TF_DELACK; + tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); + } + INP_WUNLOCK(tp->t_inpcb); +} + +/* + * Here nothing is really faster, its just that we + * have broken out the fast-data path also just like + * the fast-ack. + */ +static void +tcp_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, + struct tcpcb *tp, struct tcpopt *to, int drop_hdrlen, int tlen, + int ti_locked, u_long tiwin) +{ + int newsize = 0; /* automatic sockbuf scaling */ +#ifdef TCPDEBUG + /* + * The size of tcp_saveipgen must be the size of the max ip header, + * now IPv6. + */ + u_char tcp_saveipgen[IP6_HDR_LEN]; + struct tcphdr tcp_savetcp; + short ostate = 0; +#endif + /* + * If last ACK falls within this segment's sequence numbers, + * record the timestamp. + * NOTE that the test is modified according to the latest + * proposal of the tcplw@cray.com list (Braden 1993/04/26). + */ + if ((to->to_flags & TOF_TS) != 0 && + SEQ_LEQ(th->th_seq, tp->last_ack_sent)) { + tp->ts_recent_age = tcp_ts_getticks(); + tp->ts_recent = to->to_tsval; + } + + /* + * This is a pure, in-sequence data packet with + * nothing on the reassembly queue and we have enough + * buffer space to take it. + */ + if (ti_locked == TI_RLOCKED) { + INP_INFO_RUNLOCK(&V_tcbinfo); + } + ti_locked = TI_UNLOCKED; + + /* Clean receiver SACK report if present */ + if ((tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks) + tcp_clean_sackreport(tp); + TCPSTAT_INC(tcps_preddat); + tp->rcv_nxt += tlen; + /* + * Pull snd_wl1 up to prevent seq wrap relative to + * th_seq. + */ + tp->snd_wl1 = th->th_seq; + /* + * Pull rcv_up up to prevent seq wrap relative to + * rcv_nxt. + */ + tp->rcv_up = tp->rcv_nxt; + TCPSTAT_ADD(tcps_rcvbyte, tlen); +#ifdef TCPDEBUG + if (so->so_options & SO_DEBUG) + tcp_trace(TA_INPUT, ostate, tp, + (void *)tcp_saveipgen, &tcp_savetcp, 0); +#endif + /* + * Automatic sizing of receive socket buffer. Often the send + * buffer size is not optimally adjusted to the actual network + * conditions at hand (delay bandwidth product). Setting the + * buffer size too small limits throughput on links with high + * bandwidth and high delay (eg. trans-continental/oceanic links). + * + * On the receive side the socket buffer memory is only rarely + * used to any significant extent. This allows us to be much + * more aggressive in scaling the receive socket buffer. For + * the case that the buffer space is actually used to a large + * extent and we run out of kernel memory we can simply drop + * the new segments; TCP on the sender will just retransmit it + * later. Setting the buffer size too big may only consume too + * much kernel memory if the application doesn't read() from + * the socket or packet loss or reordering makes use of the + * reassembly queue. + * + * The criteria to step up the receive buffer one notch are: + * 1. Application has not set receive buffer size with + * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. + * 2. the number of bytes received during the time it takes + * one timestamp to be reflected back to us (the RTT); + * 3. received bytes per RTT is within seven eighth of the + * current socket buffer size; + * 4. receive buffer size has not hit maximal automatic size; + * + * This algorithm does one step per RTT at most and only if + * we receive a bulk stream w/o packet losses or reorderings. + * Shrinking the buffer during idle times is not necessary as + * it doesn't consume any memory when idle. + * + * TODO: Only step up if the application is actually serving + * the buffer to better manage the socket buffer resources. + */ + if (V_tcp_do_autorcvbuf && + (to->to_flags & TOF_TS) && + to->to_tsecr && + (so->so_rcv.sb_flags & SB_AUTOSIZE)) { + if (TSTMP_GT(to->to_tsecr, tp->rfbuf_ts) && + to->to_tsecr - tp->rfbuf_ts < hz) { + if (tp->rfbuf_cnt > + (so->so_rcv.sb_hiwat / 8 * 7) && + so->so_rcv.sb_hiwat < + V_tcp_autorcvbuf_max) { + newsize = + min(so->so_rcv.sb_hiwat + + V_tcp_autorcvbuf_inc, + V_tcp_autorcvbuf_max); + } + /* Start over with next RTT. */ + tp->rfbuf_ts = 0; + tp->rfbuf_cnt = 0; + } else + tp->rfbuf_cnt += tlen; /* add up */ + } + + /* Add data to socket buffer. */ + SOCKBUF_LOCK(&so->so_rcv); + if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { + m_freem(m); + } else { + /* + * Set new socket buffer size. + * Give up when limit is reached. + */ + if (newsize) + if (!sbreserve_locked(&so->so_rcv, + newsize, so, NULL)) + so->so_rcv.sb_flags &= ~SB_AUTOSIZE; + m_adj(m, drop_hdrlen); /* delayed header drop */ + sbappendstream_locked(&so->so_rcv, m, 0); + } + /* NB: sorwakeup_locked() does an implicit unlock. */ + sorwakeup_locked(so); + if (DELAY_ACK(tp, tlen)) { + tp->t_flags |= TF_DELACK; + } else { + tp->t_flags |= TF_ACKNOW; + tcp_output(tp); + } + KASSERT(ti_locked == TI_UNLOCKED, ("%s: check_delack ti_locked %d", + __func__, ti_locked)); + INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); + INP_WLOCK_ASSERT(tp->t_inpcb); + + if (tp->t_flags & TF_DELACK) { + tp->t_flags &= ~TF_DELACK; + tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); + } + INP_WUNLOCK(tp->t_inpcb); +} + +/* + * The slow-path is the clone of the long long part + * of tcp_do_segment past all the fast-path stuff. We + * use it here by two different callers, the fast/slow and + * the fastack only. + */ +static void +tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, struct socket *so, + struct tcpcb *tp, struct tcpopt *to, int drop_hdrlen, int tlen, + int ti_locked, u_long tiwin, int thflags) +{ + int acked, ourfinisacked, needoutput = 0; + int rstreason, todrop, win; + char *s; + struct in_conninfo *inc; + struct mbuf *mfree = NULL; +#ifdef TCPDEBUG + /* + * The size of tcp_saveipgen must be the size of the max ip header, + * now IPv6. + */ + u_char tcp_saveipgen[IP6_HDR_LEN]; + struct tcphdr tcp_savetcp; + short ostate = 0; +#endif + /* + * Calculate amount of space in receive window, + * and then do TCP input processing. + * Receive window is amount of space in rcv queue, + * but not less than advertised window. + */ + inc = &tp->t_inpcb->inp_inc; + win = sbspace(&so->so_rcv); + if (win < 0) + win = 0; + tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); + + /* Reset receive buffer auto scaling when not in bulk receive mode. */ + tp->rfbuf_ts = 0; + tp->rfbuf_cnt = 0; + + switch (tp->t_state) { + + /* + * If the state is SYN_RECEIVED: + * if seg contains an ACK, but not for our SYN/ACK, send a RST. + */ + case TCPS_SYN_RECEIVED: + if ((thflags & TH_ACK) && + (SEQ_LEQ(th->th_ack, tp->snd_una) || + SEQ_GT(th->th_ack, tp->snd_max))) { + rstreason = BANDLIM_RST_OPENPORT; + goto dropwithreset; + } + break; + + /* + * If the state is SYN_SENT: + * if seg contains an ACK, but not for our SYN, drop the input. + * if seg contains a RST, then drop the connection. + * if seg does not contain SYN, then drop it. + * Otherwise this is an acceptable SYN segment + * initialize tp->rcv_nxt and tp->irs + * if seg contains ack then advance tp->snd_una + * if seg contains an ECE and ECN support is enabled, the stream + * is ECN capable. + * if SYN has been acked change to ESTABLISHED else SYN_RCVD state + * arrange for segment to be acked (eventually) + * continue processing rest of data/controls, beginning with URG + */ + case TCPS_SYN_SENT: + if ((thflags & TH_ACK) && + (SEQ_LEQ(th->th_ack, tp->iss) || + SEQ_GT(th->th_ack, tp->snd_max))) { + rstreason = BANDLIM_UNLIMITED; + goto dropwithreset; + } + if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) { + TCP_PROBE5(connect__refused, NULL, tp, + mtod(m, const char *), tp, th); + tp = tcp_drop(tp, ECONNREFUSED); + } + if (thflags & TH_RST) + goto drop; + if (!(thflags & TH_SYN)) + goto drop; + + tp->irs = th->th_seq; + tcp_rcvseqinit(tp); + if (thflags & TH_ACK) { + TCPSTAT_INC(tcps_connects); + soisconnected(so); +#ifdef MAC + mac_socketpeer_set_from_mbuf(m, so); +#endif + /* Do window scaling on this connection? */ + if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == + (TF_RCVD_SCALE|TF_REQ_SCALE)) { + tp->rcv_scale = tp->request_r_scale; + } + tp->rcv_adv += imin(tp->rcv_wnd, + TCP_MAXWIN << tp->rcv_scale); + tp->snd_una++; /* SYN is acked */ + /* + * If there's data, delay ACK; if there's also a FIN + * ACKNOW will be turned on later. + */ + if (DELAY_ACK(tp, tlen) && tlen != 0) + tcp_timer_activate(tp, TT_DELACK, + tcp_delacktime); + else + tp->t_flags |= TF_ACKNOW; + + if ((thflags & TH_ECE) && V_tcp_do_ecn) { + tp->t_flags |= TF_ECN_PERMIT; + TCPSTAT_INC(tcps_ecn_shs); + } + + /* + * Received in SYN_SENT[*] state. + * Transitions: + * SYN_SENT --> ESTABLISHED + * SYN_SENT* --> FIN_WAIT_1 + */ + tp->t_starttime = ticks; + if (tp->t_flags & TF_NEEDFIN) { + tcp_state_change(tp, TCPS_FIN_WAIT_1); + tp->t_flags &= ~TF_NEEDFIN; + thflags &= ~TH_SYN; + } else { + tcp_state_change(tp, TCPS_ESTABLISHED); + TCP_PROBE5(connect__established, NULL, tp, + mtod(m, const char *), tp, th); + cc_conn_init(tp); + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); + } + } else { + /* + * Received initial SYN in SYN-SENT[*] state => + * simultaneous open. + * If it succeeds, connection is * half-synchronized. + * Otherwise, do 3-way handshake: + * SYN-SENT -> SYN-RECEIVED + * SYN-SENT* -> SYN-RECEIVED* + */ + tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN); + tcp_timer_activate(tp, TT_REXMT, 0); + tcp_state_change(tp, TCPS_SYN_RECEIVED); + } + + KASSERT(ti_locked == TI_RLOCKED, ("%s: trimthenstep6: " + "ti_locked %d", __func__, ti_locked)); + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + INP_WLOCK_ASSERT(tp->t_inpcb); + + /* + * Advance th->th_seq to correspond to first data byte. + * If data, trim to stay within window, + * dropping FIN if necessary. + */ + th->th_seq++; + if (tlen > tp->rcv_wnd) { + todrop = tlen - tp->rcv_wnd; + m_adj(m, -todrop); + tlen = tp->rcv_wnd; + thflags &= ~TH_FIN; + TCPSTAT_INC(tcps_rcvpackafterwin); + TCPSTAT_ADD(tcps_rcvbyteafterwin, todrop); + } + tp->snd_wl1 = th->th_seq - 1; + tp->rcv_up = th->th_seq; + /* + * Client side of transaction: already sent SYN and data. + * If the remote host used T/TCP to validate the SYN, + * our data will be ACK'd; if so, enter normal data segment + * processing in the middle of step 5, ack processing. + * Otherwise, goto step 6. + */ + if (thflags & TH_ACK) + goto process_ACK; + + goto step6; + + /* + * If the state is LAST_ACK or CLOSING or TIME_WAIT: + * do normal processing. + * + * NB: Leftover from RFC1644 T/TCP. Cases to be reused later. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 01:05:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7FEA48CBE; Wed, 16 Dec 2015 01:05:51 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C04BA14E7; Wed, 16 Dec 2015 01:05:51 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG15oSV071158; Wed, 16 Dec 2015 01:05:50 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG15oka071157; Wed, 16 Dec 2015 01:05:50 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201512160105.tBG15oka071157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 16 Dec 2015 01:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292310 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 01:05:52 -0000 Author: pjd Date: Wed Dec 16 01:05:50 2015 New Revision: 292310 URL: https://svnweb.freebsd.org/changeset/base/292310 Log: Keep maintainance of GELI and make it clear which directories I'm interested in. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Dec 16 00:56:45 2015 (r292309) +++ head/MAINTAINERS Wed Dec 16 01:05:50 2015 (r292310) @@ -42,6 +42,7 @@ dev/usb/wlan adrian Pre-commit review re etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. etc/sendmail gshapiro Pre-commit review requested. Keep in sync with -STABLE. fetch des Pre-commit review requested. +geli pjd Pre-commit review requested (both sys/geom/eli/ and sbin/geom/class/eli/). isci(4) jimharris Pre-commit review requested. iwm(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org iwn(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org @@ -125,7 +126,6 @@ file obrien Insists to keep file blocke contrib/bzip2 obrien Pre-commit review required. geom freebsd-geom@FreeBSD.org geom_concat pjd Pre-commit review preferred. -geom_eli pjd Pre-commit review preferred. geom_gate pjd Pre-commit review preferred. geom_label pjd Pre-commit review preferred. geom_mirror pjd Pre-commit review preferred. From owner-svn-src-all@freebsd.org Wed Dec 16 02:43:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C0CDA498E0; Wed, 16 Dec 2015 02:43:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D1F18A3; Wed, 16 Dec 2015 02:43:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG2hZ5G011934; Wed, 16 Dec 2015 02:43:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG2hZ79011933; Wed, 16 Dec 2015 02:43:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160243.tBG2hZ79011933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 02:43: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: r292311 - stable/10/sbin/swapon 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 02:43:36 -0000 Author: ngie Date: Wed Dec 16 02:43:34 2015 New Revision: 292311 URL: https://svnweb.freebsd.org/changeset/base/292311 Log: MFC r292005: Call va_end on ap when vsnprintf fails in run_cmd(..) to clean up the variable state Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sbin/swapon/swapon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/swapon/swapon.c ============================================================================== --- stable/10/sbin/swapon/swapon.c Wed Dec 16 01:05:50 2015 (r292310) +++ stable/10/sbin/swapon/swapon.c Wed Dec 16 02:43:34 2015 (r292311) @@ -640,6 +640,7 @@ run_cmd(int *ofd, const char *cmdline, . rv = vasprintf(&cmd, cmdline, ap); if (rv == -1) { warn("%s", __func__); + va_end(ap); return (rv); } va_end(ap); From owner-svn-src-all@freebsd.org Wed Dec 16 03:59:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4436A4829E; Wed, 16 Dec 2015 03:59:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3FD1EE9; Wed, 16 Dec 2015 03:59:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG3xsuH042090; Wed, 16 Dec 2015 03:59:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG3xsvl042089; Wed, 16 Dec 2015 03:59:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512160359.tBG3xsvl042089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 03:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292312 - head/contrib/llvm/tools/lldb/docs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 03:59:55 -0000 Author: emaste Date: Wed Dec 16 03:59:54 2015 New Revision: 292312 URL: https://svnweb.freebsd.org/changeset/base/292312 Log: lldb(1): Document core file option -c / -core Modified: head/contrib/llvm/tools/lldb/docs/lldb.1 Modified: head/contrib/llvm/tools/lldb/docs/lldb.1 ============================================================================== --- head/contrib/llvm/tools/lldb/docs/lldb.1 Wed Dec 16 02:43:34 2015 (r292311) +++ head/contrib/llvm/tools/lldb/docs/lldb.1 Wed Dec 16 03:59:54 2015 (r292312) @@ -1,4 +1,4 @@ -.Dd June 7, 2012 \" DATE +.Dd December 16, 2015 \" DATE .Dt LLDB 1 \" Program name and manual section number .Os .Sh NAME \" Section Header - required - don't modify @@ -8,6 +8,7 @@ .Nm lldb .Op Fl hvdexw .Op Fl a Ar arch +.Op Fl c Ar core-file .Op Fl l Ar script-language .Op Fl s Ar lldb-commands .Op Fl n Ar process-name @@ -52,6 +53,8 @@ to it as early in the process-launch as Specifies a currently running process that .Nm should attach to. +.It Fl c, -core Ar core-file +Specifies the core file to examine. .It Fl l, -script-language Ar language Tells the debugger to use the specified scripting language for user-defined scripts, rather than the default. Valid scripting From owner-svn-src-all@freebsd.org Wed Dec 16 04:32:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEAD9A494E6; Wed, 16 Dec 2015 04:32:34 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BFB21CF0; Wed, 16 Dec 2015 04:32:34 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG4WXZb057264; Wed, 16 Dec 2015 04:32:33 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG4WXNK057263; Wed, 16 Dec 2015 04:32:33 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201512160432.tBG4WXNK057263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 16 Dec 2015 04:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292313 - head/etc/periodic/daily X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 04:32:34 -0000 Author: lidl Date: Wed Dec 16 04:32:33 2015 New Revision: 292313 URL: https://svnweb.freebsd.org/changeset/base/292313 Log: Skip unavailable pools when running zfs pool scrubs Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D4588 Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Wed Dec 16 03:59:54 2015 (r292312) +++ head/etc/periodic/daily/800.scrub-zfs Wed Dec 16 04:32:33 2015 (r292313) @@ -43,6 +43,10 @@ case "$daily_scrub_zfs_enable" in rc=3 echo "Skipping faulted pool: ${pool}" continue ;; + *UNAVAIL*) + rc=4 + echo "Skipping unavailable pool: ${pool}" + continue ;; esac # determine how many days shall be between scrubs From owner-svn-src-all@freebsd.org Wed Dec 16 04:37:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD13A497F1; Wed, 16 Dec 2015 04:37:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C98431F17; Wed, 16 Dec 2015 04:37:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG4bmmI058144; Wed, 16 Dec 2015 04:37:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG4bkVl058114; Wed, 16 Dec 2015 04:37:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512160437.tBG4bkVl058114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 16 Dec 2015 04:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292314 - in vendor/bind9/dist: . doc/arm lib/dns lib/dns/include/dns lib/lwres/man 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 04:37:50 -0000 Author: delphij Date: Wed Dec 16 04:37:46 2015 New Revision: 292314 URL: https://svnweb.freebsd.org/changeset/base/292314 Log: Vendor import of BIND 9.9.8-P2. Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/README vendor/bind9/dist/configure.in vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html vendor/bind9/dist/doc/arm/Bv9ARM.ch11.html vendor/bind9/dist/doc/arm/Bv9ARM.ch12.html vendor/bind9/dist/doc/arm/Bv9ARM.ch13.html vendor/bind9/dist/doc/arm/Bv9ARM.html vendor/bind9/dist/doc/arm/Bv9ARM.pdf vendor/bind9/dist/doc/arm/man.arpaname.html vendor/bind9/dist/doc/arm/man.ddns-confgen.html vendor/bind9/dist/doc/arm/man.dig.html vendor/bind9/dist/doc/arm/man.dnssec-checkds.html vendor/bind9/dist/doc/arm/man.dnssec-coverage.html vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html vendor/bind9/dist/doc/arm/man.dnssec-keygen.html vendor/bind9/dist/doc/arm/man.dnssec-revoke.html vendor/bind9/dist/doc/arm/man.dnssec-settime.html vendor/bind9/dist/doc/arm/man.dnssec-signzone.html vendor/bind9/dist/doc/arm/man.dnssec-verify.html vendor/bind9/dist/doc/arm/man.genrandom.html vendor/bind9/dist/doc/arm/man.host.html vendor/bind9/dist/doc/arm/man.isc-hmac-fixup.html vendor/bind9/dist/doc/arm/man.named-checkconf.html vendor/bind9/dist/doc/arm/man.named-checkzone.html vendor/bind9/dist/doc/arm/man.named-journalprint.html vendor/bind9/dist/doc/arm/man.named.html vendor/bind9/dist/doc/arm/man.nsec3hash.html vendor/bind9/dist/doc/arm/man.nsupdate.html vendor/bind9/dist/doc/arm/man.rndc-confgen.html vendor/bind9/dist/doc/arm/man.rndc.conf.html vendor/bind9/dist/doc/arm/man.rndc.html vendor/bind9/dist/doc/arm/notes.html vendor/bind9/dist/doc/arm/notes.pdf vendor/bind9/dist/doc/arm/notes.xml vendor/bind9/dist/lib/dns/api vendor/bind9/dist/lib/dns/include/dns/message.h vendor/bind9/dist/lib/dns/message.c vendor/bind9/dist/lib/dns/opensslrsa_link.c vendor/bind9/dist/lib/dns/resolver.c vendor/bind9/dist/lib/dns/rootns.c vendor/bind9/dist/lib/dns/xfrin.c vendor/bind9/dist/lib/lwres/man/lwres.html vendor/bind9/dist/lib/lwres/man/lwres_buffer.html vendor/bind9/dist/lib/lwres/man/lwres_config.html vendor/bind9/dist/lib/lwres/man/lwres_context.html vendor/bind9/dist/lib/lwres/man/lwres_gabn.html vendor/bind9/dist/lib/lwres/man/lwres_gai_strerror.html vendor/bind9/dist/lib/lwres/man/lwres_getaddrinfo.html vendor/bind9/dist/lib/lwres/man/lwres_gethostent.html vendor/bind9/dist/lib/lwres/man/lwres_getipnode.html vendor/bind9/dist/lib/lwres/man/lwres_getnameinfo.html vendor/bind9/dist/lib/lwres/man/lwres_getrrsetbyname.html vendor/bind9/dist/lib/lwres/man/lwres_gnba.html vendor/bind9/dist/lib/lwres/man/lwres_hstrerror.html vendor/bind9/dist/lib/lwres/man/lwres_inetntop.html vendor/bind9/dist/lib/lwres/man/lwres_noop.html vendor/bind9/dist/lib/lwres/man/lwres_packet.html vendor/bind9/dist/lib/lwres/man/lwres_resutil.html vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/CHANGES Wed Dec 16 04:37:46 2015 (r292314) @@ -1,3 +1,21 @@ + --- 9.9.8-P2 released --- + +4270. [security] Update allowed OpenSSL versions as named is + potentially vulnerable to CVE-2015-3193. + +4261. [maint] H.ROOT-SERVERS.NET is 198.97.190.53 and 2001:500:1::53. + [RT #40556] + +4260. [security] Insufficient testing when parsing a message allowed + records with an incorrect class to be be accepted, + triggering a REQUIRE failure when those records + were subsequently cached. (CVE-2015-8000) [RT #40987] + +4253. [security] Address fetch context reference count handling error + on socket error. (CVE-2015-8461) [RT#40945] + + --- 9.9.8-P1 (withdrawn) --- + --- 9.9.8 released --- --- 9.9.8rc1 released --- Modified: vendor/bind9/dist/README ============================================================================== --- vendor/bind9/dist/README Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/README Wed Dec 16 04:37:46 2015 (r292314) @@ -51,6 +51,17 @@ BIND 9 For up-to-date release notes and errata, see http://www.isc.org/software/bind9/releasenotes +BIND 9.9.8-P2 + + BIND 9.9.8-P2 is a security release addressing the flaws + described in CVE-2015-3193 (OpenSSL), CVE-2015-8000 and + CVE-2015-8461. + +BIND 9.9.8-P1 + + BIND 9.9.8-P1 was incomplete and was withdrawn prior to + publication. + BIND 9.9.8 BIND 9.9.8 is a maintenance release and addresses bugs Modified: vendor/bind9/dist/configure.in ============================================================================== --- vendor/bind9/dist/configure.in Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/configure.in Wed Dec 16 04:37:46 2015 (r292314) @@ -810,12 +810,17 @@ yes|'') int main() { if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL && OPENSSL_VERSION_NUMBER < 0x00908000L) || - OPENSSL_VERSION_NUMBER >= 0x0090804fL) + (OPENSSL_VERSION_NUMBER >= 0x0090804fL && + OPENSSL_VERSION_NUMBER < 0x10002000L) || + OPENSSL_VERSION_NUMBER >= 0x1000205fL) return (0); printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n", OPENSSL_VERSION_NUMBER); printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n" - "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n"); + "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n" + "Require OPENSSL_VERSION_NUMBER 0x1000000f or greater (1.0.0)\n" + "Require OPENSSL_VERSION_NUMBER 0x1000100f or greater (1.0.1)\n" + "Require OPENSSL_VERSION_NUMBER 0x1000205f or greater (1.0.2e)\n\n"); return (1); } ], @@ -4282,15 +4287,16 @@ WARNING Your OpenSSL crypto libr WARNING one or more of the the following known security WARNING WARNING flaws: WARNING WARNING WARNING -WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING -WARNING CVE-2006-2940. WARNING +WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937, WARNING +WARNING CVE-2006-2940 and CVE-2015-3193. WARNING WARNING WARNING WARNING It is recommended that you upgrade to OpenSSL WARNING -WARNING version 0.9.8d/0.9.7l (or greater). WARNING +WARNING version 1.0.2e/1.0.1/1.0.0/0.9.9/0.9.8d/0.9.7l WARNING +WARNING (or greater). WARNING WARNING WARNING WARNING You can disable this warning by specifying: WARNING WARNING WARNING -WARNING --disable-openssl-version-check WARNING +WARNING --disable-openssl-version-check WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch01.html Wed Dec 16 04:37:46 2015 (r292314) @@ -556,6 +556,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch02.html Wed Dec 16 04:37:46 2015 (r292314) @@ -154,6 +154,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch03.html Wed Dec 16 04:37:46 2015 (r292314) @@ -665,6 +665,6 @@ controls { -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch04.html Wed Dec 16 04:37:46 2015 (r292314) @@ -1935,6 +1935,6 @@ $ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2. -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch05.html Wed Dec 16 04:37:46 2015 (r292314) @@ -139,6 +139,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch06.html Wed Dec 16 04:37:46 2015 (r292314) @@ -12177,6 +12177,6 @@ HOST-127.EXAMPLE. MX 0 . -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch07.html Wed Dec 16 04:37:46 2015 (r292314) @@ -247,6 +247,6 @@ zone "example.com" { -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch08.html Wed Dec 16 04:37:46 2015 (r292314) @@ -135,6 +135,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch09.html Wed Dec 16 04:37:46 2015 (r292314) @@ -45,7 +45,7 @@

-Release Notes for BIND Version 9.9.8

+Release Notes for BIND Version 9.9.8-P2

Introduction

- This document summarizes changes since the last production release - of BIND on the corresponding major release branch. + This document summarizes changes since BIND 9.9.8: +

+

+ BIND 9.9.8-P2 addresses security issues described in CVE-2015-3193 + (OpenSSL), CVE-2015-8000 and CVE-2015-8461. +

+

+ BIND 9.9.8-P1 was incomplete and was withdrawn prior to publication.

@@ -85,161 +91,39 @@ Security Fixes
  • - An incorrect boundary check in the OPENPGPKEY rdatatype - could trigger an assertion failure. This flaw is disclosed - in CVE-2015-5986. [RT #40286] + Named is potentially vulnerable to the OpenSSL vulnerabilty + described in CVE-2015-3193.

  • -
  • -

    - A buffer accounting error could trigger an assertion failure - when parsing certain malformed DNSSEC keys. -

    -

    - This flaw was discovered by Hanno B쎶ck of the Fuzzing - Project, and is disclosed in CVE-2015-5722. [RT #40212] -

    -
  • -
  • -

    - A specially crafted query could trigger an assertion failure - in message.c. -

    -

    - This flaw was discovered by Jonathan Foote, and is disclosed - in CVE-2015-5477. [RT #40046] -

    -
  • -
  • -

    - On servers configured to perform DNSSEC validation, an - assertion failure could be triggered on answers from - a specially configured server. -

    -

    - This flaw was discovered by Breno Silveira Soares, and is - disclosed in CVE-2015-4620. [RT #39795] -

    -
  • -
- -
-

-New Features

-
    -
  • -

    - New quotas have been added to limit the queries that are - sent by recursive resolvers to authoritative servers - experiencing denial-of-service attacks. When configured, - these options can both reduce the harm done to authoritative - servers and also avoid the resource exhaustion that can be - experienced by recursives when they are being used as a - vehicle for such an attack. -

    -

    - NOTE: These options are not available by default; use - configure --enable-fetchlimit to include - them in the build. -

    -
    • - fetches-per-server limits the number of - simultaneous queries that can be sent to any single - authoritative server. The configured value is a starting - point; it is automatically adjusted downward if the server is - partially or completely non-responsive. The algorithm used to - adjust the quota can be configured via the - fetch-quota-params option. -

    • -
    • - fetches-per-zone limits the number of - simultaneous queries that can be sent for names within a - single domain. (Note: Unlike "fetches-per-server", this - value is not self-tuning.) -

    • -
    -

    - Statistics counters have also been added to track the number - of queries affected by these quotas. -

    -
  • -
  • - An --enable-querytrace configure switch is - now available to enable very verbose query tracelogging. This - option can only be set at compile time. This option has a - negative performance impact and should be used only for - debugging. + Incorrect reference counting could result in an INSIST + failure if a socket error occurred while performing a + lookup. This flaw is disclosed in CVE-2015-8461. [RT#40945]

  • - EDNS COOKIE options content is now displayed as - "COOKIE: <hexvalue>". + Insufficient testing when parsing a message allowed + records with an incorrect class to be be accepted, + triggering a REQUIRE failure when those records + were subsequently cached. This flaw is disclosed + in CVE-2015-8000. [RT #40987]

+New Features

+
  • None

+
+
+

Feature Changes

-
    -
  • - Large inline-signing changes should be less disruptive. - Signature generation is now done incrementally; the number - of signatures to be generated in each quantum is controlled - by "sig-signing-signatures number;". - [RT #37927] -

  • -
  • - Retrieving the local port range from net.ipv4.ip_local_port_range - on Linux is now supported. -

  • -
  • - Active Directory names of the form gc._msdcs.<forest> are - now accepted as valid hostnames when using the - check-names option. <forest> is still - restricted to letters, digits and hyphens. -

  • -
  • - Names containing rich text are now accepted as valid - hostnames in PTR records in DNS-SD reverse lookup zones, - as specified in RFC 6763. [RT #37889] -

  • -
+
  • + Updated the compiled in addresses for H.ROOT-SERVERS.NET. +

Bug Fixes

-
    -
  • - Asynchronous zone loads were not handled correctly when the - zone load was already in progress; this could trigger a crash - in zt.c. [RT #37573] -

  • -
  • - A race during shutdown or reconfiguration could - cause an assertion failure in mem.c. [RT #38979] -

  • -
  • - Some answer formatting options didn't work correctly with - dig +short. [RT #39291] -

  • -
  • - Malformed records of some types, including NSAP and UNSPEC, - could trigger assertion failures when loading text zone files. - [RT #40274] [RT #40285] -

  • -
  • - Fixed a possible crash in ratelimiter.c caused by NOTIFY - messages being removed from the wrong rate limiter queue. - [RT #40350] -

  • -
  • - The default rrset-order of random - was inconsistently applied. [RT #40456] -

  • -
  • - BADVERS responses from broken authoritative name servers were - not handled correctly. [RT #40427] -

  • -
+
  • None

@@ -279,6 +163,6 @@

-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch10.html Wed Dec 16 04:37:46 2015 (r292314) @@ -163,6 +163,6 @@
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch11.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch11.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch11.html Wed Dec 16 04:37:46 2015 (r292314) @@ -514,6 +514,6 @@
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch12.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch12.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch12.html Wed Dec 16 04:37:46 2015 (r292314) @@ -47,13 +47,13 @@
BIND 9 DNS Library Support
-
Prerequisite
-
Compilation
-
Installation
-
Known Defects/Restrictions
-
The dns.conf File
-
Sample Applications
-
Library References
+
Prerequisite
+
Compilation
+
Installation
+
Known Defects/Restrictions
+
The dns.conf File
+
Sample Applications
+
Library References
@@ -89,7 +89,7 @@

-Prerequisite

+Prerequisite

GNU make is required to build the export libraries (other part of BIND 9 can still be built with other types of make). In the reminder of this document, "make" means GNU make. Note that @@ -98,7 +98,7 @@

-Compilation

+Compilation
 $ ./configure --enable-exportlib [other flags]
 $ make
@@ -113,7 +113,7 @@ $ make
 

-Installation

+Installation
 $ cd lib/export
 $ make install
@@ -135,7 +135,7 @@ $ make i
 
 

-Known Defects/Restrictions

+Known Defects/Restrictions
  • Currently, win32 is not supported for the export library. (Normal BIND 9 application can be built as @@ -175,7 +175,7 @@ $ make

    -The dns.conf File

    +The dns.conf File

The IRS library supports an "advanced" configuration file related to the DNS library for configuration parameters that would be beyond the capability of the @@ -193,14 +193,14 @@ $ make

-Sample Applications

+Sample Applications

Some sample application programs using this API are provided for reference. The following is a brief description of these applications.

-sample: a simple stub resolver utility

+sample: a simple stub resolver utility

It sends a query of a given name (of a given optional RR type) to a specified recursive server, and prints the result as a list of @@ -264,7 +264,7 @@ $ make

-sample-async: a simple stub resolver, working asynchronously

+sample-async: a simple stub resolver, working asynchronously

Similar to "sample", but accepts a list of (query) domain names as a separate file and resolves the names @@ -305,7 +305,7 @@ $ make

-sample-request: a simple DNS transaction client

+sample-request: a simple DNS transaction client

It sends a query to a specified server, and prints the response with minimal processing. It doesn't act as a @@ -346,7 +346,7 @@ $ make

-sample-gai: getaddrinfo() and getnameinfo() test code

+sample-gai: getaddrinfo() and getnameinfo() test code

This is a test program to check getaddrinfo() and getnameinfo() behavior. It takes a @@ -363,7 +363,7 @@ $ make

-sample-update: a simple dynamic update client program

+sample-update: a simple dynamic update client program

It accepts a single update command as a command-line argument, sends an update request message to the @@ -458,7 +458,7 @@ $ sample

-nsprobe: domain/name server checker in terms of RFC 4074

+nsprobe: domain/name server checker in terms of RFC 4074

It checks a set of domains to see the name servers of the domains behave @@ -515,7 +515,7 @@ $ sample

-Library References

+Library References

As of this writing, there is no formal "manual" of the libraries, except this document, header files (some of them provide pretty detailed explanations), and sample application @@ -540,6 +540,6 @@ $ sample -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.ch13.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.ch13.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.ch13.html Wed Dec 16 04:37:46 2015 (r292314) @@ -140,6 +140,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.html ============================================================================== --- vendor/bind9/dist/doc/arm/Bv9ARM.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/Bv9ARM.html Wed Dec 16 04:37:46 2015 (r292314) @@ -41,7 +41,7 @@

BIND 9 Administrator Reference Manual

-

BIND Version 9.9.8

+

BIND Version 9.9.8-P2

@@ -234,7 +234,7 @@
A. Release Notes
-
Release Notes for BIND Version 9.9.8
+
Release Notes for BIND Version 9.9.8-P2
Introduction
Download
@@ -262,13 +262,13 @@
BIND 9 DNS Library Support
-
Prerequisite
-
Compilation
-
Installation
-
Known Defects/Restrictions
-
The dns.conf File
-
Sample Applications
-
Library References
+
Prerequisite
+
Compilation
+
Installation
+
Known Defects/Restrictions
+
The dns.conf File
+
Sample Applications
+
Library References
I. Manual pages
@@ -365,6 +365,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bind9/dist/doc/arm/man.arpaname.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.arpaname.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.arpaname.html Wed Dec 16 04:37:46 2015 (r292314) @@ -50,20 +50,20 @@

arpaname {ipaddress ...}

-

DESCRIPTION

+

DESCRIPTION

arpaname translates IP addresses (IPv4 and IPv6) to the corresponding IN-ADDR.ARPA or IP6.ARPA names.

-

SEE ALSO

+

SEE ALSO

BIND 9 Administrator Reference Manual.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -87,6 +87,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/man.ddns-confgen.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.ddns-confgen.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.ddns-confgen.html Wed Dec 16 04:37:46 2015 (r292314) @@ -50,7 +50,7 @@

ddns-confgen [-a algorithm] [-h] [-k keyname] [-r randomfile] [ -s name | -z zone ] [-q] [name]

-

DESCRIPTION

+

DESCRIPTION

ddns-confgen generates a key for use by nsupdate and named. It simplifies configuration @@ -77,7 +77,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm

@@ -144,7 +144,7 @@

-

SEE ALSO

+

SEE ALSO

nsupdate(1), named.conf(5), named(8), @@ -152,7 +152,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -176,6 +176,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/man.dig.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.dig.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.dig.html Wed Dec 16 04:37:46 2015 (r292314) @@ -52,7 +52,7 @@

dig [global-queryopt...] [query...]

-

DESCRIPTION

+

DESCRIPTION

dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and @@ -99,7 +99,7 @@

-

SIMPLE USAGE

+

SIMPLE USAGE

A typical invocation of dig looks like:

@@ -152,7 +152,7 @@

-

OPTIONS

+

OPTIONS

-4

@@ -280,7 +280,7 @@

-

QUERY OPTIONS

+

QUERY OPTIONS

dig provides a number of query options which affect the way in which lookups are made and the results displayed. Some of @@ -649,7 +649,7 @@

-

MULTIPLE QUERIES

+

MULTIPLE QUERIES

The BIND 9 implementation of dig supports @@ -695,7 +695,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

IDN SUPPORT

+

IDN SUPPORT

If dig has been built with IDN (internationalized domain name) support, it can accept and display non-ASCII domain names. @@ -709,14 +709,14 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

FILES

+

FILES

/etc/resolv.conf

${HOME}/.digrc

-

SEE ALSO

+

SEE ALSO

host(1), named(8), dnssec-keygen(8), @@ -724,7 +724,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

BUGS

+

BUGS

There are probably too many query options.

@@ -747,6 +747,6 @@ dig +qr www.isc.org any -x 127.0.0.1 isc
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/man.dnssec-checkds.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.dnssec-checkds.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.dnssec-checkds.html Wed Dec 16 04:37:46 2015 (r292314) @@ -51,7 +51,7 @@

dnssec-dsfromkey [-l domain] [-f file] [-d dig path] [-D dsfromkey path] {zone}

-

DESCRIPTION

+

DESCRIPTION

dnssec-checkds verifies the correctness of Delegation Signer (DS) or DNSSEC Lookaside Validation (DLV) resource records for keys in a specified @@ -59,7 +59,7 @@

-

OPTIONS

+

OPTIONS

-f file

@@ -88,14 +88,14 @@

-

SEE ALSO

+

SEE ALSO

dnssec-dsfromkey(8), dnssec-keygen(8), dnssec-signzone(8),

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -118,6 +118,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/man.dnssec-coverage.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.dnssec-coverage.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.dnssec-coverage.html Wed Dec 16 04:37:46 2015 (r292314) @@ -50,7 +50,7 @@

dnssec-coverage [-K directory] [-f file] [-d DNSKEY TTL] [-m max TTL] [-r interval] [-c compilezone path] [zone]

-

DESCRIPTION

+

DESCRIPTION

dnssec-coverage verifies that the DNSSEC keys for a given zone or a set of zones have timing metadata set properly to ensure no future lapses in DNSSEC @@ -78,7 +78,7 @@

-

OPTIONS

+

OPTIONS

-f file

@@ -168,7 +168,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-checkds(8), dnssec-dsfromkey(8), @@ -177,7 +177,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -201,6 +201,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.dnssec-dsfromkey.html Wed Dec 16 04:37:46 2015 (r292314) @@ -52,14 +52,14 @@

dnssec-dsfromkey [-h] [-V]

-

DESCRIPTION

+

DESCRIPTION

dnssec-dsfromkey outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).

-

OPTIONS

+

OPTIONS

-1

@@ -150,7 +150,7 @@

-

EXAMPLE

+

EXAMPLE

To build the SHA-256 DS RR from the Kexample.com.+003+26160 @@ -165,7 +165,7 @@

-

FILES

+

FILES

The keyfile can be designed by the key identification Knnnn.+aaa+iiiii or the full file name @@ -179,13 +179,13 @@

-

CAVEAT

+

CAVEAT

A keyfile error can give a "file not found" even if the file exists.

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -195,7 +195,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -219,6 +219,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html ============================================================================== --- vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html Wed Dec 16 04:32:33 2015 (r292313) +++ vendor/bind9/dist/doc/arm/man.dnssec-keyfromlabel.html Wed Dec 16 04:37:46 2015 (r292314) @@ -50,7 +50,7 @@

dnssec-keyfromlabel {-l label} [-3] [-a algorithm] [-A date/offset] [-c class] [-D date/offset] [-E engine] [-f flag] [-G] [-I date/offset] [-i interval] [-k] [-K directory] [-L ttl] [-n nametype] [-P date/offset] [-p protocol] [-R date/offset] [-S key] [-t type] [-v level] [-V] [-y] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keyfromlabel generates a key pair of files that referencing a key object stored in a cryptographic hardware service module (HSM). The private key @@ -66,7 +66,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -209,7 +209,7 @@
-

TIMING OPTIONS

+

TIMING OPTIONS

Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the argument begins with a '+' or '-', it is interpreted as @@ -281,7 +281,7 @@

-

GENERATED KEY FILES

+

GENERATED KEY FILES

When dnssec-keyfromlabel completes successfully, @@ -320,7 +320,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -328,7 +328,7 @@

-

AUTHOR

+

AUTHOR

*** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 04:39:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D800A498D9; Wed, 16 Dec 2015 04:39:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30B410C8; Wed, 16 Dec 2015 04:38:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG4cweN058359; Wed, 16 Dec 2015 04:38:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG4cwqL058358; Wed, 16 Dec 2015 04:38:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512160438.tBG4cwqL058358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 16 Dec 2015 04:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292315 - vendor/bind9/9.9.8-P2 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 04:39:00 -0000 Author: delphij Date: Wed Dec 16 04:38:58 2015 New Revision: 292315 URL: https://svnweb.freebsd.org/changeset/base/292315 Log: Tag the BIND 9.9.8-P2 release. Added: vendor/bind9/9.9.8-P2/ - copied from r292314, vendor/bind9/dist/ From owner-svn-src-all@freebsd.org Wed Dec 16 13:12:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8D4EA48504 for ; Wed, 16 Dec 2015 13:12:29 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66ECE130A for ; Wed, 16 Dec 2015 13:12:28 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x233.google.com with SMTP id l126so38854315wml.1 for ; Wed, 16 Dec 2015 05:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=Xjc1xgAr/uuhNDjBmBFWQC0qEj7CNnRHgVgQANjBLs0=; b=pj8MbVeFYtvH6EiCJC96BRFH/JpOobwMlpw2hrcjoKXbtfPT6QN6vVUj9bb1c3mKV7 k/y6r6ngj2q+RyaLN2Z7sTt2nSstz/Eenr5VScuGlOngdQeTKGIIUOEoYZed8DMnR3f9 TMj+GjnDwcillw6GOlslSSUQz91omPnXlNK9+kapWGpqtoUPA3IAcK2zeylxQsBDGs+H JLo2oKUpXt86KNGAHL3CaU6gQwakhLhcMI2jfOeKyECGQawnKnmtCKmnGzPa6tnVAIan F0juznsKsJeaKYDisPvm68+16CBVI/bYVjV4XNdkI1GAMtMU9U44bz+CHBnBPVRsTiEp 1pZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=Xjc1xgAr/uuhNDjBmBFWQC0qEj7CNnRHgVgQANjBLs0=; b=PGBWydA4i2m5yQEMAdnMhZd0PJSu16Z8EsL/5tSSSt/Ucyy9GAq/g7hVrZ4f8w9SwG fDtT169SZYIgpELfY1tFKNhgLaTbx3G9aqRoAl1h3jfgB61eiuM7YgmwXzIZYGIOA8rD B3/ajrAKzmkT0W8AW1YcZED8woG1Cg0VdIPdW03RuYNRE/sq0d9tNmwFYLv2oc/YQRKu u1ptqBEclKmtBAs8gtNb/ms+zvBJLe9pWhHwXgzFqEzIqHV03MlkOhacjOl6OnkrPuYP Hac95+pq8GGZsC20J6QggnSVss0SC8hOctATXHhLlO26pWoYieCcLIFYRQmrBj3dCNln ahag== X-Gm-Message-State: ALoCoQnNSAho33BVXDOhAyLAqsUt3OMWr2Hk6PN5fXjhGsIcwZ4fKzZSkk4cMZWLBBj1PEnwvLoP8XcffwetZ4NshtVC3URkkg== X-Received: by 10.194.188.49 with SMTP id fx17mr54886395wjc.47.1450267778827; Wed, 16 Dec 2015 04:09:38 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id m16sm25469526wmb.13.2015.12.16.04.09.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Dec 2015 04:09:37 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 To: Kristof Provost References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56715486.1000901@freebsd.org> Date: Wed, 16 Dec 2015 12:09:42 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------070407040602050101030405" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:12:30 -0000 This is a multi-part message in MIME format. --------------070407040602050101030405 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 15/12/2015 22:58, Kristof Provost wrote: >> On 15 Dec 2015, at 23:15, Kristof Provost wrote: >> Based on the arp_announce() in the backtrace this commit looks like a possible cause. > I see this in arp_announce(): > KP: arp_announce() ifp->if_addr = 0 > > So that explains why we panic in 'lladdr = IF_LLADDR(ifp);’. > > I’ve done a very quick hack: > diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c > index 2214542..9b25356 100644 > --- a/sys/netinet/if_ether.c > +++ b/sys/netinet/if_ether.c > @@ -1246,9 +1246,15 @@ arp_announce(struct ifnet *ifp) > } > IF_ADDR_RUNLOCK(ifp); > > - lladdr = IF_LLADDR(ifp); > - for (i = 0; i < cnt; i++) { > - arp_announce_addr(ifp, head + i, lladdr); > + printf("KP: %s() ifp = %p\n", __FUNCTION__, ifp); > + printf("KP: %s() ifp->if_addr = %p\n", __FUNCTION__, ifp->if_addr); > + > + if (ifp->if_addr) { > + printf("KP: %s() ifp->if_addr->ifa_addr = %p\n", __FUNCTION__, ifp->if_addr->ifa_addr); > + lladdr = IF_LLADDR(ifp); > + for (i = 0; i < cnt; i++) { > + arp_announce_addr(ifp, head + i, lladdr); > + } > } > free(head, M_TEMP); > } > > With this patch the device boots. I haven’t been able to verify if everything works because of a different issue ("Shared object "lib80211.so.1" not found, required by “ifconfigâ€â€, no doubt just a small problem with the freebsd-wifi-build scripts). > > Regards, > Kristof Thanks for all the info Kristof appreciated. It seems really odd that you're getting a link up event for an interface that doesn't have a LLA, so I'm wondering if this is the result of an issue elsewhere which this change brings to light, its as though if_attach hasn't been called. Looking at your trace the device seems to be an arswitch. If it never allocates a LLA to each port then maybe the more correct fix would be to ensure it IFF_NOARP in if_flags? I've attached a patch which should fix if you could test that would be great, but I'd still like to understand if there is something wrong elsewhere before I do. Regards Steve --------------070407040602050101030405 Content-Type: text/plain; charset=UTF-8; name="if_ether_arp.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="if_ether_arp.patch" SW5kZXg6IHN5cy9uZXRpbmV0L2lmX2V0aGVyLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL25l dGluZXQvaWZfZXRoZXIuYwkocmV2aXNpb24gMjkyMjc1KQorKysgc3lzL25ldGluZXQvaWZf ZXRoZXIuYwkod29ya2luZyBjb3B5KQpAQCAtMTIwOSw3ICsxMjA5LDggQEAgYXJwX2Fubm91 bmNlKHN0cnVjdCBpZm5ldCAqaWZwKQogCXN0cnVjdCBpZmFkZHIgKmlmYTsKIAlzdHJ1Y3Qg aW5fYWRkciAqYWRkciwgKmhlYWQ7CiAKLQlpZiAoIShpZnAtPmlmX2ZsYWdzICYgSUZGX1VQ KSB8fCAoaWZwLT5pZl9mbGFncyAmIElGRl9OT0FSUCkpCisJaWYgKCEoaWZwLT5pZl9mbGFn cyAmIElGRl9VUCkgfHwgKGlmcC0+aWZfZmxhZ3MgJiBJRkZfTk9BUlApIHx8CisJICAgIGlm cC0+aWZfYWRkciA9PSBOVUxMKQogCQlyZXR1cm47CiAKIAllbnRyaWVzID0gODsKQEAgLTEy NDYsOSArMTI0NywxMSBAQCBhcnBfYW5ub3VuY2Uoc3RydWN0IGlmbmV0ICppZnApCiAJfQog CUlGX0FERFJfUlVOTE9DSyhpZnApOwogCi0JbGxhZGRyID0gSUZfTExBRERSKGlmcCk7Ci0J Zm9yIChpID0gMDsgaSA8IGNudDsgaSsrKSB7Ci0JCWFycF9hbm5vdW5jZV9hZGRyKGlmcCwg aGVhZCArIGksIGxsYWRkcik7CisJaWYgKGNudCA+IDApIHsKKwkJbGxhZGRyID0gSUZfTExB RERSKGlmcCk7CisJCWZvciAoaSA9IDA7IGkgPCBjbnQ7IGkrKykgeworCQkJYXJwX2Fubm91 bmNlX2FkZHIoaWZwLCBoZWFkICsgaSwgbGxhZGRyKTsKKwkJfQogCX0KIAlmcmVlKGhlYWQs IE1fVEVNUCk7CiB9Cg== --------------070407040602050101030405-- From owner-svn-src-all@freebsd.org Wed Dec 16 13:16:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B17A48EF0; Wed, 16 Dec 2015 13:16:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1CBA638F4; Wed, 16 Dec 2015 13:16:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:584e:4e41:54fa:aebf] (unknown [IPv6:2a02:1811:2419:4e02:584e:4e41:54fa:aebf]) by venus.codepro.be (Postfix) with ESMTPSA id E0B8B8AAD; Wed, 16 Dec 2015 07:55:40 +0100 (CET) Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=us-ascii From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: Date: Wed, 16 Dec 2015 07:55:38 +0100 Cc: Steven Hartland , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <3DF9C3D5-ECA8-4FC9-867D-C6974DA4C059@FreeBSD.org> References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:16:15 -0000 > On 16 Dec 2015, at 00:08, Adrian Chadd wrote: >=20 > oops, file a bug at github.com/freebsd/freebsd-wifi-build and I'll fix = it asap. >=20 No worries, it happens: https://github.com/freebsd/freebsd-wifi-build/issues/68 This fixed the problem for me: diff --git a/build/bin/build_mfsroot b/build/bin/build_mfsroot index 2c1f0f4..733f1fb 100755 --- a/build/bin/build_mfsroot +++ b/build/bin/build_mfsroot @@ -267,6 +267,7 @@ ${INSTALL_DEF_FILE} ${X_BASEDIR}/files/pf.conf = ${X_STAGING_FSROOT}/c/etc/ # networking ${INSTALL_DEF_BIN} ${X_DESTDIR}/sbin/ifconfig ${X_STAGING_FSROOT}/sbin/ +${INSTALL_DEF_LIB} ${X_DESTDIR}/lib/lib80211.so.1 = ${X_STAGING_FSROOT}/lib ${INSTALL_DEF_BIN} ${X_DESTDIR}/sbin/route ${X_STAGING_FSROOT}/sbin/ ${INSTALL_DEF_BIN} ${X_DESTDIR}/sbin/ping ${X_STAGING_FSROOT}/sbin/ ${INSTALL_DEF_BIN} ${X_DESTDIR}/sbin/ping6 ${X_STAGING_FSROOT}/sbin/ Steven, With this patch and the hack in my previous e-mail my TPLink boots = correctly and works as expected. Regards, Kristof= From owner-svn-src-all@freebsd.org Wed Dec 16 13:27:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3D3A486F2; Wed, 16 Dec 2015 13:27:54 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward13o.cmail.yandex.net (forward13o.cmail.yandex.net [IPv6:2a02:6b8:0:1a72::1e3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 133F1134A; Wed, 16 Dec 2015 13:27:53 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from web13o.yandex.ru (web13o.yandex.ru [IPv6:2a02:6b8:0:1a2d::5:113]) by forward13o.cmail.yandex.net (Yandex) with ESMTP id 8C33A21823; Wed, 16 Dec 2015 12:02:49 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web13o.yandex.ru (Yandex) with ESMTP id 912D74882642; Wed, 16 Dec 2015 12:02:48 +0300 (MSK) Received: by web13o.yandex.ru with HTTP; Wed, 16 Dec 2015 12:02:47 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Steven Hartland , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201512151602.tBFG2BTX089543@repo.freebsd.org> References: null <201512151602.tBFG2BTX089543@repo.freebsd.org> Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 MIME-Version: 1.0 Message-Id: <633021450256567@web13o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 16 Dec 2015 12:02:47 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:27:54 -0000 15.12.2015, 19:02, "Steven Hartland" : > Author: smh > Date: Tue Dec 15 16:02:11 2015 > New Revision: 292275 > URL: https://svnweb.freebsd.org/changeset/base/292275 > > Log: > ššFix lagg failover due to missing notifications > > ššWhen using lagg failover mode neither Gratuitous ARP (IPv4) or Unsolicited > ššNeighbour Advertisements (IPv6) are sent to notify other nodes that the > ššaddress may have moved. > > ššThis results is slow failover, dropped packets and network outages for the > ššlagg interface when the primary link goes down. > > ššWe now use the new if_link_state_change_cond with the force param set to > ššallow lagg to force through link state changes and hence fire a > ššifnet_link_event which are now monitored by rip and nd6. > > ššUpon receiving these events each protocol trigger the relevant > ššnotifications: > šš* inet4 => Gratuitous ARP > šš* inet6 => Unsolicited Neighbour Announce Steven, I believe that having DELAY() called inside callout routine is incorrect - you are delaying other consumers for arbitrary amount of time. If you really want to do it that way you should create separate taskqueue for that. Also, destroying interface while doing these DELAYs would very likely crash the system :"#define IN6_MAX_ANYCAST_DELAY_TIME_MS 1000000" is misguiding There are some style(9) issues like lack of empty line between nd6_init() and nd6_ifnet_link_event() ... > > ššThis also fixes the carp IPv6 NA's that stopped working after r251584 which > ššadded the ipv6_route__llma route. > > ššThe new behavour can be controlled using the sysctls: > šš* net.link.ether.inet.arp_on_link > šš* net.inet6.icmp6.nd6_on_link > > ššAlso removed unused param from lagg_port_state and added descriptions for the > ššsysctls while here. > > ššPR: 156226 > ššMFC after: 1 month > ššSponsored by: Multiplay > ššDifferential Revision: https://reviews.freebsd.org/D4111 > > Modified: > ššhead/sys/net/if.c > ššhead/sys/net/if_lagg.c > ššhead/sys/net/if_lagg.h > ššhead/sys/net/if_var.h > ššhead/sys/netinet/if_ether.c > ššhead/sys/netinet/if_ether.h > ššhead/sys/netinet/in_var.h > ššhead/sys/netinet/ip_carp.c > ššhead/sys/netinet6/in6.c > ššhead/sys/netinet6/in6_var.h > ššhead/sys/netinet6/nd6.c > ššhead/sys/netinet6/nd6.h > ššhead/sys/netinet6/nd6_nbr.c > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/net/if.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -126,7 +126,7 @@ SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifn > > švoid (*bridge_linkstate_p)(struct ifnet *ifp); > švoid (*ng_ether_link_state_p)(struct ifnet *ifp, int state); > -void (*lagg_linkstate_p)(struct ifnet *ifp, int state); > +void (*lagg_linkstate_p)(struct ifnet *ifp); > š/* These are external hooks for CARP. */ > švoid (*carp_linkstate_p)(struct ifnet *ifp); > švoid (*carp_demote_adj_p)(int, char *); > @@ -1984,6 +1984,8 @@ if_unroute(struct ifnet *ifp, int flag, > > šššššššššif (ifp->if_carp) > ššššššššššššššššš(*carp_linkstate_p)(ifp); > + if (ifp->if_lagg) > + (*lagg_linkstate_p)(ifp); > šššššššššrt_ifmsg(ifp); > š} > > @@ -2005,6 +2007,8 @@ if_route(struct ifnet *ifp, int flag, in > šššššššššššššššššššššššššpfctlinput(PRC_IFUP, ifa->ifa_addr); > šššššššššif (ifp->if_carp) > ššššššššššššššššš(*carp_linkstate_p)(ifp); > + if (ifp->if_lagg) > + (*lagg_linkstate_p)(ifp); > šššššššššrt_ifmsg(ifp); > š#ifdef INET6 > šššššššššin6_if_up(ifp); > @@ -2019,17 +2023,27 @@ int (*vlan_tag_p)(struct ifnet *, uint16 > šint (*vlan_setcookie_p)(struct ifnet *, void *); > švoid *(*vlan_cookie_p)(struct ifnet *); > > +void > +if_link_state_change(struct ifnet *ifp, int link_state) > +{ > + > + return if_link_state_change_cond(ifp, link_state, 0); > +} > + > š/* > šš* Handle a change in the interface link state. To avoid LORs > šš* between driver lock and upper layer locks, as well as possible > šš* recursions, we post event to taskqueue, and all job > šš* is done in static do_link_state_change(). > + * > + * If the current link state matches link_state and force isn't > + * specified no action is taken. > šš*/ > švoid > -if_link_state_change(struct ifnet *ifp, int link_state) > +if_link_state_change_cond(struct ifnet *ifp, int link_state, int force) > š{ > - /* Return if state hasn't changed. */ > - if (ifp->if_link_state == link_state) > + > + if (ifp->if_link_state == link_state && !force) > šššššššššššššššššreturn; > > šššššššššifp->if_link_state = link_state; > @@ -2057,7 +2071,7 @@ do_link_state_change(void *arg, int pend > šššššššššif (ifp->if_bridge) > ššššššššššššššššš(*bridge_linkstate_p)(ifp); > šššššššššif (ifp->if_lagg) > - (*lagg_linkstate_p)(ifp, link_state); > + (*lagg_linkstate_p)(ifp); > > šššššššššif (IS_DEFAULT_VNET(curvnet)) > šššššššššššššššššdevctl_notify("IFNET", ifp->if_xname, > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/net/if_lagg.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -106,7 +106,7 @@ static int lagg_port_create(struct lagg_ > šstatic int lagg_port_destroy(struct lagg_port *, int); > šstatic struct mbuf *lagg_input(struct ifnet *, struct mbuf *); > šstatic void lagg_linkstate(struct lagg_softc *); > -static void lagg_port_state(struct ifnet *, int); > +static void lagg_port_state(struct ifnet *); > šstatic int lagg_port_ioctl(struct ifnet *, u_long, caddr_t); > šstatic int lagg_port_output(struct ifnet *, struct mbuf *, > šššššššššššššššššššššconst struct sockaddr *, struct route *); > @@ -1774,7 +1774,12 @@ lagg_linkstate(struct lagg_softc *sc) > šššššššššššššššššššššššššbreak; > ššššššššššššššššš} > ššššššššš} > - if_link_state_change(sc->sc_ifp, new_link); > + > + /* > + * Force state change to ensure ifnet_link_event is generated allowing > + * protocols to notify other nodes of potential address move. > + */ > + if_link_state_change_cond(sc->sc_ifp, new_link, 1); > > ššššššššš/* Update if_baudrate to reflect the max possible speed */ > šššššššššswitch (sc->sc_proto) { > @@ -1797,7 +1802,7 @@ lagg_linkstate(struct lagg_softc *sc) > š} > > šstatic void > -lagg_port_state(struct ifnet *ifp, int state) > +lagg_port_state(struct ifnet *ifp) > š{ > šššššššššstruct lagg_port *lp = (struct lagg_port *)ifp->if_lagg; > šššššššššstruct lagg_softc *sc = NULL; > @@ -1813,7 +1818,7 @@ lagg_port_state(struct ifnet *ifp, int s > šššššššššLAGG_WUNLOCK(sc); > š} > > -struct lagg_port * > +static struct lagg_port * > šlagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) > š{ > šššššššššstruct lagg_port *lp_next, *rval = NULL; > > Modified: head/sys/net/if_lagg.h > ============================================================================== > --- head/sys/net/if_lagg.h Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/net/if_lagg.h Tue Dec 15 16:02:11 2015 (r292275) > @@ -281,7 +281,7 @@ struct lagg_port { > š#define LAGG_UNLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_UNLOCKED) > > šextern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); > -extern void (*lagg_linkstate_p)(struct ifnet *, int ); > +extern void (*lagg_linkstate_p)(struct ifnet *); > > šint lagg_enqueue(struct ifnet *, struct mbuf *); > > Modified: head/sys/net/if_var.h > ============================================================================== > --- head/sys/net/if_var.h Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/net/if_var.h Tue Dec 15 16:02:11 2015 (r292275) > @@ -500,6 +500,7 @@ struct ifmultiaddr * > švoid if_free(struct ifnet *); > švoid if_initname(struct ifnet *, const char *, int); > švoid if_link_state_change(struct ifnet *, int); > +void if_link_state_change_cond(struct ifnet *, int, int); > šint if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); > švoid if_ref(struct ifnet *); > švoid if_rele(struct ifnet *); > > Modified: head/sys/netinet/if_ether.c > ============================================================================== > --- head/sys/netinet/if_ether.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet/if_ether.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -107,6 +107,7 @@ VNET_PCPUSTAT_SYSUNINIT(arpstat); > š#endif /* VIMAGE */ > > šstatic VNET_DEFINE(int, arp_maxhold) = 1; > +static VNET_DEFINE(int, arp_on_link) = 1; > > š#define V_arpt_keep VNET(arpt_keep) > š#define V_arpt_down VNET(arpt_down) > @@ -114,6 +115,7 @@ static VNET_DEFINE(int, arp_maxhold) = 1 > š#define V_arp_maxtries VNET(arp_maxtries) > š#define V_arp_proxyall VNET(arp_proxyall) > š#define V_arp_maxhold VNET(arp_maxhold) > +#define V_arp_on_link VNET(arp_on_link) > > šSYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_VNET | CTLFLAG_RW, > ššššššššš&VNET_NAME(arpt_keep), 0, > @@ -136,6 +138,9 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT > šššššššššCTLFLAG_RW, &arp_maxpps, 0, > ššššššššš"Maximum number of remotely triggered ARP messages that can be " > ššššššššš"logged per second"); > +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, arp_on_link, CTLFLAG_VNET | CTLFLAG_RW, > + &VNET_NAME(arp_on_link), 0, > + "Send gratuitous ARP's on interface link up events"); > > š#define ARP_LOG(pri, ...) do { \ > šššššššššif (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ > @@ -156,6 +161,7 @@ static void arp_mark_lle_reachable(struc > šstatic void arp_iflladdr(void *arg __unused, struct ifnet *ifp); > > šstatic eventhandler_tag iflladdr_tag; > +static eventhandler_tag ifnet_link_event_tag; > > šstatic const struct netisr_handler arp_nh = { > ššššššššš.nh_name = "arp", > @@ -1176,43 +1182,96 @@ arp_ifinit(struct ifnet *ifp, struct ifa > > šššššššššif (ntohl(dst_in->sin_addr.s_addr) == INADDR_ANY) > šššššššššššššššššreturn; > - arp_announce_ifaddr(ifp, dst_in->sin_addr, IF_LLADDR(ifp)); > + arp_announce_addr(ifp, &dst_in->sin_addr, IF_LLADDR(ifp)); > > šššššššššarp_add_ifa_lle(ifp, dst); > š} > > -void > -arp_announce_ifaddr(struct ifnet *ifp, struct in_addr addr, u_char *enaddr) > +void __noinline > +arp_announce_addr(struct ifnet *ifp, const struct in_addr *addr, u_char *enaddr) > š{ > > - if (ntohl(addr.s_addr) != INADDR_ANY) > - arprequest(ifp, &addr, &addr, enaddr); > + if (ntohl(addr->s_addr) != INADDR_ANY) > + arprequest(ifp, addr, addr, enaddr); > š} > > š/* > - * Sends gratuitous ARPs for each ifaddr to notify other > - * nodes about the address change. > + * Send gratuitous ARPs for all interfaces addresses to notify other nodes of > + * changes. > + * > + * This is a noop if the interface isn't up or has been flagged for no ARP. > šš*/ > -static __noinline void > -arp_handle_ifllchange(struct ifnet *ifp) > +void __noinline > +arp_announce(struct ifnet *ifp) > š{ > + int i, cnt, entries; > + u_char *lladdr; > šššššššššstruct ifaddr *ifa; > + struct in_addr *addr, *head; > > + if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP)) > + return; > + > + entries = 8; > + cnt = 0; > + head = malloc(sizeof(*addr) * entries, M_TEMP, M_NOWAIT); > + if (head == NULL) { > + log(LOG_INFO, "arp_announce: malloc %d entries failed\n", > + entries); > + return; > + } > + > + /* Take a copy then process to avoid locking issues. */ > + IF_ADDR_RLOCK(ifp); > šššššššššTAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { > - if (ifa->ifa_addr->sa_family == AF_INET) > - arp_ifinit(ifp, ifa); > + if (ifa->ifa_addr->sa_family != AF_INET) > + continue; > + > + if (cnt == entries) { > + addr = (struct in_addr *)realloc(head, sizeof(*addr) * > + (entries + 8), M_TEMP, M_NOWAIT); > + if (addr == NULL) { > + log(LOG_INFO, "arp_announce: realloc to %d " > + "entries failed\n", entries + 8); > + /* Process what we have. */ > + break; > + } > + entries += 8; > + head = addr; > + } > + > + addr = head + cnt; > + bcopy(IFA_IN(ifa), addr, sizeof(*addr)); > + cnt++; > ššššššššš} > + IF_ADDR_RUNLOCK(ifp); > + > + lladdr = IF_LLADDR(ifp); > + for (i = 0; i < cnt; i++) { > + arp_announce_addr(ifp, head + i, lladdr); > + } > + free(head, M_TEMP); > +} > + > +/* > + * A handler for interface linkstate change events. > + */ > +static void > +arp_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate) > +{ > + > + if (linkstate == LINK_STATE_UP && V_arp_on_link) > + arp_announce(ifp); > š} > > š/* > - * A handler for interface link layer address change event. > + * A handler for interface link layer address change events. > šš*/ > šstatic __noinline void > šarp_iflladdr(void *arg __unused, struct ifnet *ifp) > š{ > > - if ((ifp->if_flags & IFF_UP) != 0) > - arp_handle_ifllchange(ifp); > + arp_announce(ifp); > š} > > šstatic void > @@ -1220,8 +1279,12 @@ arp_init(void) > š{ > > šššššššššnetisr_register(&arp_nh); > - if (IS_DEFAULT_VNET(curvnet)) > + > + if (IS_DEFAULT_VNET(curvnet)) { > šššššššššššššššššiflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, > šššššššššššššššššššššarp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); > + ifnet_link_event_tag = EVENTHANDLER_REGISTER(ifnet_link_event, > + arp_ifnet_link_event, 0, EVENTHANDLER_PRI_ANY); > + } > š} > šSYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); > > Modified: head/sys/netinet/if_ether.h > ============================================================================== > --- head/sys/netinet/if_ether.h Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet/if_ether.h Tue Dec 15 16:02:11 2015 (r292275) > @@ -119,7 +119,8 @@ int arpresolve(struct ifnet *ifp, int is > švoid arprequest(struct ifnet *, const struct in_addr *, > šššššššššššššconst struct in_addr *, u_char *); > švoid arp_ifinit(struct ifnet *, struct ifaddr *); > -void arp_announce_ifaddr(struct ifnet *, struct in_addr addr, u_char *); > +void arp_announce(struct ifnet *); > +void arp_announce_addr(struct ifnet *, const struct in_addr *addr, u_char *); > š#endif > > š#endif > > Modified: head/sys/netinet/in_var.h > ============================================================================== > --- head/sys/netinet/in_var.h Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet/in_var.h Tue Dec 15 16:02:11 2015 (r292275) > @@ -129,6 +129,9 @@ extern struct rmlock in_ifaddr_lock; > š#define IN_IFADDR_WLOCK_ASSERT() rm_assert(&in_ifaddr_lock, RA_WLOCKED) > š#define IN_IFADDR_WUNLOCK() rm_wunlock(&in_ifaddr_lock) > > +#define IFA_IN(ifa) \ > + (&((struct sockaddr_in *)ifa->ifa_addr)->sin_addr) > + > š/* > šš* Macro for finding the internet address structure (in_ifaddr) > šš* corresponding to one of our IP addresses (in_addr). > > Modified: head/sys/netinet/ip_carp.c > ============================================================================== > --- head/sys/netinet/ip_carp.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet/ip_carp.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -1009,13 +1009,12 @@ static void > šcarp_send_arp(struct carp_softc *sc) > š{ > šššššššššstruct ifaddr *ifa; > - struct in_addr addr; > > šššššššššCARP_FOREACH_IFA(sc, ifa) { > šššššššššššššššššif (ifa->ifa_addr->sa_family != AF_INET) > šššššššššššššššššššššššššcontinue; > - addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; > - arp_announce_ifaddr(sc->sc_carpdev, addr, LLADDR(&sc->sc_addr)); > + arp_announce_addr(sc->sc_carpdev, IFA_IN(ifa), > + LLADDR(&sc->sc_addr)); > ššššššššš} > š} > > @@ -1037,18 +1036,16 @@ carp_iamatch(struct ifaddr *ifa, uint8_t > šstatic void > šcarp_send_na(struct carp_softc *sc) > š{ > - static struct in6_addr mcast = IN6ADDR_LINKLOCAL_ALLNODES_INIT; > šššššššššstruct ifaddr *ifa; > - struct in6_addr *in6; > > šššššššššCARP_FOREACH_IFA(sc, ifa) { > - if (ifa->ifa_addr->sa_family != AF_INET6) > + if (ifa->ifa_addr->sa_family != AF_INET6 || > + IFA_ND6_NA_UNSOLICITED_SKIP(ifa)) > šššššššššššššššššššššššššcontinue; > > - in6 = IFA_IN6(ifa); > - nd6_na_output(sc->sc_carpdev, &mcast, in6, > - ND_NA_FLAG_OVERRIDE, 1, NULL); > - DELAY(1000); /* XXX */ > + nd6_na_output_unsolicited_addr(sc->sc_carpdev, IFA_IN6(ifa), > + IFA_ND6_NA_BASE_FLAGS(sc->sc_carpdev, ifa)); > + nd6_na_unsolicited_addr_delay(ifa); > ššššššššš} > š} > > Modified: head/sys/netinet6/in6.c > ============================================================================== > --- head/sys/netinet6/in6.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet6/in6.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -114,7 +114,7 @@ VNET_DECLARE(int, icmp6_nodeinfo_oldmcpr > š#define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix) > > š/* > - * Definitions of some costant IP6 addresses. > + * Definitions of some constant IP6 addresses. > šš*/ > šconst struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; > šconst struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; > > Modified: head/sys/netinet6/in6_var.h > ============================================================================== > --- head/sys/netinet6/in6_var.h Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet6/in6_var.h Tue Dec 15 16:02:11 2015 (r292275) > @@ -399,6 +399,16 @@ struct in6_rrenumreq { > š#define IA6_SIN6(ia) (&((ia)->ia_addr)) > š#define IA6_DSTSIN6(ia) (&((ia)->ia_dstaddr)) > š#define IFA_IN6(x) (&((struct sockaddr_in6 *)((x)->ifa_addr))->sin6_addr) > +#define IFA_IN6_FLAGS(ifa) ((struct in6_ifaddr *)ifa)->ia6_flags > +#define IFA_ND6_NA_BASE_FLAGS(ifp, ifa) \ > + (IFA_IN6_FLAGS(ifa) & IN6_IFF_ANYCAST ? 0 : ND_NA_FLAG_OVERRIDE) | \ > + ((V_ip6_forwarding && !(ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && \ > + V_ip6_norbit_raif)) ? ND_NA_FLAG_ROUTER : 0) > +#define IFA_ND6_NA_UNSOLICITED_SKIP(ifa) \ > + (IFA_IN6_FLAGS(ifa) & (IN6_IFF_DUPLICATED | IN6_IFF_DEPRECATED | \ > + IN6_IFF_TENTATIVE)) != 0 > +#define IN6_MAX_ANYCAST_DELAY_TIME_MS 1000000 > +#define IN6_BROADCAST_DELAY_TIME_MS 1000 > š#define IFA_DSTIN6(x) (&((struct sockaddr_in6 *)((x)->ifa_dstaddr))->sin6_addr) > > š#define IFPR_IN6(x) (&((struct sockaddr_in6 *)((x)->ifpr_prefix))->sin6_addr) > > Modified: head/sys/netinet6/nd6.c > ============================================================================== > --- head/sys/netinet6/nd6.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet6/nd6.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > š#include > š#include > š#include > +#include > š#include > š#include > š#include > @@ -102,8 +103,12 @@ VNET_DEFINE(int, nd6_maxnudhint) = 0; /* > šššššššššššššššššššššššššššššššššššššššššš* layer hints */ > šstatic VNET_DEFINE(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved > šššššššššššššššššššššššššššššššššššššššššš* ND entries */ > + > +static VNET_DEFINE(int, nd6_on_link) = 1; /* Send unsolicited ND's on link up */ > + > š#define V_nd6_maxndopt VNET(nd6_maxndopt) > š#define V_nd6_maxqueuelen VNET(nd6_maxqueuelen) > +#define V_nd6_on_link VNET(nd6_on_link) > > š#ifdef ND6_DEBUG > šVNET_DEFINE(int, nd6_debug) = 1; > @@ -112,6 +117,7 @@ VNET_DEFINE(int, nd6_debug) = 0; > š#endif > > šstatic eventhandler_tag lle_event_eh; > +static eventhandler_tag ifnet_link_event_eh; > > š/* for debugging? */ > š#if 0 > @@ -196,6 +202,13 @@ nd6_lle_event(void *arg __unused, struct > ššššššššššššštype == RTM_ADD ? RTF_UP: 0), 0, RT_DEFAULT_FIB); > š} > > +static void > +nd6_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate) > +{ > + > + if (linkstate == LINK_STATE_UP && V_nd6_on_link) > + nd6_na_output_unsolicited(ifp); > +} > švoid > šnd6_init(void) > š{ > @@ -211,9 +224,12 @@ nd6_init(void) > šššššššššššššnd6_slowtimo, curvnet); > > šššššššššnd6_dad_init(); > - if (IS_DEFAULT_VNET(curvnet)) > + if (IS_DEFAULT_VNET(curvnet)) { > šššššššššššššššššlle_event_eh = EVENTHANDLER_REGISTER(lle_event, nd6_lle_event, > šššššššššššššššššššššNULL, EVENTHANDLER_PRI_ANY); > + ifnet_link_event_eh = EVENTHANDLER_REGISTER(ifnet_link_event, > + nd6_ifnet_link_event, NULL, EVENTHANDLER_PRI_ANY); > + } > š} > > š#ifdef VIMAGE > @@ -223,8 +239,10 @@ nd6_destroy() > > šššššššššcallout_drain(&V_nd6_slowtimo_ch); > šššššššššcallout_drain(&V_nd6_timer_ch); > - if (IS_DEFAULT_VNET(curvnet)) > + if (IS_DEFAULT_VNET(curvnet)) { > šššššššššššššššššEVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); > + EVENTHANDLER_DEREGISTER(ifnet_link_event, ifnet_link_event_eh); > + } > š} > š#endif > > @@ -2457,13 +2475,18 @@ static int nd6_sysctl_prlist(SYSCTL_HAND > šSYSCTL_DECL(_net_inet6_icmp6); > š#endif > šSYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_DRLIST, nd6_drlist, > - CTLFLAG_RD, nd6_sysctl_drlist, ""); > + CTLFLAG_RD, nd6_sysctl_drlist, "List default routers"); > šSYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_PRLIST, nd6_prlist, > - CTLFLAG_RD, nd6_sysctl_prlist, ""); > + CTLFLAG_RD, nd6_sysctl_prlist, "List prefixes"); > šSYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXQLEN, nd6_maxqueuelen, > - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, ""); > + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, > + "Max packets cached in unresolved ND entries"); > šSYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_gctimer, > - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), ""); > + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), > + "Interface in seconds between garbage collection passes"); > +SYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_on_link, CTLFLAG_VNET | CTLFLAG_RW, > + &VNET_NAME(nd6_on_link), 0, > + "Send unsolicited neighbor discovery on interface link up events"); > > šstatic int > šnd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) > > Modified: head/sys/netinet6/nd6.h > ============================================================================== > --- head/sys/netinet6/nd6.h Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet6/nd6.h Tue Dec 15 16:02:11 2015 (r292275) > @@ -398,6 +398,10 @@ void nd6_init(void); > š#ifdef VIMAGE > švoid nd6_destroy(void); > š#endif > +void nd6_na_output_unsolicited(struct ifnet *); > +void nd6_na_output_unsolicited_addr(struct ifnet *, const struct in6_addr *, > + u_long); > +int nd6_na_unsolicited_addr_delay(struct ifaddr *); > šstruct nd_ifinfo *nd6_ifattach(struct ifnet *); > švoid nd6_ifdetach(struct nd_ifinfo *); > šint nd6_is_addr_neighbor(const struct sockaddr_in6 *, struct ifnet *); > > Modified: head/sys/netinet6/nd6_nbr.c > ============================================================================== > --- head/sys/netinet6/nd6_nbr.c Tue Dec 15 15:48:03 2015 (r292274) > +++ head/sys/netinet6/nd6_nbr.c Tue Dec 15 16:02:11 2015 (r292275) > @@ -124,20 +124,16 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššstruct in6_addr saddr6 = ip6->ip6_src; > šššššššššstruct in6_addr daddr6 = ip6->ip6_dst; > šššššššššstruct in6_addr taddr6; > - struct in6_addr myaddr6; > šššššššššchar *lladdr = NULL; > šššššššššstruct ifaddr *ifa = NULL; > + u_long flags; > šššššššššint lladdrlen = 0; > - int anycast = 0, proxy = 0, tentative = 0; > + int proxy = 0; > šššššššššint tlladdr; > - int rflag; > šššššššššunion nd_opts ndopts; > šššššššššstruct sockaddr_dl proxydl; > šššššššššchar ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; > > - rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; > - if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) > - rflag = 0; > š#ifndef PULLDOWN_TEST > šššššššššIP6_EXTHDR_CHECK(m, off, icmp6len,); > šššššššššnd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off); > @@ -229,10 +225,7 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššš* In implementation, we add target link-layer address by default. > šššššššššš* We do not add one in MUST NOT cases. > šššššššššš*/ > - if (!IN6_IS_ADDR_MULTICAST(&daddr6)) > - tlladdr = 0; > - else > - tlladdr = 1; > + tlladdr = !IN6_IS_ADDR_MULTICAST(&daddr6); > > ššššššššš/* > šššššššššš* Target address (taddr6) must be either: > @@ -289,9 +282,6 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššššššššššš*/ > šššššššššššššššššgoto freeit; > ššššššššš} > - myaddr6 = *IFA_IN6(ifa); > - anycast = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST; > - tentative = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE; > šššššššššif (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DUPLICATED) > šššššššššššššššššgoto freeit; > > @@ -303,7 +293,7 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššššššššššgoto bad; > ššššššššš} > > - if (IN6_ARE_ADDR_EQUAL(&myaddr6, &saddr6)) { > + if (IN6_ARE_ADDR_EQUAL(IFA_IN6(ifa), &saddr6)) { > šššššššššššššššššnd6log((LOG_INFO, "nd6_ns_input: duplicate IP6 address %s\n", > šššššššššššššššššššššip6_sprintf(ip6bufs, &saddr6))); > šššššššššššššššššgoto freeit; > @@ -321,7 +311,7 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššš* > šššššššššš* The processing is defined in RFC 2462. > šššššššššš*/ > - if (tentative) { > + if (IFA_IN6_FLAGS(ifa) & IN6_IFF_TENTATIVE) { > ššššššššššššššššš/* > šššššššššššššššššš* If source address is unspecified address, it is for > šššššššššššššššššš* duplicate address detection. > @@ -335,6 +325,10 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššššššššššgoto freeit; > ššššššššš} > > + flags = IFA_ND6_NA_BASE_FLAGS(ifp, ifa); > + if (proxy || !tlladdr) > + flags &= ~ND_NA_FLAG_OVERRIDE; > + > ššššššššš/* > šššššššššš* If the source address is unspecified address, entries must not > šššššššššš* be created or updated. > @@ -349,20 +343,16 @@ nd6_ns_input(struct mbuf *m, int off, in > šššššššššššššššššin6_all = in6addr_linklocal_allnodes; > šššššššššššššššššif (in6_setscope(&in6_all, ifp, NULL) != 0) > šššššššššššššššššššššššššgoto bad; > - nd6_na_output_fib(ifp, &in6_all, &taddr6, > - ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | > - rflag, tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL, > - M_GETFIB(m)); > + nd6_na_output_fib(ifp, &in6_all, &taddr6, flags, tlladdr, > + proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); > šššššššššššššššššgoto freeit; > ššššššššš} > > šššššššššnd6_cache_lladdr(ifp, &saddr6, lladdr, lladdrlen, > šššššššššššššND_NEIGHBOR_SOLICIT, 0); > > - nd6_na_output_fib(ifp, &saddr6, &taddr6, > - ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | > - rflag | ND_NA_FLAG_SOLICITED, tlladdr, > - proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); > + nd6_na_output_fib(ifp, &saddr6, &taddr6, flags | ND_NA_FLAG_SOLICITED, > + tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); > ššfreeit: > šššššššššif (ifa != NULL) > šššššššššššššššššifa_free(ifa); > @@ -1597,3 +1587,110 @@ nd6_dad_na_input(struct ifaddr *ifa) > šššššššššššššššššnd6_dad_rele(dp); > ššššššššš} > š} > + > +/* > + * Send unsolicited neighbor advertisements for all interface addresses to > + * notify other nodes of changes. > + * > + * This is a noop if the interface isn't up. > + */ > +void __noinline > +nd6_na_output_unsolicited(struct ifnet *ifp) > +{ > + int i, cnt, entries; > + struct ifaddr *ifa; > + struct ann { > + struct in6_addr addr; > + u_long flags; > + int delay; > + } *ann1, *head; > + > + if (!(ifp->if_flags & IFF_UP)) > + return; > + > + entries = 8; > + cnt = 0; > + head = malloc(sizeof(struct ann) * entries, M_TEMP, M_WAITOK); > + > + /* Take a copy then process to avoid locking issues. */ > + IF_ADDR_RLOCK(ifp); > + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { > + if (ifa->ifa_addr->sa_family != AF_INET6 || > + IFA_ND6_NA_UNSOLICITED_SKIP(ifa)) > + continue; > + > + if (cnt == entries) { > + ann1 = (struct ann*)realloc(head, sizeof(struct ann) * > + (entries + 8), M_TEMP, M_NOWAIT); > + if (ann1 == NULL) { > + log(LOG_INFO, "nd6_announce: realloc to %d " > + "entries failed\n", entries + 8); > + /* Process what we have. */ > + break; > + } > + entries += 8; > + head = ann1; > + } > + > + ann1 = head + cnt; > + bcopy(IFA_IN6(ifa), &ann1->addr, sizeof(ann1->addr)); > + ann1->flags = IFA_ND6_NA_BASE_FLAGS(ifp, ifa); > + ann1->delay = nd6_na_unsolicited_addr_delay(ifa); > + cnt++; > + } > + IF_ADDR_RUNLOCK(ifp); > + > + for (i = 0; i < cnt;) { > + ann1 = head + i; > + nd6_na_output_unsolicited_addr(ifp, &ann1->addr, ann1->flags); > + i++; > + if (i == cnt) > + break; > + DELAY(ann1->delay); > + } > + free(head, M_TEMP); > +} > + > +/* > + * Return the delay required for announcements of the address as per RFC 4861. > + */ > +int > +nd6_na_unsolicited_addr_delay(struct ifaddr *ifa) > +{ > + > + if (IFA_IN6_FLAGS(ifa) & IN6_IFF_ANYCAST) { > + /* > + * Random value between 0 and MAX_ANYCAST_DELAY_TIME > + * as per section 7.2.7. > + */ > + return (random() % IN6_MAX_ANYCAST_DELAY_TIME_MS); > + } > + > + /* Small delay as per section 7.2.6. */ > + return (IN6_BROADCAST_DELAY_TIME_MS); > +} > + > +/* > + * Send an unsolicited neighbor advertisement for an address to notify other > + * nodes of changes. > + */ > +void __noinline > +nd6_na_output_unsolicited_addr(struct ifnet *ifp, const struct in6_addr *addr, > + u_long flags) > +{ > + int error; > + struct in6_addr mcast; > + > + mcast = in6addr_linklocal_allnodes; > + if ((error = in6_setscope(&mcast, ifp, NULL)) != 0) { > + /* > + * This shouldn't by possible as the only error is for loopback > + * address which we're not using. > + */ > + log(LOG_INFO, "in6_setscope: on mcast failed: %d\n", error); > + return; > + } > + nd6_na_output(ifp, &mcast, addr, flags, 1, NULL); > +} > + > + From owner-svn-src-all@freebsd.org Wed Dec 16 13:33:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3A4A49363; Wed, 16 Dec 2015 13:33:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA311A29; Wed, 16 Dec 2015 13:33:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBG81s1O009025 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 16 Dec 2015 10:01:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBG81s1O009025 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBG81si4009024; Wed, 16 Dec 2015 10:01:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Dec 2015 10:01:54 +0200 From: Konstantin Belousov To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292299 - head/sys/kern Message-ID: <20151216080154.GP3625@kib.kiev.ua> References: <201512160013.tBG0DGhd048910@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512160013.tBG0DGhd048910@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:33:26 -0000 On Wed, Dec 16, 2015 at 12:13:16AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Wed Dec 16 00:13:16 2015 > New Revision: 292299 > URL: https://svnweb.freebsd.org/changeset/base/292299 > > Log: > Don't call wakeup if we're just returning reserved space; just > return the reservation and wait for more space to appear. Issue which is supposedly fixed by the commit is not due to the possibly excessive wakeups. bufspace_release() and bufspace_wakeup() clear the needsbuffer variable, while the code flow in getnewbuf() calls bufspace_wait() to wait for the condition, which prevented the buffer allocation from succeeding, to pass. > > Submitted by: jeff > Reviewed by: kib > > Modified: > head/sys/kern/vfs_bio.c > > Modified: head/sys/kern/vfs_bio.c > ============================================================================== > --- head/sys/kern/vfs_bio.c Wed Dec 16 00:09:57 2015 (r292298) > +++ head/sys/kern/vfs_bio.c Wed Dec 16 00:13:16 2015 (r292299) > @@ -2909,7 +2909,7 @@ getnewbuf(struct vnode *vp, int slpflag, > } while(buf_scan(false) == 0); > > if (reserved) > - bufspace_release(maxsize); > + atomic_subtract_long(&bufspace, maxsize); > if (bp != NULL) { > bp->b_flags |= B_INVAL; > brelse(bp); From owner-svn-src-all@freebsd.org Wed Dec 16 13:44:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19415A48D64; Wed, 16 Dec 2015 13:44:40 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF25C1E17; Wed, 16 Dec 2015 13:44:14 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGAtK6o079810; Wed, 16 Dec 2015 10:55:20 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGAtJI2079809; Wed, 16 Dec 2015 10:55:19 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201512161055.tBGAtJI2079809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Wed, 16 Dec 2015 10:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292334 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:44:40 -0000 Author: skra Date: Wed Dec 16 10:55:19 2015 New Revision: 292334 URL: https://svnweb.freebsd.org/changeset/base/292334 Log: Adopt assert from amd64 in pmap_remove_pages(). Suggested by: kib Approved by: kib (mentor) Modified: head/sys/arm/arm/pmap-v6-new.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Wed Dec 16 10:14:16 2015 (r292333) +++ head/sys/arm/arm/pmap-v6-new.c Wed Dec 16 10:55:19 2015 (r292334) @@ -4153,10 +4153,25 @@ pmap_remove_pages(pmap_t pmap) uint32_t inuse, bitmask; boolean_t allfree; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: %s called with non-current pmap\n", __func__); - return; + /* + * Assert that the given pmap is only active on the current + * CPU. Unfortunately, we cannot block another CPU from + * activating the pmap while this function is executing. + */ + KASSERT(pmap == vmspace_pmap(curthread->td_proc->p_vmspace), + ("%s: non-current pmap %p", __func__, pmap)); +#if defined(SMP) && defined(INVARIANTS) + { + cpuset_t other_cpus; + + sched_pin(); + other_cpus = pmap->pm_active; + CPU_CLR(PCPU_GET(cpuid), &other_cpus); + sched_unpin(); + KASSERT(CPU_EMPTY(&other_cpus), + ("%s: pmap %p active on other cpus", __func__, pmap)); } +#endif SLIST_INIT(&free); rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); From owner-svn-src-all@freebsd.org Wed Dec 16 13:48:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2F42A493E3; Wed, 16 Dec 2015 13:48:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61A4C15F3; Wed, 16 Dec 2015 13:48:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGAEGA3068244; Wed, 16 Dec 2015 10:14:16 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGAEGvZ068240; Wed, 16 Dec 2015 10:14:16 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512161014.tBGAEGvZ068240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 16 Dec 2015 10:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292333 - in head: sys/net sys/netinet6 usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:48:41 -0000 Author: melifaro Date: Wed Dec 16 10:14:16 2015 New Revision: 292333 URL: https://svnweb.freebsd.org/changeset/base/292333 Log: Provide additional lle data in IPv6 lltable dump used by ndp(8). Before the change, things like lle state were queried via SIOCGNBRINFO_IN6 by ndp(8) for _each_ lle entry in dump. This ioctl was added in 1999, probably to avoid touching rtsock code. This change maps SIOCGNBRINFO_IN6 data to standard rtsock dump the following way: expire (already) maps to rtm_rmx.rmx_expire isrouter -> rtm_flags & RTF_GATEWAY asked -> rtm_rmx.rmx_pksent state -> rtm_rmx.rmx_state (maps to rmx_weight via define) Reviewed by: ae Modified: head/sys/net/route.h head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/usr.sbin/ndp/ndp.c Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Dec 16 09:20:45 2015 (r292332) +++ head/sys/net/route.h Wed Dec 16 10:14:16 2015 (r292333) @@ -83,6 +83,9 @@ struct rt_metrics { #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) +/* lle state is exported in rmx_state rt_metrics field */ +#define rmx_state rmx_weight + #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ #ifdef _KERNEL Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Dec 16 09:20:45 2015 (r292332) +++ head/sys/netinet6/in6.c Wed Dec 16 10:14:16 2015 (r292333) @@ -2359,13 +2359,20 @@ in6_lltable_dump_entry(struct lltable *l sdl->sdl_index = ifp->if_index; sdl->sdl_type = ifp->if_type; bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); - ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + - lle->lle_remtime / hz; + if (lle->la_expire != 0) + ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + + lle->lle_remtime / hz + + time_second - time_uptime; ndpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); if (lle->la_flags & LLE_STATIC) ndpc.rtm.rtm_flags |= RTF_STATIC; if (lle->la_flags & LLE_IFADDR) ndpc.rtm.rtm_flags |= RTF_PINNED; + if (lle->ln_router != 0) + ndpc.rtm.rtm_flags |= RTF_GATEWAY; + ndpc.rtm.rtm_rmx.rmx_pksent = lle->la_asked; + /* Store state in rmx_weight value */ + ndpc.rtm.rtm_rmx.rmx_state = lle->ln_state; ndpc.rtm.rtm_index = ifp->if_index; error = SYSCTL_OUT(wr, &ndpc, sizeof(ndpc)); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Dec 16 09:20:45 2015 (r292332) +++ head/sys/netinet6/nd6.c Wed Dec 16 10:14:16 2015 (r292333) @@ -1748,7 +1748,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru if (ln->la_expire == 0) nbi->expire = 0; else - nbi->expire = ln->la_expire + + nbi->expire = ln->la_expire + ln->lle_remtime / hz + (time_second - time_uptime); LLE_RUNLOCK(ln); break; Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Wed Dec 16 09:20:45 2015 (r292332) +++ head/usr.sbin/ndp/ndp.c Wed Dec 16 10:14:16 2015 (r292333) @@ -563,8 +563,8 @@ dump(struct sockaddr_in6 *addr, int cfla struct sockaddr_in6 *sin; struct sockaddr_dl *sdl; extern int h_errno; - struct in6_nbrinfo *nbi; struct timeval now; + u_long expire; int addrwidth; int llwidth; int ifwidth; @@ -676,52 +676,46 @@ again:; llwidth, llwidth, ether_str(sdl), ifwidth, ifwidth, ifname); /* Print neighbor discovery specific information */ - nbi = getnbrinfo(&sin->sin6_addr, sdl->sdl_index, 1); - if (nbi) { - if (nbi->expire > now.tv_sec) { - printf(" %-9.9s", - sec2str(nbi->expire - now.tv_sec)); - } else if (nbi->expire == 0) - printf(" %-9.9s", "permanent"); - else - printf(" %-9.9s", "expired"); - - switch (nbi->state) { - case ND6_LLINFO_NOSTATE: - printf(" N"); - break; -#ifdef ND6_LLINFO_WAITDELETE - case ND6_LLINFO_WAITDELETE: - printf(" W"); - break; -#endif - case ND6_LLINFO_INCOMPLETE: - printf(" I"); - break; - case ND6_LLINFO_REACHABLE: - printf(" R"); - break; - case ND6_LLINFO_STALE: - printf(" S"); - break; - case ND6_LLINFO_DELAY: - printf(" D"); - break; - case ND6_LLINFO_PROBE: - printf(" P"); - break; - default: - printf(" ?"); - break; - } + expire = rtm->rtm_rmx.rmx_expire; + if (expire > now.tv_sec) + printf(" %-9.9s", sec2str(expire - now.tv_sec)); + else if (expire == 0) + printf(" %-9.9s", "permanent"); + else + printf(" %-9.9s", "expired"); - isrouter = nbi->isrouter; - prbs = nbi->asked; - } else { - warnx("failed to get neighbor information"); - printf(" "); + switch (rtm->rtm_rmx.rmx_state) { + case ND6_LLINFO_NOSTATE: + printf(" N"); + break; +#ifdef ND6_LLINFO_WAITDELETE + case ND6_LLINFO_WAITDELETE: + printf(" W"); + break; +#endif + case ND6_LLINFO_INCOMPLETE: + printf(" I"); + break; + case ND6_LLINFO_REACHABLE: + printf(" R"); + break; + case ND6_LLINFO_STALE: + printf(" S"); + break; + case ND6_LLINFO_DELAY: + printf(" D"); + break; + case ND6_LLINFO_PROBE: + printf(" P"); + break; + default: + printf(" ?"); + break; } + isrouter = rtm->rtm_flags & RTF_GATEWAY; + prbs = rtm->rtm_rmx.rmx_pksent; + /* * other flags. R: router, P: proxy, W: ?? */ From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22056A49AF2; Wed, 16 Dec 2015 13:56:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4A771747; Wed, 16 Dec 2015 13:56:19 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG9H7aA049475; Wed, 16 Dec 2015 09:17:07 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG9H7E1049474; Wed, 16 Dec 2015 09:17:07 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512160917.tBG9H7E1049474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 Dec 2015 09:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292330 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:20 -0000 Author: des Date: Wed Dec 16 09:17:07 2015 New Revision: 292330 URL: https://svnweb.freebsd.org/changeset/base/292330 Log: Reset bufpos to 0 immediately after refilling the buffer. Otherwise, we risk leaving the connection in an indeterminate state if the server fails to send a chunk delimiter. Depending on the application and on the sizes of the preceding chunks, the result can be anything from missing data to a segfault. With this patch, it will be reported as a protocol error. PR: 204771 MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Wed Dec 16 09:16:06 2015 (r292329) +++ head/lib/libfetch/http.c Wed Dec 16 09:17:07 2015 (r292330) @@ -246,8 +246,9 @@ http_fillbuf(struct httpio *io, size_t l io->error = errno; return (-1); } + io->bufpos = 0; io->buflen = nbytes; - io->chunksize -= io->buflen; + io->chunksize -= nbytes; if (io->chunksize == 0) { if (fetch_read(io->conn, &ch, 1) != 1 || ch != '\r' || @@ -255,8 +256,6 @@ http_fillbuf(struct httpio *io, size_t l return (-1); } - io->bufpos = 0; - return (io->buflen); } From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D33BA49B21; Wed, 16 Dec 2015 13:56:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 157901792; Wed, 16 Dec 2015 13:56:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG9KkGC051644; Wed, 16 Dec 2015 09:20:46 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG9KkBw051643; Wed, 16 Dec 2015 09:20:46 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512160920.tBG9KkBw051643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 Dec 2015 09:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292332 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:22 -0000 Author: des Date: Wed Dec 16 09:20:45 2015 New Revision: 292332 URL: https://svnweb.freebsd.org/changeset/base/292332 Log: As a followup to r292330, standardize on size_t and add a few comments. Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Wed Dec 16 09:18:20 2015 (r292331) +++ head/lib/libfetch/http.c Wed Dec 16 09:20:45 2015 (r292332) @@ -130,8 +130,8 @@ struct httpio int chunked; /* chunked mode */ char *buf; /* chunk buffer */ size_t bufsize; /* size of chunk buffer */ - ssize_t buflen; /* amount of data currently in buffer */ - int bufpos; /* current read offset in buffer */ + size_t buflen; /* amount of data currently in buffer */ + size_t bufpos; /* current read offset in buffer */ int eof; /* end-of-file flag */ int error; /* error flag */ size_t chunksize; /* remaining size of current chunk */ @@ -215,6 +215,7 @@ http_fillbuf(struct httpio *io, size_t l if (io->eof) return (0); + /* not chunked: just fetch the requested amount */ if (io->chunked == 0) { if (http_growbuf(io, len) == -1) return (-1); @@ -227,6 +228,7 @@ http_fillbuf(struct httpio *io, size_t l return (io->buflen); } + /* chunked, but we ran out: get the next chunk header */ if (io->chunksize == 0) { switch (http_new_chunk(io)) { case -1: @@ -238,6 +240,7 @@ http_fillbuf(struct httpio *io, size_t l } } + /* fetch the requested amount, but no more than the current chunk */ if (len > io->chunksize) len = io->chunksize; if (http_growbuf(io, len) == -1) From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A86A49B06; Wed, 16 Dec 2015 13:56:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 342AA174F; Wed, 16 Dec 2015 13:56:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG9G60p049307; Wed, 16 Dec 2015 09:16:06 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG9G673049306; Wed, 16 Dec 2015 09:16:06 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512160916.tBG9G673049306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 16 Dec 2015 09:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292329 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:21 -0000 Author: melifaro Date: Wed Dec 16 09:16:06 2015 New Revision: 292329 URL: https://svnweb.freebsd.org/changeset/base/292329 Log: Fix ARP reply handling changed in r286955. If source of ARP request didn't pass the routing check (e.g. not in directly connected network), be polite and still answer the request instead of dropping frame. Reported by: quadro at irc@rusnet Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Dec 16 09:11:11 2015 (r292328) +++ head/sys/netinet/if_ether.c Wed Dec 16 09:16:06 2015 (r292329) @@ -855,12 +855,20 @@ match: arp_check_update_lle(ah, isaddr, ifp, bridged, la); else if (itaddr.s_addr == myaddr.s_addr) { /* - * Reply to our address, but no lle exists yet. - * do we really have to create an entry? + * Request/reply to our address, but no lle exists yet. + * Try to create new llentry. */ la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); - if (la == NULL) - goto drop; + if (la == NULL) { + + /* + * lle creation may fail if source address belongs + * to non-directly connected subnet. However, we + * will try to answer the request instead of dropping + * frame. + */ + goto reply; + } lltable_set_entry_addr(ifp, la, ar_sha(ah)); IF_AFDATA_WLOCK(ifp); From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B624A49B9C; Wed, 16 Dec 2015 13:56:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC1F61A17; Wed, 16 Dec 2015 13:56:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG8rOm7043337; Wed, 16 Dec 2015 08:53:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG8rOM5043336; Wed, 16 Dec 2015 08:53:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160853.tBG8rOM5043336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 08:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292327 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:27 -0000 Author: ngie Date: Wed Dec 16 08:53:24 2015 New Revision: 292327 URL: https://svnweb.freebsd.org/changeset/base/292327 Log: Use fabsl instead of fabs to mute -Wabsolute-value warnings from clang because `nums[]` is an array of long doubles MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-invctrig.c Modified: head/tools/regression/lib/msun/test-invctrig.c ============================================================================== --- head/tools/regression/lib/msun/test-invctrig.c Wed Dec 16 08:48:37 2015 (r292326) +++ head/tools/regression/lib/msun/test-invctrig.c Wed Dec 16 08:53:24 2015 (r292327) @@ -281,21 +281,21 @@ test_axes(void) for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { /* Real axis */ z = CMPLXL(nums[i], 0.0); - if (fabs(nums[i]) <= 1) { + if (fabsl(nums[i]) <= 1) { testall_tol(cacosh, z, CMPLXL(0.0, acos(nums[i])), 1); testall_tol(cacos, z, CMPLXL(acosl(nums[i]), -0.0), 1); testall_tol(casin, z, CMPLXL(asinl(nums[i]), 0.0), 1); testall_tol(catanh, z, CMPLXL(atanh(nums[i]), 0.0), 1); } else { testall_tol(cacosh, z, - CMPLXL(acosh(fabs(nums[i])), + CMPLXL(acosh(fabsl(nums[i])), (nums[i] < 0) ? pi : 0), 1); testall_tol(cacos, z, CMPLXL((nums[i] < 0) ? pi : 0, - -acosh(fabs(nums[i]))), 1); + -acosh(fabsl(nums[i]))), 1); testall_tol(casin, z, CMPLXL(copysign(pi / 2, nums[i]), - acosh(fabs(nums[i]))), 1); + acosh(fabsl(nums[i]))), 1); testall_tol(catanh, z, CMPLXL(atanh(1 / nums[i]), pi / 2), 1); } From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDBCDA49B10; Wed, 16 Dec 2015 13:56:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3431767; Wed, 16 Dec 2015 13:56:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG9IKR0049571; Wed, 16 Dec 2015 09:18:20 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG9IKQc049570; Wed, 16 Dec 2015 09:18:20 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512160918.tBG9IKQc049570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 16 Dec 2015 09:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292331 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:21 -0000 Author: melifaro Date: Wed Dec 16 09:18:20 2015 New Revision: 292331 URL: https://svnweb.freebsd.org/changeset/base/292331 Log: Convert if_stf(4) to new routing api. Modified: head/sys/net/if_stf.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Wed Dec 16 09:17:07 2015 (r292330) +++ head/sys/net/if_stf.c Wed Dec 16 09:18:20 2015 (r292331) @@ -101,6 +101,7 @@ #include #include +#include #include #include #include @@ -557,26 +558,13 @@ stf_checkaddr4(struct stf_softc *sc, str * perform ingress filter */ if (sc && (STF2IFP(sc)->if_flags & IFF_LINK2) == 0 && inifp) { - struct sockaddr_in sin; - struct rtentry *rt; + struct nhop4_basic nh4; - bzero(&sin, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_addr = *in; - rt = rtalloc1_fib((struct sockaddr *)&sin, 0, - 0UL, sc->sc_fibnum); - if (!rt || rt->rt_ifp != inifp) { -#if 0 - log(LOG_WARNING, "%s: packet from 0x%x dropped " - "due to ingress filter\n", if_name(STF2IFP(sc)), - (u_int32_t)ntohl(sin.sin_addr.s_addr)); -#endif - if (rt) - RTFREE_LOCKED(rt); - return -1; - } - RTFREE_LOCKED(rt); + if (fib4_lookup_nh_basic(sc->sc_fibnum, *in, 0, 0, &nh4) != 0) + return (-1); + + if (nh4.nh_ifp != inifp) + return (-1); } return 0; From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4216FA49BD4; Wed, 16 Dec 2015 13:56:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F26881AE8; Wed, 16 Dec 2015 13:56:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG8PCGl034876; Wed, 16 Dec 2015 08:25:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG8PCTh034875; Wed, 16 Dec 2015 08:25:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160825.tBG8PCTh034875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 08:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292324 - head/lib/libc/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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:29 -0000 Author: ngie Date: Wed Dec 16 08:25:12 2015 New Revision: 292324 URL: https://svnweb.freebsd.org/changeset/base/292324 Log: Iterate down lib/libc/tests/nss... MFC after: 1 week X-MFC with: r292323 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/Makefile Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Wed Dec 16 08:09:03 2015 (r292323) +++ head/lib/libc/tests/Makefile Wed Dec 16 08:25:12 2015 (r292324) @@ -10,6 +10,7 @@ TESTS_SUBDIRS+= gen TESTS_SUBDIRS+= hash TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net +TESTS_SUBDIRS+= nss TESTS_SUBDIRS+= regex TESTS_SUBDIRS+= resolv TESTS_SUBDIRS+= rpc From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD900A49BDA; Wed, 16 Dec 2015 13:56:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE661B12; Wed, 16 Dec 2015 13:56:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG8dplv037810; Wed, 16 Dec 2015 08:39:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG8dpI1037809; Wed, 16 Dec 2015 08:39:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512160839.tBG8dpI1037809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Dec 2015 08:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292325 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:29 -0000 Author: kib Date: Wed Dec 16 08:39:51 2015 New Revision: 292325 URL: https://svnweb.freebsd.org/changeset/base/292325 Log: Simplify the loop step in the flushbuflist() and make it independed on the type stability of the buffers memory. Instead of memoizing pointer to the next buffer and validating it, remember the next logical block number in the bo list and re-lookup. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Dec 16 08:25:12 2015 (r292324) +++ head/sys/kern/vfs_subr.c Wed Dec 16 08:39:51 2015 (r292325) @@ -1652,10 +1652,9 @@ flushbuflist(struct bufv *bufv, int flag bp->b_flags &= ~B_ASYNC; brelse(bp); BO_LOCK(bo); - if (nbp != NULL && - (nbp->b_bufobj != bo || - nbp->b_lblkno != lblkno || - (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) != xflags)) + nbp = gbincore(bo, lblkno); + if (nbp == NULL || (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) + != xflags) break; /* nbp invalid */ } return (retval); From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3AFA49BB2; Wed, 16 Dec 2015 13:56:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54ACE1A48; Wed, 16 Dec 2015 13:56:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG8mblT040702; Wed, 16 Dec 2015 08:48:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG8mbJX040699; Wed, 16 Dec 2015 08:48:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512160848.tBG8mbJX040699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Dec 2015 08:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292326 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:27 -0000 Author: kib Date: Wed Dec 16 08:48:37 2015 New Revision: 292326 URL: https://svnweb.freebsd.org/changeset/base/292326 Log: Optimize vop_stdadvise(POSIX_FADV_DONTNEED). Instead of looking up a buffer for each block number in the range with gbincore(), look up the next instantiated buffer with the logical block number which is greater or equal to the next lblkno. This significantly speeds up the iteration for sparce-populated range. Move the iteration into new helper bnoreuselist(), which is structured similarly to flushbuflist(). Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Dec 16 08:39:51 2015 (r292325) +++ head/sys/kern/vfs_default.c Wed Dec 16 08:48:37 2015 (r292326) @@ -1034,10 +1034,9 @@ vop_stdallocate(struct vop_allocate_args int vop_stdadvise(struct vop_advise_args *ap) { - struct buf *bp; - struct buflists *bl; struct vnode *vp; - daddr_t bn, startn, endn; + struct bufobj *bo; + daddr_t startn, endn; off_t start, end; int bsize, error; @@ -1074,36 +1073,21 @@ vop_stdadvise(struct vop_advise_args *ap VM_OBJECT_WUNLOCK(vp->v_object); } - BO_RLOCK(&vp->v_bufobj); + bo = &vp->v_bufobj; + BO_RLOCK(bo); bsize = vp->v_bufobj.bo_bsize; startn = ap->a_start / bsize; - endn = -1; - bl = &vp->v_bufobj.bo_clean.bv_hd; - if (!TAILQ_EMPTY(bl)) - endn = TAILQ_LAST(bl, buflists)->b_lblkno; - bl = &vp->v_bufobj.bo_dirty.bv_hd; - if (!TAILQ_EMPTY(bl) && - endn < TAILQ_LAST(bl, buflists)->b_lblkno) - endn = TAILQ_LAST(bl, buflists)->b_lblkno; - if (ap->a_end != OFF_MAX && endn != -1) - endn = ap->a_end / bsize; - BO_RUNLOCK(&vp->v_bufobj); - /* - * In the VMIO case, use the B_NOREUSE flag to hint that the - * pages backing each buffer in the range are unlikely to be - * reused. Dirty buffers will have the hint applied once - * they've been written. - */ - for (bn = startn; bn <= endn; bn++) { - bp = getblk(vp, bn, bsize, 0, 0, GB_NOCREAT | - GB_UNMAPPED); - if (bp == NULL) + endn = ap->a_end / bsize; + for (;;) { + error = bnoreuselist(&bo->bo_clean, bo, startn, endn); + if (error == EAGAIN) continue; - bp->b_flags |= B_RELBUF; - if (vp->v_object != NULL) - bp->b_flags |= B_NOREUSE; - brelse(bp); + error = bnoreuselist(&bo->bo_dirty, bo, startn, endn); + if (error == EAGAIN) + continue; + break; } + BO_RUNLOCK(bo); VOP_UNLOCK(vp, 0); break; default: Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Dec 16 08:39:51 2015 (r292325) +++ head/sys/kern/vfs_subr.c Wed Dec 16 08:48:37 2015 (r292326) @@ -1660,6 +1660,45 @@ flushbuflist(struct bufv *bufv, int flag return (retval); } +int +bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn) +{ + struct buf *bp; + int error; + daddr_t lblkno; + + ASSERT_BO_LOCKED(bo); + + for (lblkno = startn;; lblkno++) { + bp = BUF_PCTRIE_LOOKUP_GE(&bufv->bv_root, lblkno); + if (bp == NULL || bp->b_lblkno >= endn) + break; + error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | + LK_INTERLOCK, BO_LOCKPTR(bo), "brlsfl", 0, 0); + if (error != 0) { + BO_RLOCK(bo); + return (error != ENOLCK ? error : EAGAIN); + } + KASSERT(bp->b_bufobj == bo, + ("bp %p wrong b_bufobj %p should be %p", + bp, bp->b_bufobj, bo)); + if ((bp->b_flags & B_MANAGED) == 0) + bremfree(bp); + bp->b_flags |= B_RELBUF; + /* + * In the VMIO case, use the B_NOREUSE flag to hint that the + * pages backing each buffer in the range are unlikely to be + * reused. Dirty buffers will have the hint applied once + * they've been written. + */ + if (bp->b_vp->v_object != NULL) + bp->b_flags |= B_NOREUSE; + brelse(bp); + BO_RLOCK(bo); + } + return (0); +} + /* * Truncate a file's buffer and pages to a specified length. This * is in lieu of the old vinvalbuf mechanism, which performed unneeded Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Dec 16 08:39:51 2015 (r292325) +++ head/sys/sys/vnode.h Wed Dec 16 08:48:37 2015 (r292326) @@ -605,6 +605,8 @@ struct vnode; typedef int (*vn_get_ino_t)(struct mount *, void *, int, struct vnode **); +int bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, + daddr_t endn); /* cache_* may belong in namei.h. */ void cache_changesize(int newhashsize); #define cache_enter(dvp, vp, cnp) \ From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9A00A49B96; Wed, 16 Dec 2015 13:56:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6912919E3; Wed, 16 Dec 2015 13:56:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG9BBVW048471; Wed, 16 Dec 2015 09:11:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG9BBAn048465; Wed, 16 Dec 2015 09:11:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160911.tBG9BBAn048465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 09:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292328 - in head: lib/msun/tests tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:26 -0000 Author: ngie Date: Wed Dec 16 09:11:11 2015 New Revision: 292328 URL: https://svnweb.freebsd.org/changeset/base/292328 Log: Integrate a number of testcases from tools/regression/lib/msun into the FreeBSD test suite There's no functional change with these testcases; they're purposely being left in TAP format for the time being Other testcases which crash on amd64/i386 as-is have not been integrated yet (they need to be retested on a later version of CURRENT, as I haven't used i386 in some time) MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Added: head/lib/msun/tests/cexp_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-cexp.c head/lib/msun/tests/conj_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-conj.c head/lib/msun/tests/csqrt_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-csqrt.c head/lib/msun/tests/fenv_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-fenv.c head/lib/msun/tests/fmaxmin_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-fmaxmin.c head/lib/msun/tests/ilogb_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-ilogb.c head/lib/msun/tests/invctrig_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-invctrig.c head/lib/msun/tests/logarithm_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-logarithm.c head/lib/msun/tests/lrint_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-lrint.c head/lib/msun/tests/nan_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-nan.c head/lib/msun/tests/nearbyint_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-nearbyint.c head/lib/msun/tests/next_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-next.c head/lib/msun/tests/rem_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-rem.c head/lib/msun/tests/trig_test.c - copied unchanged from r292327, head/tools/regression/lib/msun/test-trig.c Deleted: head/tools/regression/lib/msun/test-cexp.c head/tools/regression/lib/msun/test-cexp.t head/tools/regression/lib/msun/test-conj.c head/tools/regression/lib/msun/test-conj.t head/tools/regression/lib/msun/test-csqrt.c head/tools/regression/lib/msun/test-csqrt.t head/tools/regression/lib/msun/test-fenv.c head/tools/regression/lib/msun/test-fenv.t head/tools/regression/lib/msun/test-fmaxmin.c head/tools/regression/lib/msun/test-fmaxmin.t head/tools/regression/lib/msun/test-ilogb.c head/tools/regression/lib/msun/test-ilogb.t head/tools/regression/lib/msun/test-invctrig.c head/tools/regression/lib/msun/test-logarithm.c head/tools/regression/lib/msun/test-logarithm.t head/tools/regression/lib/msun/test-lrint.c head/tools/regression/lib/msun/test-lrint.t head/tools/regression/lib/msun/test-nan.c head/tools/regression/lib/msun/test-nan.t head/tools/regression/lib/msun/test-nearbyint.c head/tools/regression/lib/msun/test-nearbyint.t head/tools/regression/lib/msun/test-next.c head/tools/regression/lib/msun/test-next.t head/tools/regression/lib/msun/test-rem.c head/tools/regression/lib/msun/test-rem.t head/tools/regression/lib/msun/test-trig.c head/tools/regression/lib/msun/test-trig.t Modified: head/lib/msun/tests/Makefile head/tools/regression/lib/msun/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Wed Dec 16 08:53:24 2015 (r292327) +++ head/lib/msun/tests/Makefile Wed Dec 16 09:11:11 2015 (r292328) @@ -36,11 +36,34 @@ NETBSD_ATF_TESTS_C+= sqrt_test NETBSD_ATF_TESTS_C+= tan_test NETBSD_ATF_TESTS_C+= tanh_test +TAP_TESTS_C+= cexp_test +TAP_TESTS_C+= conj_test +TAP_TESTS_C+= csqrt_test +TAP_TESTS_C+= fenv_test +TAP_TESTS_C+= fmaxmin_test +TAP_TESTS_C+= ilogb_test +TAP_TESTS_C+= invctrig_test +TAP_TESTS_C+= logarithm_test +TAP_TESTS_C+= lrint_test +TAP_TESTS_C+= nan_test +TAP_TESTS_C+= nearbyint_test +TAP_TESTS_C+= next_test +TAP_TESTS_C+= rem_test +TAP_TESTS_C+= trig_test + +.for t in ${TAP_TESTS_C} +CFLAGS.$t+= -O0 +CFLAGS.$t+= -I${SRCTOP}/tools/regression/lib/msun +.endfor + CSTD= c99 -LIBADD+= m #COPTS+= -Wfloat-equal +IGNORE_PRAGMA= + +LIBADD+= m + # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" ARCH_SUBDIR= i387 Copied: head/lib/msun/tests/cexp_test.c (from r292327, head/tools/regression/lib/msun/test-cexp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/cexp_test.c Wed Dec 16 09:11:11 2015 (r292328, copy of r292327, head/tools/regression/lib/msun/test-cexp.c) @@ -0,0 +1,322 @@ +/*- + * Copyright (c) 2008-2011 David Schultz + * 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. + */ + +/* + * Tests for corner cases in cexp*(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. In some cases, + * whether cexp() raises an invalid exception is unspecified. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* Test within a given tolerance. */ +#define test_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + assert(cfpequal_tol((func)(_d), (result), (tol), \ + FPE_ABS_ZERO | CS_BOTH)); \ +} while (0) + +/* Test all the functions that compute cexp(x). */ +#define testall(x, result, exceptmask, excepts, checksign) do { \ + test(cexp, x, result, exceptmask, excepts, checksign); \ + test(cexpf, x, result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test all the functions that compute cexp(x), within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(x, result, tol) do { \ + test_tol(cexp, x, result, tol * DBL_ULP()); \ + test_tol(cexpf, x, result, tol * FLT_ULP()); \ +} while (0) + +/* Various finite non-zero numbers to test. */ +static const float finites[] = +{ -42.0e20, -1.0, -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; + + +/* Tests for 0 */ +void +test_zero(void) +{ + + /* cexp(0) = 1, no exceptions raised */ + testall(0.0, 1.0, ALL_STD_EXCEPT, 0, 1); + testall(-0.0, 1.0, ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(0.0, -0.0), CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(-0.0, -0.0), CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, 1); +} + +/* + * Tests for NaN. The signs of the results are indeterminate unless the + * imaginary part is 0. + */ +void +test_nan() +{ + int i; + + /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */ + /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */ + for (i = 0; i < nitems(finites); i++) { + printf("# Run %d..\n", i); + testall(CMPLXL(finites[i], NAN), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT & ~FE_INVALID, 0, 0); + if (finites[i] == 0.0) + continue; + /* XXX FE_INEXACT shouldn't be raised here */ + testall(CMPLXL(NAN, finites[i]), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT & ~(FE_INVALID | FE_INEXACT), 0, 0); + } + + /* cexp(NaN +- 0i) = NaN +- 0i */ + testall(CMPLXL(NAN, 0.0), CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(NAN, -0.0), CMPLXL(NAN, -0.0), ALL_STD_EXCEPT, 0, 1); + + /* cexp(inf + NaN i) = inf + nan i */ + testall(CMPLXL(INFINITY, NAN), CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, 0, 0); + /* cexp(-inf + NaN i) = 0 */ + testall(CMPLXL(-INFINITY, NAN), CMPLXL(0.0, 0.0), + ALL_STD_EXCEPT, 0, 0); + /* cexp(NaN + NaN i) = NaN + NaN i */ + testall(CMPLXL(NAN, NAN), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT, 0, 0); +} + +void +test_inf(void) +{ + int i; + + /* cexp(x + inf i) = NaN + NaNi and raises invalid */ + for (i = 0; i < nitems(finites); i++) { + printf("# Run %d..\n", i); + testall(CMPLXL(finites[i], INFINITY), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT, FE_INVALID, 1); + } + /* cexp(-inf + yi) = 0 * (cos(y) + sin(y)i) */ + /* XXX shouldn't raise an inexact exception */ + testall(CMPLXL(-INFINITY, M_PI_4), CMPLXL(0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 3 * M_PI_4), CMPLXL(-0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 5 * M_PI_4), CMPLXL(-0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 7 * M_PI_4), CMPLXL(0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 0.0), CMPLXL(0.0, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(-INFINITY, -0.0), CMPLXL(0.0, -0.0), + ALL_STD_EXCEPT, 0, 1); + /* cexp(inf + yi) = inf * (cos(y) + sin(y)i) (except y=0) */ + /* XXX shouldn't raise an inexact exception */ + testall(CMPLXL(INFINITY, M_PI_4), CMPLXL(INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(INFINITY, 3 * M_PI_4), CMPLXL(-INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(INFINITY, 5 * M_PI_4), CMPLXL(-INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(INFINITY, 7 * M_PI_4), CMPLXL(INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + /* cexp(inf + 0i) = inf + 0i */ + testall(CMPLXL(INFINITY, 0.0), CMPLXL(INFINITY, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(INFINITY, -0.0), CMPLXL(INFINITY, -0.0), + ALL_STD_EXCEPT, 0, 1); +} + +void +test_reals(void) +{ + int i; + + for (i = 0; i < nitems(finites); i++) { + /* XXX could check exceptions more meticulously */ + printf("# Run %d..\n", i); + test(cexp, CMPLXL(finites[i], 0.0), + CMPLXL(exp(finites[i]), 0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexp, CMPLXL(finites[i], -0.0), + CMPLXL(exp(finites[i]), -0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexpf, CMPLXL(finites[i], 0.0), + CMPLXL(expf(finites[i]), 0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexpf, CMPLXL(finites[i], -0.0), + CMPLXL(expf(finites[i]), -0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + } +} + +void +test_imaginaries(void) +{ + int i; + + for (i = 0; i < nitems(finites); i++) { + printf("# Run %d..\n", i); + test(cexp, CMPLXL(0.0, finites[i]), + CMPLXL(cos(finites[i]), sin(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexp, CMPLXL(-0.0, finites[i]), + CMPLXL(cos(finites[i]), sin(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexpf, CMPLXL(0.0, finites[i]), + CMPLXL(cosf(finites[i]), sinf(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexpf, CMPLXL(-0.0, finites[i]), + CMPLXL(cosf(finites[i]), sinf(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + } +} + +void +test_small(void) +{ + static const double tests[] = { + /* csqrt(a + bI) = x + yI */ + /* a b x y */ + 1.0, M_PI_4, M_SQRT2 * 0.5 * M_E, M_SQRT2 * 0.5 * M_E, + -1.0, M_PI_4, M_SQRT2 * 0.5 / M_E, M_SQRT2 * 0.5 / M_E, + 2.0, M_PI_2, 0.0, M_E * M_E, + M_LN2, M_PI, -2.0, 0.0, + }; + double a, b; + double x, y; + int i; + + for (i = 0; i < nitems(tests); i += 4) { + printf("# Run %d..\n", i); + a = tests[i]; + b = tests[i + 1]; + x = tests[i + 2]; + y = tests[i + 3]; + test_tol(cexp, CMPLXL(a, b), CMPLXL(x, y), 3 * DBL_ULP()); + + /* float doesn't have enough precision to pass these tests */ + if (x == 0 || y == 0) + continue; + test_tol(cexpf, CMPLXL(a, b), CMPLXL(x, y), 1 * FLT_ULP()); + } +} + +/* Test inputs with a real part r that would overflow exp(r). */ +void +test_large(void) +{ + + test_tol(cexp, CMPLXL(709.79, 0x1p-1074), + CMPLXL(INFINITY, 8.94674309915433533273e-16), DBL_ULP()); + test_tol(cexp, CMPLXL(1000, 0x1p-1074), + CMPLXL(INFINITY, 9.73344457300016401328e+110), DBL_ULP()); + test_tol(cexp, CMPLXL(1400, 0x1p-1074), + CMPLXL(INFINITY, 5.08228858149196559681e+284), DBL_ULP()); + test_tol(cexp, CMPLXL(900, 0x1.23456789abcdep-1020), + CMPLXL(INFINITY, 7.42156649354218408074e+83), DBL_ULP()); + test_tol(cexp, CMPLXL(1300, 0x1.23456789abcdep-1020), + CMPLXL(INFINITY, 3.87514844965996756704e+257), DBL_ULP()); + + test_tol(cexpf, CMPLXL(88.73, 0x1p-149), + CMPLXL(INFINITY, 4.80265603e-07), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(90, 0x1p-149), + CMPLXL(INFINITY, 1.7101492622e-06f), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(192, 0x1p-149), + CMPLXL(INFINITY, 3.396809344e+38f), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(120, 0x1.234568p-120), + CMPLXL(INFINITY, 1.1163382522e+16f), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(170, 0x1.234568p-120), + CMPLXL(INFINITY, 5.7878851079e+37f), 2 * FLT_ULP()); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..7\n"); + + test_zero(); + printf("ok 1 - cexp zero\n"); + + test_nan(); + printf("ok 2 - cexp nan\n"); + + test_inf(); + printf("ok 3 - cexp inf\n"); + +#if defined(__i386__) + printf("not ok 4 - cexp reals # TODO: PR # 191676 fails assertion on i386\n"); +#else + test_reals(); + printf("ok 4 - cexp reals\n"); +#endif + + test_imaginaries(); + printf("ok 5 - cexp imaginaries\n"); + + test_small(); + printf("ok 6 - cexp small\n"); + + test_large(); + printf("ok 7 - cexp large\n"); + + return (0); +} Copied: head/lib/msun/tests/conj_test.c (from r292327, head/tools/regression/lib/msun/test-conj.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/conj_test.c Wed Dec 16 09:11:11 2015 (r292328, copy of r292327, head/tools/regression/lib/msun/test-conj.c) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2008 David Schultz + * 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. + */ + +/* + * Tests for conj{,f,l}() + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC CX_LIMITED_RANGE OFF + +/* Make sure gcc doesn't use builtin versions of these or honor __pure2. */ +static float complex (*libconjf)(float complex) = conjf; +static double complex (*libconj)(double complex) = conj; +static long double complex (*libconjl)(long double complex) = conjl; +static float (*libcrealf)(float complex) = crealf; +static double (*libcreal)(double complex) = creal; +static long double (*libcreall)(long double complex) = creall; +static float (*libcimagf)(float complex) = cimagf; +static double (*libcimag)(double complex) = cimag; +static long double (*libcimagl)(long double complex) = cimagl; + +static const double tests[] = { + /* a + bI */ + 0.0, 0.0, + 0.0, 1.0, + 1.0, 0.0, + -1.0, 0.0, + 1.0, -0.0, + 0.0, -1.0, + 2.0, 4.0, + 0.0, INFINITY, + 0.0, -INFINITY, + INFINITY, 0.0, + NAN, 1.0, + 1.0, NAN, + NAN, NAN, + -INFINITY, INFINITY, +}; + +int +main(int argc, char *argv[]) +{ + static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2; + complex float in; + complex long double expected; + int i; + + printf("1..%d\n", ntests * 3); + + for (i = 0; i < ntests; i++) { + __real__ expected = __real__ in = tests[2 * i]; + __imag__ in = tests[2 * i + 1]; + __imag__ expected = -cimag(in); + + assert(fpequal(libcrealf(in), __real__ in)); + assert(fpequal(libcreal(in), __real__ in)); + assert(fpequal(libcreall(in), __real__ in)); + assert(fpequal(libcimagf(in), __imag__ in)); + assert(fpequal(libcimag(in), __imag__ in)); + assert(fpequal(libcimagl(in), __imag__ in)); + + feclearexcept(FE_ALL_EXCEPT); + if (!cfpequal(libconjf(in), expected)) { + printf("not ok %d\t# conjf(%#.2g + %#.2gI): " + "wrong value\n", + 3 * i + 1, creal(in), cimag(in)); + } else if (fetestexcept(FE_ALL_EXCEPT)) { + printf("not ok %d\t# conjf(%#.2g + %#.2gI): " + "threw an exception\n", + 3 * i + 1, creal(in), cimag(in)); + } else { + printf("ok %d\t\t# conjf(%#.2g + %#.2gI)\n", + 3 * i + 1, creal(in), cimag(in)); + } + + feclearexcept(FE_ALL_EXCEPT); + if (!cfpequal(libconj(in), expected)) { + printf("not ok %d\t# conj(%#.2g + %#.2gI): " + "wrong value\n", + 3 * i + 2, creal(in), cimag(in)); + } else if (fetestexcept(FE_ALL_EXCEPT)) { + printf("not ok %d\t# conj(%#.2g + %#.2gI): " + "threw an exception\n", + 3 * i + 2, creal(in), cimag(in)); + } else { + printf("ok %d\t\t# conj(%#.2g + %#.2gI)\n", + 3 * i + 2, creal(in), cimag(in)); + } + + feclearexcept(FE_ALL_EXCEPT); + if (!cfpequal(libconjl(in), expected)) { + printf("not ok %d\t# conjl(%#.2g + %#.2gI): " + "wrong value\n", + 3 * i + 3, creal(in), cimag(in)); + } else if (fetestexcept(FE_ALL_EXCEPT)) { + printf("not ok %d\t# conjl(%#.2g + %#.2gI): " + "threw an exception\n", + 3 * i + 3, creal(in), cimag(in)); + } else { + printf("ok %d\t\t# conjl(%#.2g + %#.2gI)\n", + 3 * i + 3, creal(in), cimag(in)); + } + } + + return (0); +} Copied: head/lib/msun/tests/csqrt_test.c (from r292327, head/tools/regression/lib/msun/test-csqrt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/csqrt_test.c Wed Dec 16 09:11:11 2015 (r292328, copy of r292327, head/tools/regression/lib/msun/test-csqrt.c) @@ -0,0 +1,295 @@ +/*- + * Copyright (c) 2007 David Schultz + * 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. + */ + +/* + * Tests for csqrt{,f}() + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include + +#include "test-utils.h" + +/* + * This is a test hook that can point to csqrtl(), _csqrt(), or to _csqrtf(). + * The latter two convert to float or double, respectively, and test csqrtf() + * and csqrt() with the same arguments. + */ +long double complex (*t_csqrt)(long double complex); + +static long double complex +_csqrtf(long double complex d) +{ + + return (csqrtf((float complex)d)); +} + +static long double complex +_csqrt(long double complex d) +{ + + return (csqrt((double complex)d)); +} + +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. + * Fail an assertion if they differ. + */ +static void +assert_equal(long double complex d1, long double complex d2) +{ + + assert(cfpequal(d1, d2)); +} + +/* + * Test csqrt for some finite arguments where the answer is exact. + * (We do not test if it produces correctly rounded answers when the + * result is inexact, nor do we check whether it throws spurious + * exceptions.) + */ +static void +test_finite() +{ + static const double tests[] = { + /* csqrt(a + bI) = x + yI */ + /* a b x y */ + 0, 8, 2, 2, + 0, -8, 2, -2, + 4, 0, 2, 0, + -4, 0, 0, 2, + 3, 4, 2, 1, + 3, -4, 2, -1, + -3, 4, 1, 2, + -3, -4, 1, -2, + 5, 12, 3, 2, + 7, 24, 4, 3, + 9, 40, 5, 4, + 11, 60, 6, 5, + 13, 84, 7, 6, + 33, 56, 7, 4, + 39, 80, 8, 5, + 65, 72, 9, 4, + 987, 9916, 74, 67, + 5289, 6640, 83, 40, + 460766389075.0, 16762287900.0, 678910, 12345 + }; + /* + * We also test some multiples of the above arguments. This + * array defines which multiples we use. Note that these have + * to be small enough to not cause overflow for float precision + * with all of the constants in the above table. + */ + static const double mults[] = { + 1, + 2, + 3, + 13, + 16, + 0x1.p30, + 0x1.p-30, + }; + + double a, b; + double x, y; + int i, j; + + for (i = 0; i < nitems(tests); i += 4) { + for (j = 0; j < nitems(mults); j++) { + a = tests[i] * mults[j] * mults[j]; + b = tests[i + 1] * mults[j] * mults[j]; + x = tests[i + 2] * mults[j]; + y = tests[i + 3] * mults[j]; + assert(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y)); + } + } + +} + +/* + * Test the handling of +/- 0. + */ +static void +test_zeros() +{ + + assert_equal(t_csqrt(CMPLXL(0.0, 0.0)), CMPLXL(0.0, 0.0)); + assert_equal(t_csqrt(CMPLXL(-0.0, 0.0)), CMPLXL(0.0, 0.0)); + assert_equal(t_csqrt(CMPLXL(0.0, -0.0)), CMPLXL(0.0, -0.0)); + assert_equal(t_csqrt(CMPLXL(-0.0, -0.0)), CMPLXL(0.0, -0.0)); +} + +/* + * Test the handling of infinities when the other argument is not NaN. + */ +static void +test_infinities() +{ + static const double vals[] = { + 0.0, + -0.0, + 42.0, + -42.0, + INFINITY, + -INFINITY, + }; + + int i; + + for (i = 0; i < nitems(vals); i++) { + if (isfinite(vals[i])) { + assert_equal(t_csqrt(CMPLXL(-INFINITY, vals[i])), + CMPLXL(0.0, copysignl(INFINITY, vals[i]))); + assert_equal(t_csqrt(CMPLXL(INFINITY, vals[i])), + CMPLXL(INFINITY, copysignl(0.0, vals[i]))); + } + assert_equal(t_csqrt(CMPLXL(vals[i], INFINITY)), + CMPLXL(INFINITY, INFINITY)); + assert_equal(t_csqrt(CMPLXL(vals[i], -INFINITY)), + CMPLXL(INFINITY, -INFINITY)); + } +} + +/* + * Test the handling of NaNs. + */ +static void +test_nans() +{ + + assert(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY); + assert(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN))))); + + assert(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); + assert(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); + + assert_equal(t_csqrt(CMPLXL(NAN, INFINITY)), + CMPLXL(INFINITY, INFINITY)); + assert_equal(t_csqrt(CMPLXL(NAN, -INFINITY)), + CMPLXL(INFINITY, -INFINITY)); + + assert_equal(t_csqrt(CMPLXL(0.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(-0.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(42.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(-42.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, 0.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, -0.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, 42.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, -42.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, NAN)), CMPLXL(NAN, NAN)); +} + +/* + * Test whether csqrt(a + bi) works for inputs that are large enough to + * cause overflow in hypot(a, b) + a. In this case we are using + * csqrt(115 + 252*I) == 14 + 9*I + * scaled up to near MAX_EXP. + */ +static void +test_overflow(int maxexp) +{ + long double a, b; + long double complex result; + + a = ldexpl(115 * 0x1p-8, maxexp); + b = ldexpl(252 * 0x1p-8, maxexp); + result = t_csqrt(CMPLXL(a, b)); + assert(creall(result) == ldexpl(14 * 0x1p-4, maxexp / 2)); + assert(cimagl(result) == ldexpl(9 * 0x1p-4, maxexp / 2)); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..15\n"); + + /* Test csqrt() */ + t_csqrt = _csqrt; + + test_finite(); + printf("ok 1 - csqrt\n"); + + test_zeros(); + printf("ok 2 - csqrt\n"); + + test_infinities(); + printf("ok 3 - csqrt\n"); + + test_nans(); + printf("ok 4 - csqrt\n"); + + test_overflow(DBL_MAX_EXP); + printf("ok 5 - csqrt\n"); + + /* Now test csqrtf() */ + t_csqrt = _csqrtf; + + test_finite(); + printf("ok 6 - csqrt\n"); + + test_zeros(); + printf("ok 7 - csqrt\n"); + + test_infinities(); + printf("ok 8 - csqrt\n"); + + test_nans(); + printf("ok 9 - csqrt\n"); + + test_overflow(FLT_MAX_EXP); + printf("ok 10 - csqrt\n"); + + /* Now test csqrtl() */ + t_csqrt = csqrtl; + + test_finite(); + printf("ok 11 - csqrt\n"); + + test_zeros(); + printf("ok 12 - csqrt\n"); + + test_infinities(); + printf("ok 13 - csqrt\n"); + + test_nans(); + printf("ok 14 - csqrt\n"); + + test_overflow(LDBL_MAX_EXP); + printf("ok 15 - csqrt\n"); + + return (0); +} Copied: head/lib/msun/tests/fenv_test.c (from r292327, head/tools/regression/lib/msun/test-fenv.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/fenv_test.c Wed Dec 16 09:11:11 2015 (r292328, copy of r292327, head/tools/regression/lib/msun/test-fenv.c) @@ -0,0 +1,576 @@ +/*- + * Copyright (c) 2004 David Schultz + * 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. + */ + +/* + * Test the correctness and C99-compliance of various fenv.h features. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementations are permitted to define additional exception flags + * not specified in the standard, so it is not necessarily true that + * FE_ALL_EXCEPT == ALL_STD_EXCEPT. + */ +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) + +#define NEXCEPTS (sizeof(std_excepts) / sizeof(std_excepts[0])) + +static const int std_excepts[] = { + FE_INVALID, + FE_DIVBYZERO, + FE_OVERFLOW, + FE_UNDERFLOW, + FE_INEXACT, +}; + +/* init_exceptsets() initializes this to the power set of std_excepts[] */ +static int std_except_sets[1 << NEXCEPTS]; + +static void init_exceptsets(void); + +static void test_dfl_env(void); +static void test_fegsetenv(void); +static void test_fegsetexceptflag(void); +static void test_masking(void); +static void test_fegsetround(void); +static void test_feholdupdate(void); +static void test_feraiseexcept(void); +static void test_fetestclearexcept(void); + +static int getround(void); +static void raiseexcept(int excepts); +static void trap_handler(int sig); + +#pragma STDC FENV_ACCESS ON + +int +main(int argc, char *argv[]) +{ + + printf("1..8\n"); + init_exceptsets(); + test_dfl_env(); + printf("ok 1 - fenv\n"); + test_fetestclearexcept(); + printf("ok 2 - fenv\n"); + test_fegsetexceptflag(); + printf("ok 3 - fenv\n"); + test_feraiseexcept(); + printf("ok 4 - fenv\n"); + test_fegsetround(); + printf("ok 5 - fenv\n"); + test_fegsetenv(); + printf("ok 6 - fenv\n"); + test_masking(); + printf("ok 7 - fenv\n"); + test_feholdupdate(); + printf("ok 8 - fenv\n"); + + return (0); +} + +/* + * Initialize std_except_sets[] to the power set of std_excepts[] + */ +void +init_exceptsets(void) +{ + int i, j, sr; + + for (i = 0; i < 1 << NEXCEPTS; i++) { + for (sr = i, j = 0; sr != 0; sr >>= 1, j++) + std_except_sets[i] |= std_excepts[j] & ((~sr & 1) - 1); + } +} + +/* + * This tests checks the default FP environment, so it must be first. + * The memcmp() test below may be too much to ask for, since there + * could be multiple machine-specific default environments. + */ +static void +test_dfl_env(void) +{ +#ifndef NO_STRICT_DFL_ENV + fenv_t env; + + fegetenv(&env); + +#ifdef __amd64__ + /* + * Compare the fields that the AMD [1] and Intel [2] specs say will be + * set once fnstenv returns. + * + * Not all amd64 capable processors implement the fnstenv instruction + * by zero'ing out the env.__x87.__other field (example: AMD Opteron + * 6308). The AMD64/x64 specs aren't explicit on what the + * env.__x87.__other field will contain after fnstenv is executed, so + * the values in env.__x87.__other could be filled with arbitrary + * data depending on how the CPU implements fnstenv. + * + * 1. http://support.amd.com/TechDocs/26569_APM_v5.pdf + * 2. http://www.intel.com/Assets/en_US/PDF/manual/253666.pdf + */ + assert(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, + sizeof(env.__mxcsr)) == 0); + assert(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, + sizeof(env.__x87.__control)) == 0); + assert(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, + sizeof(env.__x87.__status)) == 0); + assert(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, + sizeof(env.__x87.__tag)) == 0); +#else + assert(memcmp(&env, FE_DFL_ENV, sizeof(env)) == 0); +#endif + +#endif + assert(fetestexcept(FE_ALL_EXCEPT) == 0); +} + +/* + * Test fetestexcept() and feclearexcept(). + */ +static void +test_fetestclearexcept(void) +{ + int excepts, i; + + for (i = 0; i < 1 << NEXCEPTS; i++) + assert(fetestexcept(std_except_sets[i]) == 0); + for (i = 0; i < 1 << NEXCEPTS; i++) { + excepts = std_except_sets[i]; + + /* FE_ALL_EXCEPT might be special-cased, as on i386. */ + raiseexcept(excepts); + assert(fetestexcept(excepts) == excepts); + assert(feclearexcept(FE_ALL_EXCEPT) == 0); + assert(fetestexcept(FE_ALL_EXCEPT) == 0); + + raiseexcept(excepts); + assert(fetestexcept(excepts) == excepts); + if ((excepts & (FE_UNDERFLOW | FE_OVERFLOW)) != 0) { + excepts |= FE_INEXACT; + assert((fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT) == + excepts); + } else { + assert(fetestexcept(ALL_STD_EXCEPT) == excepts); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A9A6A49D55; Wed, 16 Dec 2015 13:56:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5AD511AB; Wed, 16 Dec 2015 13:56:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG5isRQ086554; Wed, 16 Dec 2015 05:44:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG5isHx086553; Wed, 16 Dec 2015 05:44:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160544.tBG5isHx086553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 05:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292319 - head/tests/freebsd_test_suite X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:45 -0000 Author: ngie Date: Wed Dec 16 05:44:53 2015 New Revision: 292319 URL: https://svnweb.freebsd.org/changeset/base/292319 Log: Add ATF_REQUIRE_FEATURE and PLAIN_REQUIRE_FEATURE macros for testing for kernel features via the feature_present(3) libcall The semantics are similar to the other macros in the header (skip testcase with ATF macro; exit with appropriate exit code with the PLAIN macro) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tests/freebsd_test_suite/macros.h Modified: head/tests/freebsd_test_suite/macros.h ============================================================================== --- head/tests/freebsd_test_suite/macros.h Wed Dec 16 05:19:07 2015 (r292318) +++ head/tests/freebsd_test_suite/macros.h Wed Dec 16 05:44:53 2015 (r292319) @@ -38,6 +38,13 @@ #include +#define ATF_REQUIRE_FEATURE(_feature_name) do { \ + if (feature_present(_feature_name) == 0) { \ + atf_tc_skip("kernel feature (%s) not present", \ + _feature_name); \ + } \ +} while(0) + #define ATF_REQUIRE_KERNEL_MODULE(_mod_name) do { \ if (modfind(_mod_name) == -1) { \ atf_tc_skip("module %s could not be resolved: %s", \ @@ -45,6 +52,14 @@ } \ } while(0) +#define PLAIN_REQUIRE_FEATURE(_feature_name, _exit_code) do { \ + if (feature_present(_feature_name) == 0) { \ + printf("kernel feature (%s) not present\n", \ + _feature_name); \ + _exit(_exit_code); \ + } \ +} while(0) + #define PLAIN_REQUIRE_KERNEL_MODULE(_mod_name, _exit_code) do { \ if (modfind(_mod_name) == -1) { \ printf("module %s could not be resolved: %s\n", \ From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF84A49E09; Wed, 16 Dec 2015 13:56:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA5813DF; Wed, 16 Dec 2015 13:56:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG5J7F8074768; Wed, 16 Dec 2015 05:19:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG5J7FP074767; Wed, 16 Dec 2015 05:19:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160519.tBG5J7FP074767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 05:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292318 - head/lib/libc/tests/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:50 -0000 Author: ngie Date: Wed Dec 16 05:19:07 2015 New Revision: 292318 URL: https://svnweb.freebsd.org/changeset/base/292318 Log: Add Makefile accidentally missed in r292317 MFC after: 1 week X-MFC with: r292317 Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/resolv/Makefile (contents, props changed) Added: head/lib/libc/tests/resolv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/resolv/Makefile Wed Dec 16 05:19:07 2015 (r292318) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/resolv +BINDIR= ${TESTSDIR} + +FILES+= mach + +ATF_TESTS_C+= resolv_test +#TEST_METADATA.resolv_test= timeout="1800" + +# Note: this test relies on being dynamically linked. You will get a +# spurious PASS for a statically linked test. +LIBADD.resolv_test+= pthread + +.include From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06F5A49CE7; Wed, 16 Dec 2015 13:56:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 831771FAB; Wed, 16 Dec 2015 13:56:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG6LRN5097107; Wed, 16 Dec 2015 06:21:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG6LRff097100; Wed, 16 Dec 2015 06:21:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512160621.tBG6LRff097100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 16 Dec 2015 06:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r292321 - in releng/9.3: . contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns sys/conf 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:40 -0000 Author: delphij Date: Wed Dec 16 06:21:26 2015 New Revision: 292321 URL: https://svnweb.freebsd.org/changeset/base/292321 Log: Fix BIND remote denial of service vulnerability. [SA-15:27] Security: FreeBSD-SA-15:27.bind Security: CVE-2015-8000 Approved by: so Modified: releng/9.3/UPDATING releng/9.3/contrib/bind9/lib/dns/include/dns/message.h releng/9.3/contrib/bind9/lib/dns/message.c releng/9.3/contrib/bind9/lib/dns/resolver.c releng/9.3/contrib/bind9/lib/dns/xfrin.c releng/9.3/sys/conf/newvers.sh Modified: releng/9.3/UPDATING ============================================================================== --- releng/9.3/UPDATING Wed Dec 16 06:10:05 2015 (r292320) +++ releng/9.3/UPDATING Wed Dec 16 06:21:26 2015 (r292321) @@ -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. +20151216 p32 FreeBSD-SA-15:27.bind + Fix BIND remote denial of service vulnerability. [SA-15:27] + 20151205 p31 FreeBSD-SA-15:26.openssl Fix OpenSSL X509_ATTRIBUTE memory leak. [SA-15:26] Modified: releng/9.3/contrib/bind9/lib/dns/include/dns/message.h ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/include/dns/message.h Wed Dec 16 06:10:05 2015 (r292320) +++ releng/9.3/contrib/bind9/lib/dns/include/dns/message.h Wed Dec 16 06:21:26 2015 (r292321) @@ -15,8 +15,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - #ifndef DNS_MESSAGE_H #define DNS_MESSAGE_H 1 @@ -211,6 +209,8 @@ struct dns_message { unsigned int verify_attempted : 1; unsigned int free_query : 1; unsigned int free_saved : 1; + unsigned int tkey : 1; + unsigned int rdclass_set : 1; unsigned int opt_reserved; unsigned int sig_reserved; @@ -1375,6 +1375,15 @@ dns_message_buildopt(dns_message_t *msg, * \li other. */ +void +dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass); +/*%< + * Set the expected class of records in the response. + * + * Requires: + * \li msg be a valid message with parsing intent. + */ + ISC_LANG_ENDDECLS #endif /* DNS_MESSAGE_H */ Modified: releng/9.3/contrib/bind9/lib/dns/message.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/message.c Wed Dec 16 06:10:05 2015 (r292320) +++ releng/9.3/contrib/bind9/lib/dns/message.c Wed Dec 16 06:21:26 2015 (r292321) @@ -436,6 +436,8 @@ msginit(dns_message_t *m) { m->saved.base = NULL; m->saved.length = 0; m->free_saved = 0; + m->tkey = 0; + m->rdclass_set = 0; m->querytsig = NULL; } @@ -1086,13 +1088,19 @@ getquestions(isc_buffer_t *source, dns_m * If this class is different than the one we already read, * this is an error. */ - if (msg->state == DNS_SECTION_ANY) { - msg->state = DNS_SECTION_QUESTION; + if (msg->rdclass_set == 0) { msg->rdclass = rdclass; + msg->rdclass_set = 1; } else if (msg->rdclass != rdclass) DO_FORMERR; /* + * Is this a TKEY query? + */ + if (rdtype == dns_rdatatype_tkey) + msg->tkey = 1; + + /* * Can't ask the same question twice. */ result = dns_message_find(name, rdclass, rdtype, 0, NULL); @@ -1236,12 +1244,12 @@ getsection(isc_buffer_t *source, dns_mes * If there was no question section, we may not yet have * established a class. Do so now. */ - if (msg->state == DNS_SECTION_ANY && + if (msg->rdclass_set == 0 && rdtype != dns_rdatatype_opt && /* class is UDP SIZE */ rdtype != dns_rdatatype_tsig && /* class is ANY */ rdtype != dns_rdatatype_tkey) { /* class is undefined */ msg->rdclass = rdclass; - msg->state = DNS_SECTION_QUESTION; + msg->rdclass_set = 1; } /* @@ -1251,7 +1259,7 @@ getsection(isc_buffer_t *source, dns_mes if (msg->opcode != dns_opcode_update && rdtype != dns_rdatatype_tsig && rdtype != dns_rdatatype_opt - && rdtype != dns_rdatatype_dnskey /* in a TKEY query */ + && rdtype != dns_rdatatype_key /* in a TKEY query */ && rdtype != dns_rdatatype_sig /* SIG(0) */ && rdtype != dns_rdatatype_tkey /* Win2000 TKEY */ && msg->rdclass != dns_rdataclass_any @@ -1259,6 +1267,16 @@ getsection(isc_buffer_t *source, dns_mes DO_FORMERR; /* + * If this is not a TKEY query/response then the KEY + * record's class needs to match. + */ + if (msg->opcode != dns_opcode_update && !msg->tkey && + rdtype == dns_rdatatype_key && + msg->rdclass != dns_rdataclass_any && + msg->rdclass != rdclass) + DO_FORMERR; + + /* * Special type handling for TSIG, OPT, and TKEY. */ if (rdtype == dns_rdatatype_tsig) { @@ -1372,6 +1390,10 @@ getsection(isc_buffer_t *source, dns_mes skip_name_search = ISC_TRUE; skip_type_search = ISC_TRUE; issigzero = ISC_TRUE; + } else { + if (msg->rdclass != dns_rdataclass_any && + msg->rdclass != rdclass) + DO_FORMERR; } } else covers = 0; @@ -1610,6 +1632,7 @@ dns_message_parse(dns_message_t *msg, is msg->counts[DNS_SECTION_ADDITIONAL] = isc_buffer_getuint16(source); msg->header_ok = 1; + msg->state = DNS_SECTION_QUESTION; /* * -1 means no EDNS. @@ -3550,3 +3573,15 @@ dns_message_buildopt(dns_message_t *mess dns_message_puttemprdatalist(message, &rdatalist); return (result); } + +void +dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass) { + + REQUIRE(DNS_MESSAGE_VALID(msg)); + REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTPARSE); + REQUIRE(msg->state == DNS_SECTION_ANY); + REQUIRE(msg->rdclass_set == 0); + + msg->rdclass = rdclass; + msg->rdclass_set = 1; +} Modified: releng/9.3/contrib/bind9/lib/dns/resolver.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/resolver.c Wed Dec 16 06:10:05 2015 (r292320) +++ releng/9.3/contrib/bind9/lib/dns/resolver.c Wed Dec 16 06:21:26 2015 (r292321) @@ -6941,6 +6941,8 @@ resquery_response(isc_task_t *task, isc_ goto done; } + dns_message_setclass(message, fctx->res->rdclass); + result = dns_message_parse(message, &devent->buffer, 0); if (result != ISC_R_SUCCESS) { switch (result) { @@ -7013,6 +7015,12 @@ resquery_response(isc_task_t *task, isc_ */ log_packet(message, ISC_LOG_DEBUG(10), fctx->res->mctx); + if (message->rdclass != fctx->res->rdclass) { + resend = ISC_TRUE; + FCTXTRACE("bad class"); + goto done; + } + /* * Process receive opt record. */ Modified: releng/9.3/contrib/bind9/lib/dns/xfrin.c ============================================================================== --- releng/9.3/contrib/bind9/lib/dns/xfrin.c Wed Dec 16 06:10:05 2015 (r292320) +++ releng/9.3/contrib/bind9/lib/dns/xfrin.c Wed Dec 16 06:21:26 2015 (r292321) @@ -1211,6 +1211,8 @@ xfrin_recv_done(isc_task_t *task, isc_ev msg->tsigctx = xfr->tsigctx; xfr->tsigctx = NULL; + dns_message_setclass(msg, xfr->rdclass); + if (xfr->nmsg > 0) msg->tcp_continuation = 1; Modified: releng/9.3/sys/conf/newvers.sh ============================================================================== --- releng/9.3/sys/conf/newvers.sh Wed Dec 16 06:10:05 2015 (r292320) +++ releng/9.3/sys/conf/newvers.sh Wed Dec 16 06:21:26 2015 (r292321) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p31" +BRANCH="RELEASE-p32" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64B7FA49C7C; Wed, 16 Dec 2015 13:56:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1297C1D66; Wed, 16 Dec 2015 13:56:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG82MuL029026; Wed, 16 Dec 2015 08:02:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG82L06029023; Wed, 16 Dec 2015 08:02:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512160802.tBG82L06029023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 16 Dec 2015 08:02: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: r292322 - in stable/10: share/man/man4 sys/dev/arcmsr 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:35 -0000 Author: delphij Date: Wed Dec 16 08:02:21 2015 New Revision: 292322 URL: https://svnweb.freebsd.org/changeset/base/292322 Log: MFC r259564,259565,291641: Update arcmsr(4) to 1.30.00.00 in order to add support of ARC-1203 SATA RAID controllers. Many thanks to Areca for continuing to support FreeBSD. Modified: stable/10/share/man/man4/arcmsr.4 stable/10/sys/dev/arcmsr/arcmsr.c stable/10/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/arcmsr.4 ============================================================================== --- stable/10/share/man/man4/arcmsr.4 Wed Dec 16 06:21:26 2015 (r292321) +++ stable/10/share/man/man4/arcmsr.4 Wed Dec 16 08:02:21 2015 (r292322) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2013 +.Dd December 18, 2013 .Dt ARCMSR 4 .Os .Sh NAME @@ -143,6 +143,8 @@ ARC-1681 ARC-1880 .It ARC-1882 +.It +ARC-1883 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/10/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/10/sys/dev/arcmsr/arcmsr.c Wed Dec 16 06:21:26 2015 (r292321) +++ stable/10/sys/dev/arcmsr/arcmsr.c Wed Dec 16 08:02:21 2015 (r292322) @@ -75,6 +75,8 @@ ** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 ** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs +** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 +** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ****************************************************************************************** */ @@ -125,15 +127,15 @@ __FBSDID("$FreeBSD$"); ************************************************************************** */ #if __FreeBSD_version >= 500005 - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include #else - #include - #include - #include + #include + #include + #include #endif #if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025 @@ -146,7 +148,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.30.00.00 2015-11-30" #include /* ************************************************************************** @@ -180,8 +182,8 @@ static int arcmsr_iop_message_xfer(struc static int arcmsr_resume(device_t dev); static int arcmsr_suspend(device_t dev); static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb); -static void arcmsr_polling_devmap(void *arg); -static void arcmsr_srb_timeout(void *arg); +static void arcmsr_polling_devmap(void *arg); +static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); @@ -219,11 +221,11 @@ static device_method_t arcmsr_methods[]= { 0, 0 } #endif }; - + static driver_t arcmsr_driver={ "arcmsr", arcmsr_methods, sizeof(struct AdapterControlBlock) }; - + static devclass_t arcmsr_devclass; DRIVER_MODULE(arcmsr, pci, arcmsr_driver, arcmsr_devclass, 0, 0); MODULE_DEPEND(arcmsr, pci, 1, 1, 1); @@ -246,38 +248,38 @@ static struct cdevsw arcmsr_cdevsw={ }; #else #define ARCMSR_CDEV_MAJOR 180 - + static struct cdevsw arcmsr_cdevsw = { - arcmsr_open, /* open */ - arcmsr_close, /* close */ - noread, /* read */ - nowrite, /* write */ - arcmsr_ioctl, /* ioctl */ - nopoll, /* poll */ - nommap, /* mmap */ - nostrategy, /* strategy */ - "arcmsr", /* name */ - ARCMSR_CDEV_MAJOR, /* major */ - nodump, /* dump */ - nopsize, /* psize */ - 0 /* flags */ + arcmsr_open, /* open */ + arcmsr_close, /* close */ + noread, /* read */ + nowrite, /* write */ + arcmsr_ioctl, /* ioctl */ + nopoll, /* poll */ + nommap, /* mmap */ + nostrategy, /* strategy */ + "arcmsr", /* name */ + ARCMSR_CDEV_MAJOR, /* major */ + nodump, /* dump */ + nopsize, /* psize */ + 0 /* flags */ }; #endif /* ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 +#if __FreeBSD_version < 500005 static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) #else - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) #else static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) #endif #endif { - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 struct AdapterControlBlock *acb = dev->si_drv1; #else int unit = dev2unit(dev); @@ -292,17 +294,17 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 +#if __FreeBSD_version < 500005 static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc) #else - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) #else static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) #endif #endif { - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 struct AdapterControlBlock *acb = dev->si_drv1; #else int unit = dev2unit(dev); @@ -317,17 +319,17 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 +#if __FreeBSD_version < 500005 static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc) #else - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #else static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #endif #endif { - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 struct AdapterControlBlock *acb = dev->si_drv1; #else int unit = dev2unit(dev); @@ -346,7 +348,7 @@ static struct cdevsw arcmsr_cdevsw = { static u_int32_t arcmsr_disable_allintr( struct AdapterControlBlock *acb) { u_int32_t intmask_org = 0; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* disable all outbound interrupt */ @@ -355,10 +357,11 @@ static u_int32_t arcmsr_disable_allintr( } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBB_DOORBELL, - 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */ + intmask_org = READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask) + & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, 0); /* disable all interrupt */ } break; case ACB_ADAPTER_TYPE_C: { @@ -383,7 +386,7 @@ static u_int32_t arcmsr_disable_allintr( static void arcmsr_enable_allintr( struct AdapterControlBlock *acb, u_int32_t intmask_org) { u_int32_t mask; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* enable outbound Post Queue, outbound doorbell Interrupt */ @@ -393,9 +396,10 @@ static void arcmsr_enable_allintr( struc } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* enable ARCMSR_IOP2DRV_MESSAGE_CMD_DONE */ mask = (ARCMSR_IOP2DRV_DATA_WRITE_OK|ARCMSR_IOP2DRV_DATA_READ_OK|ARCMSR_IOP2DRV_CDB_DONE|ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/ acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f; } break; @@ -424,7 +428,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { if(CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { @@ -444,12 +448,13 @@ static u_int8_t arcmsr_hbb_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + do { for(Index=0; Index < 100; Index++) { - if(CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT); + if(READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/ + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT); return TRUE; } UDELAY(10000); @@ -465,7 +470,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { if(CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { @@ -485,7 +490,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { if(CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) { @@ -504,7 +509,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_r static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); do { if(arcmsr_hba_wait_msgint_ready(acb)) { @@ -521,9 +526,9 @@ static void arcmsr_flush_hba_cache(struc static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE); + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE); do { if(arcmsr_hbb_wait_msgint_ready(acb)) { break; @@ -539,7 +544,7 @@ static void arcmsr_flush_hbb_cache(struc static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE); do { @@ -557,7 +562,7 @@ static void arcmsr_flush_hbc_cache(struc static void arcmsr_flush_hbd_cache(struct AdapterControlBlock *acb) { int retry_count = 30; /* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); do { if(arcmsr_hbd_wait_msgint_ready(acb)) { @@ -599,7 +604,7 @@ static void arcmsr_flush_adapter_cache(s static int arcmsr_suspend(device_t dev) { struct AdapterControlBlock *acb = device_get_softc(dev); - + /* flush controller */ arcmsr_iop_parking(acb); /* disable all outbound interrupt */ @@ -613,7 +618,7 @@ static int arcmsr_suspend(device_t dev) static int arcmsr_resume(device_t dev) { struct AdapterControlBlock *acb = device_get_softc(dev); - + arcmsr_iop_init(acb); return(0); } @@ -626,7 +631,7 @@ static void arcmsr_async(void *cb_arg, u struct AdapterControlBlock *acb; u_int8_t target_id, target_lun; struct cam_sim *sim; - + sim = (struct cam_sim *) cb_arg; acb =(struct AdapterControlBlock *) cam_sim_softc(sim); switch (code) { @@ -649,7 +654,7 @@ static void arcmsr_async(void *cb_arg, u static void arcmsr_report_sense_info(struct CommandControlBlock *srb) { union ccb *pccb = srb->pccb; - + pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; if(pccb->csio.sense_len) { @@ -677,7 +682,8 @@ static void arcmsr_abort_hba_allcmd(stru */ static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb) { - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD); + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD); if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } @@ -738,12 +744,12 @@ static void arcmsr_srb_complete(struct C { struct AdapterControlBlock *acb = srb->acb; union ccb *pccb = srb->pccb; - + if(srb->srb_flags & SRB_FLAG_TIMER_START) callout_stop(&srb->ccb_callout); if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; - + if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { op = BUS_DMASYNC_POSTREAD; } else { @@ -772,7 +778,7 @@ static void arcmsr_srb_complete(struct C static void arcmsr_report_srb_state(struct AdapterControlBlock *acb, struct CommandControlBlock *srb, u_int16_t error) { int target, lun; - + target = srb->pccb->ccb_h.target_id; lun = srb->pccb->ccb_h.target_lun; if(error == FALSE) { @@ -823,7 +829,7 @@ static void arcmsr_report_srb_state(stru static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, u_int32_t flag_srb, u_int16_t error) { struct CommandControlBlock *srb; - + /* check if command done with no error*/ switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_C: @@ -859,7 +865,7 @@ static void arcmsr_srb_timeout(void *arg struct AdapterControlBlock *acb; int target, lun; u_int8_t cmd; - + target = srb->pccb->ccb_h.target_id; lun = srb->pccb->ccb_h.target_lun; acb = srb->acb; @@ -875,7 +881,7 @@ static void arcmsr_srb_timeout(void *arg } ARCMSR_LOCK_RELEASE(&acb->isr_lock); #ifdef ARCMSR_DEBUG1 - arcmsr_dump_data(acb); + arcmsr_dump_data(acb); #endif } @@ -888,29 +894,29 @@ static void arcmsr_done4abort_postqueue( int i=0; u_int32_t flag_srb; u_int16_t error; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { u_int32_t outbound_intstatus; - + /*clear and abort all outbound posted Q*/ outbound_intstatus = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ while(((flag_srb=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu=(struct HBB_MessageUnit *)acb->pmu; - + /*clear all outbound posted Q*/ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */ for(i=0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { if((flag_srb = phbbmu->done_qbuffer[i]) != 0) { phbbmu->done_qbuffer[i] = 0; - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } phbbmu->post_qbuffer[i] = 0; @@ -920,10 +926,10 @@ static void arcmsr_done4abort_postqueue( } break; case ACB_ADAPTER_TYPE_C: { - + while((CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } } @@ -943,7 +949,7 @@ static void arcmsr_iop_reset(struct Adap struct CommandControlBlock *srb; u_int32_t intmask_org; u_int32_t i=0; - + if(acb->srboutstandingcount>0) { /* disable all outbound interrupt */ intmask_org = arcmsr_disable_allintr(acb); @@ -984,7 +990,7 @@ static void arcmsr_build_srb(struct Comm union ccb *pccb = srb->pccb; struct ccb_scsiio *pcsio = &pccb->csio; u_int32_t arccdbsize = 0x30; - + memset(arcmsr_cdb, 0, sizeof(struct ARCMSR_CDB)); arcmsr_cdb->Bus = 0; arcmsr_cdb->TargetID = pccb->ccb_h.target_id; @@ -996,7 +1002,7 @@ static void arcmsr_build_srb(struct Comm struct AdapterControlBlock *acb = srb->acb; bus_dmasync_op_t op; u_int32_t length, i, cdb_sgcount = 0; - + if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { op = BUS_DMASYNC_PREREAD; } else { @@ -1018,11 +1024,11 @@ static void arcmsr_build_srb(struct Comm arccdbsize += sizeof(struct SG32ENTRY); } else { u_int32_t sg64s_size = 0, tmplength = length; - + while(1) { u_int64_t span4G, length0; struct SG64ENTRY *pdma_sg = (struct SG64ENTRY *)psge; - + span4G = (u_int64_t)address_lo + tmplength; pdma_sg->addresshigh = address_hi; pdma_sg->address = address_lo; @@ -1055,8 +1061,8 @@ static void arcmsr_build_srb(struct Comm } else { arcmsr_cdb->DataLength = 0; } - srb->arc_cdb_size = arccdbsize; - arcmsr_cdb->msgPages = (arccdbsize/256) + ((arccdbsize % 256) ? 1 : 0); + srb->arc_cdb_size = arccdbsize; + arcmsr_cdb->msgPages = (arccdbsize/256) + ((arccdbsize % 256) ? 1 : 0); } /* ************************************************************************** @@ -1066,7 +1072,7 @@ static void arcmsr_post_srb(struct Adapt { u_int32_t cdb_phyaddr_low = (u_int32_t) srb->cdb_phyaddr_low; struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&srb->arcmsr_cdb; - + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD); atomic_add_int(&acb->srboutstandingcount, 1); srb->srb_state = ARCMSR_SRB_START; @@ -1083,7 +1089,7 @@ static void arcmsr_post_srb(struct Adapt case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; int ending_index, index; - + index = phbbmu->postq_index; ending_index = ((index+1) % ARCMSR_MAX_HBB_POSTQUEUE); phbbmu->post_qbuffer[ending_index] = 0; @@ -1095,26 +1101,26 @@ static void arcmsr_post_srb(struct Adapt index++; index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->postq_index = index; - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED); } break; - case ACB_ADAPTER_TYPE_C: { - u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32; + case ACB_ADAPTER_TYPE_C: { + u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32; - arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size; - ccb_post_stamp = (cdb_phyaddr_low | ((arc_cdb_size-1) >> 6) | 1); + arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size; + ccb_post_stamp = (cdb_phyaddr_low | ((arc_cdb_size-1) >> 6) | 1); cdb_phyaddr_hi32 = acb->srb_phyaddr.B.phyadd_high; - if(cdb_phyaddr_hi32) - { - CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32); - CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); - } - else - { - CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); - } - } - break; + if(cdb_phyaddr_hi32) + { + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32); + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); + } + else + { + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); + } + } + break; case ACB_ADAPTER_TYPE_D: { struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; u_int16_t index_stripped; @@ -1152,29 +1158,29 @@ static void arcmsr_post_srb(struct Adapt static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct AdapterControlBlock *acb) { struct QBUFFER *qbuffer=NULL; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { struct HBA_MessageUnit *phbamu = (struct HBA_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbamu->message_rbuffer; } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_rbuffer; } break; case ACB_ADAPTER_TYPE_C: { struct HBC_MessageUnit *phbcmu = (struct HBC_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; } break; case ACB_ADAPTER_TYPE_D: { struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_rbuffer; } break; @@ -1188,29 +1194,29 @@ static struct QBUFFER *arcmsr_get_iop_rq static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct AdapterControlBlock *acb) { struct QBUFFER *qbuffer = NULL; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { struct HBA_MessageUnit *phbamu = (struct HBA_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbamu->message_wbuffer; } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_wbuffer; } break; case ACB_ADAPTER_TYPE_C: { struct HBC_MessageUnit *phbcmu = (struct HBC_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; } break; case ACB_ADAPTER_TYPE_D: { struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_wbuffer; } break; @@ -1230,8 +1236,9 @@ static void arcmsr_iop_message_read(stru } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* let IOP know data has been read */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); } break; case ACB_ADAPTER_TYPE_C: { @@ -1262,11 +1269,12 @@ static void arcmsr_iop_message_wrote(str } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK); } break; case ACB_ADAPTER_TYPE_C: { @@ -1295,7 +1303,7 @@ static void arcmsr_stop_hba_bgrb(struct { acb->acb_flags &= ~ACB_F_MSG_START_BGRB; CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); + 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); @@ -1307,9 +1315,9 @@ static void arcmsr_stop_hba_bgrb(struct */ static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb) { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; acb->acb_flags &= ~ACB_F_MSG_START_BGRB; - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB); if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); @@ -1387,7 +1395,7 @@ static void arcmsr_poll(struct cam_sim * ************************************************************************** */ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb, - struct QBUFFER *prbuffer) { + struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; u_int8_t *buf1 = 0; @@ -1432,13 +1440,13 @@ static u_int32_t arcmsr_Read_iop_rqbuffe ************************************************************************** */ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, - struct QBUFFER *prbuffer) { + struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; u_int8_t *iop_data; u_int32_t iop_len; - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1464,12 +1472,12 @@ static void arcmsr_iop2drv_data_wrote_ha { struct QBUFFER *prbuffer; int my_empty_len; - + /*check this iop data if overflow my rqbuffer*/ ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); prbuffer = arcmsr_get_iop_rqbuffer(acb); my_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) & - (ARCMSR_MAX_QBUFFER-1); + (ARCMSR_MAX_QBUFFER-1); if(my_empty_len >= prbuffer->data_len) { if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; @@ -1489,7 +1497,7 @@ static void arcmsr_Write_data_2iop_wqbuf u_int8_t *buf1 = 0; u_int32_t *iop_data, *buf2 = 0; u_int32_t allxfer_len = 0, data_len; - + if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO); buf2 = (u_int32_t *)buf1; @@ -1532,8 +1540,8 @@ static void arcmsr_Write_data_2iop_wqbuf struct QBUFFER *pwbuffer; u_int8_t *iop_data; int32_t allxfer_len=0; - - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -1585,8 +1593,8 @@ static void arcmsr_rescanLun_cb(struct c /* if (ccb->ccb_h.status != CAM_REQ_CMP) printf("arcmsr_rescanLun_cb: Rescan Target=%x, lun=%x," - "failure status=%x\n", ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, ccb->ccb_h.status); + "failure status=%x\n", ccb->ccb_h.target_id, + ccb->ccb_h.target_lun, ccb->ccb_h.status); else printf("arcmsr_rescanLun_cb: Rescan lun successfully!\n"); */ @@ -1600,7 +1608,7 @@ static void arcmsr_rescan_lun(struct Ada union ccb *ccb; if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) - return; + return; if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -1618,9 +1626,9 @@ static void arcmsr_rescan_lun(struct Ada static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, int lun) { - struct CommandControlBlock *srb; + struct CommandControlBlock *srb; u_int32_t intmask_org; - int i; + int i; /* disable all outbound interrupts */ intmask_org = arcmsr_disable_allintr(acb); @@ -1629,13 +1637,13 @@ static void arcmsr_abort_dr_ccbs(struct srb = acb->psrb_pool[i]; if (srb->srb_state == ARCMSR_SRB_START) { - if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) - { - srb->srb_state = ARCMSR_SRB_ABORTED; + if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) + { + srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; - arcmsr_srb_complete(srb, 1); + arcmsr_srb_complete(srb, 1); printf("arcmsr%d: abort scsi id %d lun %d srb=%p \n", acb->pci_unit, target, lun, srb); - } + } } } /* enable outbound Post Queue, outbound doorbell Interrupt */ @@ -1648,87 +1656,87 @@ static void arcmsr_abort_dr_ccbs(struct static void arcmsr_dr_handle(struct AdapterControlBlock *acb) { u_int32_t devicemap; u_int32_t target, lun; - u_int32_t deviceMapCurrent[4]={0}; - u_int8_t *pDevMap; + u_int32_t deviceMapCurrent[4]={0}; + u_int8_t *pDevMap; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: - devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; - } - break; + devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; case ACB_ADAPTER_TYPE_B: - devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap); - devicemap += 4; - } - break; + devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap); + devicemap += 4; + } + break; case ACB_ADAPTER_TYPE_C: - devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; - } - break; + devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; case ACB_ADAPTER_TYPE_D: - devicemap = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; - } - break; - } - - if(acb->acb_flags & ACB_F_BUS_HANG_ON) + devicemap = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) { - acb->acb_flags &= ~ACB_F_BUS_HANG_ON; + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; } - /* - ** adapter posted CONFIG message - ** copy the new map, note if there are differences with the current map - */ - pDevMap = (u_int8_t *)&deviceMapCurrent[0]; - for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) + break; + } + + if(acb->acb_flags & ACB_F_BUS_HANG_ON) + { + acb->acb_flags &= ~ACB_F_BUS_HANG_ON; + } + /* + ** adapter posted CONFIG message + ** copy the new map, note if there are differences with the current map + */ + pDevMap = (u_int8_t *)&deviceMapCurrent[0]; + for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) + { + if (*pDevMap != acb->device_map[target]) { - if (*pDevMap != acb->device_map[target]) - { - u_int8_t difference, bit_check; + u_int8_t difference, bit_check; - difference = *pDevMap ^ acb->device_map[target]; - for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++) - { - bit_check = (1 << lun); /*check bit from 0....31*/ - if(difference & bit_check) - { - if(acb->device_map[target] & bit_check) - {/* unit departed */ - printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun); - arcmsr_abort_dr_ccbs(acb, target, lun); - arcmsr_rescan_lun(acb, target, lun); - acb->devstate[target][lun] = ARECA_RAID_GONE; - } - else - {/* unit arrived */ - printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun); - arcmsr_rescan_lun(acb, target, lun); - acb->devstate[target][lun] = ARECA_RAID_GOOD; - } - } - } -/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */ - acb->device_map[target] = *pDevMap; + difference = *pDevMap ^ acb->device_map[target]; + for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++) + { + bit_check = (1 << lun); /*check bit from 0....31*/ + if(difference & bit_check) + { + if(acb->device_map[target] & bit_check) + {/* unit departed */ + printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun); + arcmsr_abort_dr_ccbs(acb, target, lun); + arcmsr_rescan_lun(acb, target, lun); + acb->devstate[target][lun] = ARECA_RAID_GONE; + } + else + {/* unit arrived */ + printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun); + arcmsr_rescan_lun(acb, target, lun); + acb->devstate[target][lun] = ARECA_RAID_GOOD; + } + } } - pDevMap++; +/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */ + acb->device_map[target] = *pDevMap; } + pDevMap++; + } } /* ************************************************************************** @@ -1748,9 +1756,10 @@ static void arcmsr_hba_message_isr(struc */ static void arcmsr_hbb_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* clear interrupts */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN); + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN); outbound_message = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0]); if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); @@ -1785,8 +1794,8 @@ static void arcmsr_hbd_message_isr(struc */ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_doorbell; - + u_int32_t doorbell_status; + /* ******************************************************************* ** Maybe here we need to check wrqbuffer_lock is lock or not @@ -1794,14 +1803,12 @@ static void arcmsr_hba_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_doorbell = CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_doorbell); - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_doorbell, outbound_doorbell); /* clear doorbell interrupt */ - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135E6A49D35; Wed, 16 Dec 2015 13:56:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79B31133; Wed, 16 Dec 2015 13:56:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG6A7vW094132; Wed, 16 Dec 2015 06:10:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG6A5ER094107; Wed, 16 Dec 2015 06:10:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512160610.tBG6A5ER094107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 16 Dec 2015 06:10:05 +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: r292320 - in stable/9/contrib/bind9: . doc/arm lib/dns lib/dns/include/dns lib/lwres/man 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:44 -0000 Author: delphij Date: Wed Dec 16 06:10:05 2015 New Revision: 292320 URL: https://svnweb.freebsd.org/changeset/base/292320 Log: MFV r292314: Update BIND to 9.9.8-P2. See release notes for notable changes: https://kb.isc.org/article/AA-01326 Note this is a direct commit to stable/9 as BIND is no longer in head. Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/README stable/9/contrib/bind9/configure.in stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html stable/9/contrib/bind9/doc/arm/Bv9ARM.html stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf stable/9/contrib/bind9/doc/arm/man.arpaname.html stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html stable/9/contrib/bind9/doc/arm/man.dig.html stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html stable/9/contrib/bind9/doc/arm/man.dnssec-keygen.html stable/9/contrib/bind9/doc/arm/man.dnssec-revoke.html stable/9/contrib/bind9/doc/arm/man.dnssec-settime.html stable/9/contrib/bind9/doc/arm/man.dnssec-signzone.html stable/9/contrib/bind9/doc/arm/man.dnssec-verify.html stable/9/contrib/bind9/doc/arm/man.genrandom.html stable/9/contrib/bind9/doc/arm/man.host.html stable/9/contrib/bind9/doc/arm/man.isc-hmac-fixup.html stable/9/contrib/bind9/doc/arm/man.named-checkconf.html stable/9/contrib/bind9/doc/arm/man.named-checkzone.html stable/9/contrib/bind9/doc/arm/man.named-journalprint.html stable/9/contrib/bind9/doc/arm/man.named.html stable/9/contrib/bind9/doc/arm/man.nsec3hash.html stable/9/contrib/bind9/doc/arm/man.nsupdate.html stable/9/contrib/bind9/doc/arm/man.rndc-confgen.html stable/9/contrib/bind9/doc/arm/man.rndc.conf.html stable/9/contrib/bind9/doc/arm/man.rndc.html stable/9/contrib/bind9/doc/arm/notes.html stable/9/contrib/bind9/doc/arm/notes.pdf stable/9/contrib/bind9/doc/arm/notes.xml stable/9/contrib/bind9/lib/dns/api stable/9/contrib/bind9/lib/dns/include/dns/message.h stable/9/contrib/bind9/lib/dns/message.c stable/9/contrib/bind9/lib/dns/opensslrsa_link.c stable/9/contrib/bind9/lib/dns/resolver.c stable/9/contrib/bind9/lib/dns/rootns.c stable/9/contrib/bind9/lib/dns/xfrin.c stable/9/contrib/bind9/lib/lwres/man/lwres.html stable/9/contrib/bind9/lib/lwres/man/lwres_buffer.html stable/9/contrib/bind9/lib/lwres/man/lwres_config.html stable/9/contrib/bind9/lib/lwres/man/lwres_context.html stable/9/contrib/bind9/lib/lwres/man/lwres_gabn.html stable/9/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html stable/9/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html stable/9/contrib/bind9/lib/lwres/man/lwres_gethostent.html stable/9/contrib/bind9/lib/lwres/man/lwres_getipnode.html stable/9/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html stable/9/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html stable/9/contrib/bind9/lib/lwres/man/lwres_gnba.html stable/9/contrib/bind9/lib/lwres/man/lwres_hstrerror.html stable/9/contrib/bind9/lib/lwres/man/lwres_inetntop.html stable/9/contrib/bind9/lib/lwres/man/lwres_noop.html stable/9/contrib/bind9/lib/lwres/man/lwres_packet.html stable/9/contrib/bind9/lib/lwres/man/lwres_resutil.html stable/9/contrib/bind9/version Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/CHANGES Wed Dec 16 06:10:05 2015 (r292320) @@ -1,3 +1,21 @@ + --- 9.9.8-P2 released --- + +4270. [security] Update allowed OpenSSL versions as named is + potentially vulnerable to CVE-2015-3193. + +4261. [maint] H.ROOT-SERVERS.NET is 198.97.190.53 and 2001:500:1::53. + [RT #40556] + +4260. [security] Insufficient testing when parsing a message allowed + records with an incorrect class to be be accepted, + triggering a REQUIRE failure when those records + were subsequently cached. (CVE-2015-8000) [RT #40987] + +4253. [security] Address fetch context reference count handling error + on socket error. (CVE-2015-8461) [RT#40945] + + --- 9.9.8-P1 (withdrawn) --- + --- 9.9.8 released --- --- 9.9.8rc1 released --- Modified: stable/9/contrib/bind9/README ============================================================================== --- stable/9/contrib/bind9/README Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/README Wed Dec 16 06:10:05 2015 (r292320) @@ -51,6 +51,17 @@ BIND 9 For up-to-date release notes and errata, see http://www.isc.org/software/bind9/releasenotes +BIND 9.9.8-P2 + + BIND 9.9.8-P2 is a security release addressing the flaws + described in CVE-2015-3193 (OpenSSL), CVE-2015-8000 and + CVE-2015-8461. + +BIND 9.9.8-P1 + + BIND 9.9.8-P1 was incomplete and was withdrawn prior to + publication. + BIND 9.9.8 BIND 9.9.8 is a maintenance release and addresses bugs Modified: stable/9/contrib/bind9/configure.in ============================================================================== --- stable/9/contrib/bind9/configure.in Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/configure.in Wed Dec 16 06:10:05 2015 (r292320) @@ -810,12 +810,17 @@ yes|'') int main() { if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL && OPENSSL_VERSION_NUMBER < 0x00908000L) || - OPENSSL_VERSION_NUMBER >= 0x0090804fL) + (OPENSSL_VERSION_NUMBER >= 0x0090804fL && + OPENSSL_VERSION_NUMBER < 0x10002000L) || + OPENSSL_VERSION_NUMBER >= 0x1000205fL) return (0); printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n", OPENSSL_VERSION_NUMBER); printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n" - "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n"); + "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n" + "Require OPENSSL_VERSION_NUMBER 0x1000000f or greater (1.0.0)\n" + "Require OPENSSL_VERSION_NUMBER 0x1000100f or greater (1.0.1)\n" + "Require OPENSSL_VERSION_NUMBER 0x1000205f or greater (1.0.2e)\n\n"); return (1); } ], @@ -4282,15 +4287,16 @@ WARNING Your OpenSSL crypto libr WARNING one or more of the the following known security WARNING WARNING flaws: WARNING WARNING WARNING -WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937 and WARNING -WARNING CVE-2006-2940. WARNING +WARNING CAN-2002-0659, CAN-2006-4339, CVE-2006-2937, WARNING +WARNING CVE-2006-2940 and CVE-2015-3193. WARNING WARNING WARNING WARNING It is recommended that you upgrade to OpenSSL WARNING -WARNING version 0.9.8d/0.9.7l (or greater). WARNING +WARNING version 1.0.2e/1.0.1/1.0.0/0.9.9/0.9.8d/0.9.7l WARNING +WARNING (or greater). WARNING WARNING WARNING WARNING You can disable this warning by specifying: WARNING WARNING WARNING -WARNING --disable-openssl-version-check WARNING +WARNING --disable-openssl-version-check WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch01.html Wed Dec 16 06:10:05 2015 (r292320) @@ -556,6 +556,6 @@
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch02.html Wed Dec 16 06:10:05 2015 (r292320) @@ -154,6 +154,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch03.html Wed Dec 16 06:10:05 2015 (r292320) @@ -665,6 +665,6 @@ controls { -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch04.html Wed Dec 16 06:10:05 2015 (r292320) @@ -1935,6 +1935,6 @@ $ORIGIN 0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2. -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch05.html Wed Dec 16 06:10:05 2015 (r292320) @@ -139,6 +139,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch06.html Wed Dec 16 06:10:05 2015 (r292320) @@ -12177,6 +12177,6 @@ HOST-127.EXAMPLE. MX 0 . -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch07.html Wed Dec 16 06:10:05 2015 (r292320) @@ -247,6 +247,6 @@ zone "example.com" { -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch08.html Wed Dec 16 06:10:05 2015 (r292320) @@ -135,6 +135,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch09.html Wed Dec 16 06:10:05 2015 (r292320) @@ -45,7 +45,7 @@

-Release Notes for BIND Version 9.9.8

+Release Notes for BIND Version 9.9.8-P2

Introduction

- This document summarizes changes since the last production release - of BIND on the corresponding major release branch. + This document summarizes changes since BIND 9.9.8: +

+

+ BIND 9.9.8-P2 addresses security issues described in CVE-2015-3193 + (OpenSSL), CVE-2015-8000 and CVE-2015-8461. +

+

+ BIND 9.9.8-P1 was incomplete and was withdrawn prior to publication.

@@ -85,161 +91,39 @@ Security Fixes
  • - An incorrect boundary check in the OPENPGPKEY rdatatype - could trigger an assertion failure. This flaw is disclosed - in CVE-2015-5986. [RT #40286] + Named is potentially vulnerable to the OpenSSL vulnerabilty + described in CVE-2015-3193.

  • -
  • -

    - A buffer accounting error could trigger an assertion failure - when parsing certain malformed DNSSEC keys. -

    -

    - This flaw was discovered by Hanno B쎶ck of the Fuzzing - Project, and is disclosed in CVE-2015-5722. [RT #40212] -

    -
  • -
  • -

    - A specially crafted query could trigger an assertion failure - in message.c. -

    -

    - This flaw was discovered by Jonathan Foote, and is disclosed - in CVE-2015-5477. [RT #40046] -

    -
  • -
  • -

    - On servers configured to perform DNSSEC validation, an - assertion failure could be triggered on answers from - a specially configured server. -

    -

    - This flaw was discovered by Breno Silveira Soares, and is - disclosed in CVE-2015-4620. [RT #39795] -

    -
  • -
- -
-

-New Features

-
    -
  • -

    - New quotas have been added to limit the queries that are - sent by recursive resolvers to authoritative servers - experiencing denial-of-service attacks. When configured, - these options can both reduce the harm done to authoritative - servers and also avoid the resource exhaustion that can be - experienced by recursives when they are being used as a - vehicle for such an attack. -

    -

    - NOTE: These options are not available by default; use - configure --enable-fetchlimit to include - them in the build. -

    -
    • - fetches-per-server limits the number of - simultaneous queries that can be sent to any single - authoritative server. The configured value is a starting - point; it is automatically adjusted downward if the server is - partially or completely non-responsive. The algorithm used to - adjust the quota can be configured via the - fetch-quota-params option. -

    • -
    • - fetches-per-zone limits the number of - simultaneous queries that can be sent for names within a - single domain. (Note: Unlike "fetches-per-server", this - value is not self-tuning.) -

    • -
    -

    - Statistics counters have also been added to track the number - of queries affected by these quotas. -

    -
  • -
  • - An --enable-querytrace configure switch is - now available to enable very verbose query tracelogging. This - option can only be set at compile time. This option has a - negative performance impact and should be used only for - debugging. + Incorrect reference counting could result in an INSIST + failure if a socket error occurred while performing a + lookup. This flaw is disclosed in CVE-2015-8461. [RT#40945]

  • - EDNS COOKIE options content is now displayed as - "COOKIE: <hexvalue>". + Insufficient testing when parsing a message allowed + records with an incorrect class to be be accepted, + triggering a REQUIRE failure when those records + were subsequently cached. This flaw is disclosed + in CVE-2015-8000. [RT #40987]

+New Features

+
  • None

+
+
+

Feature Changes

-
    -
  • - Large inline-signing changes should be less disruptive. - Signature generation is now done incrementally; the number - of signatures to be generated in each quantum is controlled - by "sig-signing-signatures number;". - [RT #37927] -

  • -
  • - Retrieving the local port range from net.ipv4.ip_local_port_range - on Linux is now supported. -

  • -
  • - Active Directory names of the form gc._msdcs.<forest> are - now accepted as valid hostnames when using the - check-names option. <forest> is still - restricted to letters, digits and hyphens. -

  • -
  • - Names containing rich text are now accepted as valid - hostnames in PTR records in DNS-SD reverse lookup zones, - as specified in RFC 6763. [RT #37889] -

  • -
+
  • + Updated the compiled in addresses for H.ROOT-SERVERS.NET. +

Bug Fixes

-
    -
  • - Asynchronous zone loads were not handled correctly when the - zone load was already in progress; this could trigger a crash - in zt.c. [RT #37573] -

  • -
  • - A race during shutdown or reconfiguration could - cause an assertion failure in mem.c. [RT #38979] -

  • -
  • - Some answer formatting options didn't work correctly with - dig +short. [RT #39291] -

  • -
  • - Malformed records of some types, including NSAP and UNSPEC, - could trigger assertion failures when loading text zone files. - [RT #40274] [RT #40285] -

  • -
  • - Fixed a possible crash in ratelimiter.c caused by NOTIFY - messages being removed from the wrong rate limiter queue. - [RT #40350] -

  • -
  • - The default rrset-order of random - was inconsistently applied. [RT #40456] -

  • -
  • - BADVERS responses from broken authoritative name servers were - not handled correctly. [RT #40427] -

  • -
+
  • None

@@ -279,6 +163,6 @@

-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch10.html Wed Dec 16 06:10:05 2015 (r292320) @@ -163,6 +163,6 @@
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch11.html Wed Dec 16 06:10:05 2015 (r292320) @@ -514,6 +514,6 @@
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch12.html Wed Dec 16 06:10:05 2015 (r292320) @@ -47,13 +47,13 @@
BIND 9 DNS Library Support
-
Prerequisite
-
Compilation
-
Installation
-
Known Defects/Restrictions
-
The dns.conf File
-
Sample Applications
-
Library References
+
Prerequisite
+
Compilation
+
Installation
+
Known Defects/Restrictions
+
The dns.conf File
+
Sample Applications
+
Library References
@@ -89,7 +89,7 @@

-Prerequisite

+Prerequisite

GNU make is required to build the export libraries (other part of BIND 9 can still be built with other types of make). In the reminder of this document, "make" means GNU make. Note that @@ -98,7 +98,7 @@

-Compilation

+Compilation
 $ ./configure --enable-exportlib [other flags]
 $ make
@@ -113,7 +113,7 @@ $ make
 

-Installation

+Installation
 $ cd lib/export
 $ make install
@@ -135,7 +135,7 @@ $ make i
 
 

-Known Defects/Restrictions

+Known Defects/Restrictions
  • Currently, win32 is not supported for the export library. (Normal BIND 9 application can be built as @@ -175,7 +175,7 @@ $ make

    -The dns.conf File

    +The dns.conf File

The IRS library supports an "advanced" configuration file related to the DNS library for configuration parameters that would be beyond the capability of the @@ -193,14 +193,14 @@ $ make

-Sample Applications

+Sample Applications

Some sample application programs using this API are provided for reference. The following is a brief description of these applications.

-sample: a simple stub resolver utility

+sample: a simple stub resolver utility

It sends a query of a given name (of a given optional RR type) to a specified recursive server, and prints the result as a list of @@ -264,7 +264,7 @@ $ make

-sample-async: a simple stub resolver, working asynchronously

+sample-async: a simple stub resolver, working asynchronously

Similar to "sample", but accepts a list of (query) domain names as a separate file and resolves the names @@ -305,7 +305,7 @@ $ make

-sample-request: a simple DNS transaction client

+sample-request: a simple DNS transaction client

It sends a query to a specified server, and prints the response with minimal processing. It doesn't act as a @@ -346,7 +346,7 @@ $ make

-sample-gai: getaddrinfo() and getnameinfo() test code

+sample-gai: getaddrinfo() and getnameinfo() test code

This is a test program to check getaddrinfo() and getnameinfo() behavior. It takes a @@ -363,7 +363,7 @@ $ make

-sample-update: a simple dynamic update client program

+sample-update: a simple dynamic update client program

It accepts a single update command as a command-line argument, sends an update request message to the @@ -458,7 +458,7 @@ $ sample

-nsprobe: domain/name server checker in terms of RFC 4074

+nsprobe: domain/name server checker in terms of RFC 4074

It checks a set of domains to see the name servers of the domains behave @@ -515,7 +515,7 @@ $ sample

-Library References

+Library References

As of this writing, there is no formal "manual" of the libraries, except this document, header files (some of them provide pretty detailed explanations), and sample application @@ -540,6 +540,6 @@ $ sample -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.ch13.html Wed Dec 16 06:10:05 2015 (r292320) @@ -140,6 +140,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/Bv9ARM.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/Bv9ARM.html Wed Dec 16 06:10:05 2015 (r292320) @@ -41,7 +41,7 @@

BIND 9 Administrator Reference Manual

-

BIND Version 9.9.8

+

BIND Version 9.9.8-P2

@@ -234,7 +234,7 @@
A. Release Notes
-
Release Notes for BIND Version 9.9.8
+
Release Notes for BIND Version 9.9.8-P2
Introduction
Download
@@ -262,13 +262,13 @@
BIND 9 DNS Library Support
-
Prerequisite
-
Compilation
-
Installation
-
Known Defects/Restrictions
-
The dns.conf File
-
Sample Applications
-
Library References
+
Prerequisite
+
Compilation
+
Installation
+
Known Defects/Restrictions
+
The dns.conf File
+
Sample Applications
+
Library References
I. Manual pages
@@ -365,6 +365,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/Bv9ARM.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/9/contrib/bind9/doc/arm/man.arpaname.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.arpaname.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.arpaname.html Wed Dec 16 06:10:05 2015 (r292320) @@ -50,20 +50,20 @@

arpaname {ipaddress ...}

-

DESCRIPTION

+

DESCRIPTION

arpaname translates IP addresses (IPv4 and IPv6) to the corresponding IN-ADDR.ARPA or IP6.ARPA names.

-

SEE ALSO

+

SEE ALSO

BIND 9 Administrator Reference Manual.

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -87,6 +87,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.ddns-confgen.html Wed Dec 16 06:10:05 2015 (r292320) @@ -50,7 +50,7 @@

ddns-confgen [-a algorithm] [-h] [-k keyname] [-r randomfile] [ -s name | -z zone ] [-q] [name]

-

DESCRIPTION

+

DESCRIPTION

ddns-confgen generates a key for use by nsupdate and named. It simplifies configuration @@ -77,7 +77,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm

@@ -144,7 +144,7 @@

-

SEE ALSO

+

SEE ALSO

nsupdate(1), named.conf(5), named(8), @@ -152,7 +152,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -176,6 +176,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dig.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dig.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.dig.html Wed Dec 16 06:10:05 2015 (r292320) @@ -52,7 +52,7 @@

dig [global-queryopt...] [query...]

-

DESCRIPTION

+

DESCRIPTION

dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and @@ -99,7 +99,7 @@

-

SIMPLE USAGE

+

SIMPLE USAGE

A typical invocation of dig looks like:

@@ -152,7 +152,7 @@

-

OPTIONS

+

OPTIONS

-4

@@ -280,7 +280,7 @@

-

QUERY OPTIONS

+

QUERY OPTIONS

dig provides a number of query options which affect the way in which lookups are made and the results displayed. Some of @@ -649,7 +649,7 @@

-

MULTIPLE QUERIES

+

MULTIPLE QUERIES

The BIND 9 implementation of dig supports @@ -695,7 +695,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

IDN SUPPORT

+

IDN SUPPORT

If dig has been built with IDN (internationalized domain name) support, it can accept and display non-ASCII domain names. @@ -709,14 +709,14 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

FILES

+

FILES

/etc/resolv.conf

${HOME}/.digrc

-

SEE ALSO

+

SEE ALSO

host(1), named(8), dnssec-keygen(8), @@ -724,7 +724,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc

-

BUGS

+

BUGS

There are probably too many query options.

@@ -747,6 +747,6 @@ dig +qr www.isc.org any -x 127.0.0.1 isc
-

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-checkds.html Wed Dec 16 06:10:05 2015 (r292320) @@ -51,7 +51,7 @@

dnssec-dsfromkey [-l domain] [-f file] [-d dig path] [-D dsfromkey path] {zone}

-

DESCRIPTION

+

DESCRIPTION

dnssec-checkds verifies the correctness of Delegation Signer (DS) or DNSSEC Lookaside Validation (DLV) resource records for keys in a specified @@ -59,7 +59,7 @@

-

OPTIONS

+

OPTIONS

-f file

@@ -88,14 +88,14 @@

-

SEE ALSO

+

SEE ALSO

dnssec-dsfromkey(8), dnssec-keygen(8), dnssec-signzone(8),

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -118,6 +118,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-coverage.html Wed Dec 16 06:10:05 2015 (r292320) @@ -50,7 +50,7 @@

dnssec-coverage [-K directory] [-f file] [-d DNSKEY TTL] [-m max TTL] [-r interval] [-c compilezone path] [zone]

-

DESCRIPTION

+

DESCRIPTION

dnssec-coverage verifies that the DNSSEC keys for a given zone or a set of zones have timing metadata set properly to ensure no future lapses in DNSSEC @@ -78,7 +78,7 @@

-

OPTIONS

+

OPTIONS

-f file

@@ -168,7 +168,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-checkds(8), dnssec-dsfromkey(8), @@ -177,7 +177,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -201,6 +201,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html Wed Dec 16 06:10:05 2015 (r292320) @@ -52,14 +52,14 @@

dnssec-dsfromkey [-h] [-V]

-

DESCRIPTION

+

DESCRIPTION

dnssec-dsfromkey outputs the Delegation Signer (DS) resource record (RR), as defined in RFC 3658 and RFC 4509, for the given key(s).

-

OPTIONS

+

OPTIONS

-1

@@ -150,7 +150,7 @@

-

EXAMPLE

+

EXAMPLE

To build the SHA-256 DS RR from the Kexample.com.+003+26160 @@ -165,7 +165,7 @@

-

FILES

+

FILES

The keyfile can be designed by the key identification Knnnn.+aaa+iiiii or the full file name @@ -179,13 +179,13 @@

-

CAVEAT

+

CAVEAT

A keyfile error can give a "file not found" even if the file exists.

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -195,7 +195,7 @@

-

AUTHOR

+

AUTHOR

Internet Systems Consortium

@@ -219,6 +219,6 @@ -

BIND 9.9.8 (Extended Support Version)

+

BIND 9.9.8-P2 (Extended Support Version)

Modified: stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html ============================================================================== --- stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html Wed Dec 16 05:44:53 2015 (r292319) +++ stable/9/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html Wed Dec 16 06:10:05 2015 (r292320) @@ -50,7 +50,7 @@

dnssec-keyfromlabel {-l label} [-3] [-a algorithm] [-A date/offset] [-c class] [-D date/offset] [-E engine] [-f flag] [-G] [-I date/offset] [-i interval] [-k] [-K directory] [-L ttl] [-n nametype] [-P date/offset] [-p protocol] [-R date/offset] [-S key] [-t type] [-v level] [-V] [-y] {name}

-

DESCRIPTION

+

DESCRIPTION

dnssec-keyfromlabel generates a key pair of files that referencing a key object stored in a cryptographic hardware service module (HSM). The private key @@ -66,7 +66,7 @@

-

OPTIONS

+

OPTIONS

-a algorithm
@@ -209,7 +209,7 @@
-

TIMING OPTIONS

+

TIMING OPTIONS

Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS. If the argument begins with a '+' or '-', it is interpreted as @@ -281,7 +281,7 @@

-

GENERATED KEY FILES

+

GENERATED KEY FILES

When dnssec-keyfromlabel completes successfully, @@ -320,7 +320,7 @@

-

SEE ALSO

+

SEE ALSO

dnssec-keygen(8), dnssec-signzone(8), BIND 9 Administrator Reference Manual, @@ -328,7 +328,7 @@

-

AUTHOR

+

AUTHOR

*** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FC3FA49C37; Wed, 16 Dec 2015 13:56:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D50011C89; Wed, 16 Dec 2015 13:56:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG894M5029297; Wed, 16 Dec 2015 08:09:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG8935M029291; Wed, 16 Dec 2015 08:09:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160809.tBG8935M029291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 08:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292323 - in head: etc/mtree lib/libc/tests/nss tools/regression/lib/libc/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:33 -0000 Author: ngie Date: Wed Dec 16 08:09:03 2015 New Revision: 292323 URL: https://svnweb.freebsd.org/changeset/base/292323 Log: Integrate tools/regression/lib/libc/nss into the FreeBSD test suite as lib/libc/tests/nss - Convert the testcases to ATF - Do some style(9) cleanups: -- Sort headers -- Apply indentation fixes -- Remove superfluous parentheses - Explicitly print out debug printfs for use with `kyua {debug,report}`; for items that were overly noisy, they've been put behind #ifdef DEBUG conditionals - Fix some format strings MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/nss/ head/lib/libc/tests/nss/Makefile - copied, changed from r292322, head/tools/regression/lib/libc/nss/Makefile head/lib/libc/tests/nss/getaddrinfo_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getaddr.c head/lib/libc/tests/nss/getgr_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getgr.c head/lib/libc/tests/nss/gethostby_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-gethostby.c head/lib/libc/tests/nss/getproto_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getproto.c head/lib/libc/tests/nss/getpw_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getpw.c head/lib/libc/tests/nss/getrpc_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getrpc.c head/lib/libc/tests/nss/getserv_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getserv.c head/lib/libc/tests/nss/getusershell_test.c - copied, changed from r292322, head/tools/regression/lib/libc/nss/test-getusershell.c head/lib/libc/tests/nss/testutil.h - copied, changed from r292322, head/tools/regression/lib/libc/nss/testutil.h Deleted: head/tools/regression/lib/libc/nss/ Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Dec 16 08:02:21 2015 (r292322) +++ head/etc/mtree/BSD.tests.dist Wed Dec 16 08:09:03 2015 (r292323) @@ -271,6 +271,8 @@ .. .. .. + nss + .. regex data .. Copied and modified: head/lib/libc/tests/nss/Makefile (from r292322, head/tools/regression/lib/libc/nss/Makefile) ============================================================================== --- head/tools/regression/lib/libc/nss/Makefile Wed Dec 16 08:02:21 2015 (r292322, copy source) +++ head/lib/libc/tests/nss/Makefile Wed Dec 16 08:09:03 2015 (r292323) @@ -1,12 +1,22 @@ # $FreeBSD$ -TESTS= test-getaddr test-getgr test-gethostby test-getpw test-getproto\ - test-getrpc test-getserv test-getusershell -CFLAGS+= -g -Wall - -.PHONY: tests -tests: ${TESTS} - -.PHONY: clean -clean: - -rm -f ${TESTS} +TESTSDIR= ${TESTSBASE}/lib/libc/nss +BINDIR= ${TESTSDIR} + +.PATH: ${.CURDIR:H}/resolv + +FILES+= mach + +CFLAGS+= -I${SRCTOP}/tests + +ATF_TESTS_C+= getaddrinfo_test +ATF_TESTS_C+= getgr_test +ATF_TESTS_C+= gethostby_test +TEST_METADATA.gethostby_test= timeout="1200" +ATF_TESTS_C+= getpw_test +ATF_TESTS_C+= getproto_test +ATF_TESTS_C+= getrpc_test +ATF_TESTS_C+= getserv_test +ATF_TESTS_C+= getusershell_test + +.include Copied and modified: head/lib/libc/tests/nss/getaddrinfo_test.c (from r292322, head/tools/regression/lib/libc/nss/test-getaddr.c) ============================================================================== --- head/tools/regression/lib/libc/nss/test-getaddr.c Wed Dec 16 08:02:21 2015 (r292322, copy source) +++ head/lib/libc/tests/nss/getaddrinfo_test.c Wed Dec 16 08:09:03 2015 (r292323) @@ -28,11 +28,10 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include +#include +#include #include -#include #include #include #include @@ -41,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include + +#include "freebsd_test_suite/macros.h" #include "testutil.h" enum test_methods { @@ -48,7 +51,6 @@ enum test_methods { TEST_BUILD_SNAPSHOT }; -static int debug = 0; static struct addrinfo hints; static enum test_methods method = TEST_GETADDRINFO; @@ -59,7 +61,6 @@ DECLARE_2PASS_TEST(addrinfo) static void clone_addrinfo(struct addrinfo *, struct addrinfo const *); static int compare_addrinfo(struct addrinfo *, struct addrinfo *, void *); static void dump_addrinfo(struct addrinfo *); -static void free_addrinfo(struct addrinfo *); static void sdump_addrinfo(struct addrinfo *, char *, size_t); @@ -70,23 +71,23 @@ IMPLEMENT_2PASS_TEST(addrinfo) static void clone_addrinfo(struct addrinfo *dest, struct addrinfo const *src) { - assert(dest != NULL); - assert(src != NULL); + + ATF_REQUIRE(dest != NULL); + ATF_REQUIRE(src != NULL); memcpy(dest, src, sizeof(struct addrinfo)); if (src->ai_canonname != NULL) dest->ai_canonname = strdup(src->ai_canonname); if (src->ai_addr != NULL) { - dest->ai_addr = (struct sockaddr *)malloc(src->ai_addrlen); - assert(dest->ai_addr != NULL); + dest->ai_addr = malloc(src->ai_addrlen); + ATF_REQUIRE(dest->ai_addr != NULL); memcpy(dest->ai_addr, src->ai_addr, src->ai_addrlen); } if (src->ai_next != NULL) { - dest->ai_next = (struct addrinfo *)malloc( - sizeof(struct addrinfo)); - assert(dest->ai_next != NULL); + dest->ai_next = malloc(sizeof(struct addrinfo)); + ATF_REQUIRE(dest->ai_next != NULL); clone_addrinfo(dest->ai_next, src->ai_next); } } @@ -94,29 +95,30 @@ clone_addrinfo(struct addrinfo *dest, st static int compare_addrinfo_(struct addrinfo *ai1, struct addrinfo *ai2) { + if ((ai1 == NULL) || (ai2 == NULL)) return (-1); - if ((ai1->ai_flags != ai2->ai_flags) || - (ai1->ai_family != ai2->ai_family) || - (ai1->ai_socktype != ai2->ai_socktype) || - (ai1->ai_protocol != ai2->ai_protocol) || - (ai1->ai_addrlen != ai2->ai_addrlen) || - (((ai1->ai_addr == NULL) || (ai2->ai_addr == NULL)) && - (ai1->ai_addr != ai2->ai_addr)) || - (((ai1->ai_canonname == NULL) || (ai2->ai_canonname == NULL)) && - (ai1->ai_canonname != ai2->ai_canonname))) + if (ai1->ai_flags != ai2->ai_flags || + ai1->ai_family != ai2->ai_family || + ai1->ai_socktype != ai2->ai_socktype || + ai1->ai_protocol != ai2->ai_protocol || + ai1->ai_addrlen != ai2->ai_addrlen || + ((ai1->ai_addr == NULL || ai2->ai_addr == NULL) && + ai1->ai_addr != ai2->ai_addr) || + ((ai1->ai_canonname == NULL || ai2->ai_canonname == NULL) && + ai1->ai_canonname != ai2->ai_canonname)) return (-1); - if ((ai1->ai_canonname != NULL) && - (strcmp(ai1->ai_canonname, ai2->ai_canonname) != 0)) + if (ai1->ai_canonname != NULL && + strcmp(ai1->ai_canonname, ai2->ai_canonname) != 0) return (-1); - if ((ai1->ai_addr != NULL) && - (memcmp(ai1->ai_addr, ai2->ai_addr, ai1->ai_addrlen) != 0)) + if (ai1->ai_addr != NULL && + memcmp(ai1->ai_addr, ai2->ai_addr, ai1->ai_addrlen) != 0) return (-1); - if ((ai1->ai_next == NULL) && (ai2->ai_next == NULL)) + if (ai1->ai_next == NULL && ai2->ai_next == NULL) return (0); else return (compare_addrinfo_(ai1->ai_next, ai2->ai_next)); @@ -127,20 +129,16 @@ compare_addrinfo(struct addrinfo *ai1, s { int rv; - if (debug) { - printf("testing equality of 2 addrinfo structures\n"); - } + printf("testing equality of 2 addrinfo structures\n"); rv = compare_addrinfo_(ai1, ai2); - if (debug) { - if (rv == 0) - printf("equal\n"); - else { - dump_addrinfo(ai1); - dump_addrinfo(ai2); - printf("not equal\n"); - } + if (rv == 0) + printf("equal\n"); + else { + dump_addrinfo(ai1); + dump_addrinfo(ai2); + printf("not equal\n"); } return (rv); @@ -184,18 +182,18 @@ sdump_addrinfo(struct addrinfo *ai, char return; buflen -= written; } else { - for (i = 0; i < ai->ai_addrlen; ++i ) { - written = snprintf(buffer, buflen, - i + 1 != ai->ai_addrlen ? "%d." : "%d", - ((unsigned char *)ai->ai_addr)[i]); - buffer += written; - if (written > buflen) - return; - buflen -= written; + for (i = 0; i < ai->ai_addrlen; i++) { + written = snprintf(buffer, buflen, + i + 1 != ai->ai_addrlen ? "%d." : "%d", + ((unsigned char *)ai->ai_addr)[i]); + buffer += written; + if (written > buflen) + return; + buflen -= written; - if (buflen == 0) - return; - } + if (buflen == 0) + return; + } } if (ai->ai_next != NULL) { @@ -226,7 +224,7 @@ addrinfo_read_snapshot_addr(char *addr, char *s, *ps, *ts; ps = addr; - while ( (s = strsep(&ps, ".")) != NULL) { + while ((s = strsep(&ps, ".")) != NULL) { if (len == 0) return (-1); @@ -253,55 +251,53 @@ addrinfo_read_snapshot_ai(struct addrinf i = 0; ps = line; memset(ai, 0, sizeof(struct addrinfo)); - while ( (s = strsep(&ps, " ")) != NULL) { + while ((s = strsep(&ps, " ")) != NULL) { switch (i) { - case 0: - case 1: - case 2: - case 3: - pi = &ai->ai_flags + i; - *pi = (int)strtol(s, &ts, 10); - if (*ts != '\0') - goto fin; - break; - case 4: - ai->ai_addrlen = (socklen_t)strtol(s, &ts, 10); - if (*ts != '\0') - goto fin; - break; - case 5: - if (strcmp(s, "(null)") != 0) { - ai->ai_canonname = strdup(s); - assert(ai->ai_canonname != NULL); - } - break; - case 6: - if (strcmp(s, "(null)") != 0) { - ai->ai_addr = (struct sockaddr *)malloc( - ai->ai_addrlen); - assert(ai->ai_addr != NULL); - memset(ai->ai_addr, 0, ai->ai_addrlen); - rv = addrinfo_read_snapshot_addr(s, - (unsigned char *)ai->ai_addr, - ai->ai_addrlen); + case 0: + case 1: + case 2: + case 3: + pi = &ai->ai_flags + i; + *pi = (int)strtol(s, &ts, 10); + if (*ts != '\0') + goto fin; + break; + case 4: + ai->ai_addrlen = (socklen_t)strtol(s, &ts, 10); + if (*ts != '\0') + goto fin; + break; + case 5: + if (strcmp(s, "(null)") != 0) { + ai->ai_canonname = strdup(s); + ATF_REQUIRE(ai->ai_canonname != NULL); + } + break; + case 6: + if (strcmp(s, "(null)") != 0) { + ai->ai_addr = calloc(1, ai->ai_addrlen); + ATF_REQUIRE(ai->ai_addr != NULL); + rv = addrinfo_read_snapshot_addr(s, + (unsigned char *)ai->ai_addr, + ai->ai_addrlen); - if (rv != 0) + if (rv != 0) goto fin; - } - break; - default: - /* NOTE: should not be reachable */ - rv = -1; - goto fin; - }; + } + break; + default: + /* NOTE: should not be reachable */ + rv = -1; + goto fin; + } ++i; } fin: - if ((i != 7) || (rv != 0)) { + if (i != 7 || rv != 0) { free_addrinfo(ai); - memset(ai, 0, sizeof(struct addrinfo)); + ai = NULL; return (-1); } @@ -315,8 +311,7 @@ addrinfo_read_snapshot_func(struct addri char *s, *ps; int i, rv; - if (debug) - printf("1 line read from snapshot:\n%s\n", line); + printf("1 line read from snapshot:\n%s\n", line); rv = 0; i = 0; @@ -331,15 +326,14 @@ addrinfo_read_snapshot_func(struct addri return (-1); ai2 = ai; - while ( (s = strsep(&ps, ":")) != NULL) { - ai2->ai_next = (struct addrinfo *)malloc( - sizeof(struct addrinfo)); - assert(ai2->ai_next != NULL); - memset(ai2->ai_next, 0, sizeof(struct addrinfo)); + while ((s = strsep(&ps, ":")) != NULL) { + ai2->ai_next = calloc(1, sizeof(struct addrinfo)); + ATF_REQUIRE(ai2->ai_next != NULL); rv = addrinfo_read_snapshot_ai(ai2->ai_next, s); if (rv != 0) { free_addrinfo(ai); + ai = NULL; return (-1); } @@ -352,39 +346,36 @@ addrinfo_read_snapshot_func(struct addri static int addrinfo_test_correctness(struct addrinfo *ai, void *mdata) { - if (debug) { - printf("testing correctness with the following data:\n"); - dump_addrinfo(ai); - } + + printf("testing correctness with the following data:\n"); + dump_addrinfo(ai); if (ai == NULL) goto errfin; - if (!((ai->ai_family >= 0) && (ai->ai_family < AF_MAX))) + if (!(ai->ai_family >= 0 && ai->ai_family < AF_MAX)) goto errfin; - if ((ai->ai_socktype != 0) && (ai->ai_socktype != SOCK_STREAM) && - (ai->ai_socktype != SOCK_DGRAM) && (ai->ai_socktype != SOCK_RAW)) + if (ai->ai_socktype != 0 && ai->ai_socktype != SOCK_STREAM && + ai->ai_socktype != SOCK_DGRAM && ai->ai_socktype != SOCK_RAW) goto errfin; - if ((ai->ai_protocol != 0) && (ai->ai_protocol != IPPROTO_UDP) && - (ai->ai_protocol != IPPROTO_TCP)) + if (ai->ai_protocol != 0 && ai->ai_protocol != IPPROTO_UDP && + ai->ai_protocol != IPPROTO_TCP) goto errfin; if ((ai->ai_flags & ~(AI_CANONNAME | AI_NUMERICHOST | AI_PASSIVE)) != 0) goto errfin; - if ((ai->ai_addrlen != ai->ai_addr->sa_len) || - (ai->ai_family != ai->ai_addr->sa_family)) + if (ai->ai_addrlen != ai->ai_addr->sa_len || + ai->ai_family != ai->ai_addr->sa_family) goto errfin; - if (debug) - printf("correct\n"); + printf("correct\n"); return (0); errfin: - if (debug) - printf("incorrect\n"); + printf("incorrect\n"); return (-1); } @@ -395,93 +386,49 @@ addrinfo_read_hostlist_func(struct addri struct addrinfo *result; int rv; - if (debug) - printf("resolving %s: ", line); + printf("resolving %s: ", line); rv = getaddrinfo(line, NULL, &hints, &result); if (rv == 0) { - if (debug) - printf("found\n"); + printf("found\n"); rv = addrinfo_test_correctness(result, NULL); if (rv != 0) { freeaddrinfo(result); + result = NULL; return (rv); } clone_addrinfo(ai, result); freeaddrinfo(result); + result = NULL; } else { - if (debug) - printf("not found\n"); + printf("not found\n"); memset(ai, 0, sizeof(struct addrinfo)); } return (0); } -static void -usage(void) -{ - (void)fprintf(stderr, - "Usage: %s [-d] [-46] [-s -f \n", - getprogname()); - exit(1); -} - -int -main(int argc, char **argv) +void +run_tests(char *hostlist_file, char *snapshot_file, int ai_family) { struct addrinfo_test_data td, td_snap; - char *snapshot_file, *hostlist_file; int rv; - int c; - - if (argc < 2) - usage(); - snapshot_file = NULL; - hostlist_file = NULL; memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = PF_UNSPEC; + hints.ai_family = ai_family; hints.ai_flags = AI_CANONNAME; - while ((c = getopt(argc, argv, "46dns:f:")) != -1) - switch (c) { - case '4': - hints.ai_family = PF_INET; - break; - case '6': - hints.ai_family = PF_INET6; - break; - case 'd': - debug = 1; - break; - case 's': - snapshot_file = strdup(optarg); - method = TEST_BUILD_SNAPSHOT; - break; - case 'f': - hostlist_file = strdup(optarg); - break; - default: - usage(); - } + + if (snapshot_file != NULL) + method = TEST_BUILD_SNAPSHOT; TEST_DATA_INIT(addrinfo, &td, clone_addrinfo, free_addrinfo); TEST_DATA_INIT(addrinfo, &td_snap, clone_addrinfo, free_addrinfo); - if (hostlist_file == NULL) - usage(); - - if (access(hostlist_file, R_OK) != 0) { - if (debug) - printf("can't access the hostlist file %s\n", - hostlist_file); + ATF_REQUIRE_MSG(access(hostlist_file, R_OK) == 0, + "can't access the hostlist file %s\n", hostlist_file); - usage(); - } - - if (debug) - printf("building host lists from %s\n", hostlist_file); + printf("building host lists from %s\n", hostlist_file); rv = TEST_SNAPSHOT_FILE_READ(addrinfo, hostlist_file, &td, addrinfo_read_hostlist_func); @@ -493,9 +440,8 @@ main(int argc, char **argv) if (errno == ENOENT) method = TEST_BUILD_SNAPSHOT; else { - if (debug) - printf("can't access the snapshot file %s\n", - snapshot_file); + printf("can't access the snapshot " + "file %s\n", snapshot_file); rv = -1; goto fin; @@ -504,8 +450,8 @@ main(int argc, char **argv) rv = TEST_SNAPSHOT_FILE_READ(addrinfo, snapshot_file, &td_snap, addrinfo_read_snapshot_func); if (rv != 0) { - if (debug) - printf("error reading snapshot file\n"); + printf("error reading snapshot file: %s\n", + strerror(errno)); goto fin; } } @@ -514,26 +460,97 @@ main(int argc, char **argv) switch (method) { case TEST_GETADDRINFO: if (snapshot_file != NULL) - rv = DO_2PASS_TEST(addrinfo, &td, &td_snap, - compare_addrinfo, NULL); + ATF_CHECK(DO_2PASS_TEST(addrinfo, &td, &td_snap, + compare_addrinfo, NULL) == 0); break; case TEST_BUILD_SNAPSHOT: if (snapshot_file != NULL) { - rv = TEST_SNAPSHOT_FILE_WRITE(addrinfo, snapshot_file, &td, - sdump_addrinfo); + ATF_CHECK(TEST_SNAPSHOT_FILE_WRITE(addrinfo, + snapshot_file, &td, sdump_addrinfo) == 0); } break; default: - rv = 0; break; - }; + } fin: TEST_DATA_DESTROY(addrinfo, &td_snap); TEST_DATA_DESTROY(addrinfo, &td); + free(hostlist_file); free(snapshot_file); - return (rv); +} + +#define HOSTLIST_FILE "mach" +#define RUN_TESTS(tc, snapshot_file, ai_family) do { \ + char *_hostlist_file; \ + char *_snapshot_file; \ + ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ + atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ + if (snapshot_file == NULL) \ + _snapshot_file = NULL; \ + else { \ + _snapshot_file = strdup(snapshot_file); \ + ATF_REQUIRE(_snapshot_file != NULL); \ + } \ + run_tests(_hostlist_file, _snapshot_file, ai_family); \ +} while(0) + +ATF_TC_WITHOUT_HEAD(pf_unspec); +ATF_TC_BODY(pf_unspec, tc) +{ + + RUN_TESTS(tc, NULL, AF_UNSPEC); +} + +ATF_TC_WITHOUT_HEAD(pf_unspec_with_snapshot); +ATF_TC_BODY(pf_unspec_with_snapshot, tc) +{ + + RUN_TESTS(tc, "snapshot_ai", AF_UNSPEC); +} + +ATF_TC_WITHOUT_HEAD(pf_inet); +ATF_TC_BODY(pf_inet, tc) +{ + + ATF_REQUIRE_FEATURE("inet"); + RUN_TESTS(tc, NULL, AF_INET); +} +ATF_TC_WITHOUT_HEAD(pf_inet_with_snapshot); +ATF_TC_BODY(pf_inet_with_snapshot, tc) +{ + + ATF_REQUIRE_FEATURE("inet"); + RUN_TESTS(tc, "snapshot_ai4", AF_INET); } +ATF_TC_WITHOUT_HEAD(pf_inet6); +ATF_TC_BODY(pf_inet6, tc) +{ + + ATF_REQUIRE_FEATURE("inet6"); + RUN_TESTS(tc, NULL, AF_INET6); +} + +ATF_TC_WITHOUT_HEAD(pf_inet6_with_snapshot); +ATF_TC_BODY(pf_inet6_with_snapshot, tc) +{ + + ATF_REQUIRE_FEATURE("inet6"); + RUN_TESTS(tc, "snapshot_ai6", AF_INET6); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, pf_unspec); + ATF_TP_ADD_TC(tp, pf_unspec_with_snapshot); + ATF_TP_ADD_TC(tp, pf_inet); + ATF_TP_ADD_TC(tp, pf_inet_with_snapshot); + ATF_TP_ADD_TC(tp, pf_inet6); + ATF_TP_ADD_TC(tp, pf_inet6_with_snapshot); + + return (atf_no_error()); +} Copied and modified: head/lib/libc/tests/nss/getgr_test.c (from r292322, head/tools/regression/lib/libc/nss/test-getgr.c) ============================================================================== --- head/tools/regression/lib/libc/nss/test-getgr.c Wed Dec 16 08:02:21 2015 (r292322, copy source) +++ head/lib/libc/tests/nss/getgr_test.c Wed Dec 16 08:09:03 2015 (r292323) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -37,17 +36,19 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include + #include "testutil.h" enum test_methods { - TEST_GETGRENT, - TEST_GETGRNAM, - TEST_GETGRGID, - TEST_GETGRENT_2PASS, - TEST_BUILD_SNAPSHOT + TEST_GETGRENT = 1, + TEST_GETGRNAM = 2, + TEST_GETGRGID = 4, + TEST_GETGRENT_2PASS = 8, + TEST_BUILD_SNAPSHOT = 16, }; -static int debug = 0; static enum test_methods method = TEST_BUILD_SNAPSHOT; DECLARE_TEST_DATA(group) @@ -71,8 +72,6 @@ static int group_test_getgrnam(struct gr static int group_test_getgrgid(struct group *, void *); static int group_test_getgrent(struct group *, void *); -static void usage(void) __attribute__((__noreturn__)); - IMPLEMENT_TEST_DATA(group) IMPLEMENT_TEST_FILE_SNAPSHOT(group) IMPLEMENT_1PASS_TEST(group) @@ -81,8 +80,8 @@ IMPLEMENT_2PASS_TEST(group) static void clone_group(struct group *dest, struct group const *src) { - assert(dest != NULL); - assert(src != NULL); + ATF_REQUIRE(dest != NULL); + ATF_REQUIRE(src != NULL); char **cp; int members_num; @@ -91,12 +90,12 @@ clone_group(struct group *dest, struct g if (src->gr_name != NULL) { dest->gr_name = strdup(src->gr_name); - assert(dest->gr_name != NULL); + ATF_REQUIRE(dest->gr_name != NULL); } if (src->gr_passwd != NULL) { dest->gr_passwd = strdup(src->gr_passwd); - assert(dest->gr_passwd != NULL); + ATF_REQUIRE(dest->gr_passwd != NULL); } dest->gr_gid = src->gr_gid; @@ -105,14 +104,12 @@ clone_group(struct group *dest, struct g for (cp = src->gr_mem; *cp; ++cp) ++members_num; - dest->gr_mem = (char **)malloc( - (members_num + 1) * (sizeof(char *))); - assert(dest->gr_mem != NULL); - memset(dest->gr_mem, 0, (members_num+1) * (sizeof(char *))); + dest->gr_mem = calloc(1, (members_num + 1) * sizeof(char *)); + ATF_REQUIRE(dest->gr_mem != NULL); for (cp = src->gr_mem; *cp; ++cp) { dest->gr_mem[cp - src->gr_mem] = strdup(*cp); - assert(dest->gr_mem[cp - src->gr_mem] != NULL); + ATF_REQUIRE(dest->gr_mem[cp - src->gr_mem] != NULL); } } } @@ -122,7 +119,7 @@ free_group(struct group *grp) { char **cp; - assert(grp != NULL); + ATF_REQUIRE(grp != NULL); free(grp->gr_name); free(grp->gr_passwd); @@ -140,31 +137,31 @@ compare_group(struct group *grp1, struct if (grp1 == grp2) return (0); - if ((grp1 == NULL) || (grp2 == NULL)) + if (grp1 == NULL || grp2 == NULL) goto errfin; - if ((strcmp(grp1->gr_name, grp2->gr_name) != 0) || - (strcmp(grp1->gr_passwd, grp2->gr_passwd) != 0) || - (grp1->gr_gid != grp2->gr_gid)) + if (strcmp(grp1->gr_name, grp2->gr_name) != 0 || + strcmp(grp1->gr_passwd, grp2->gr_passwd) != 0 || + grp1->gr_gid != grp2->gr_gid) goto errfin; c1 = grp1->gr_mem; c2 = grp2->gr_mem; - if ((grp1->gr_mem == NULL) || (grp2->gr_mem == NULL)) + if (grp1->gr_mem == NULL || grp2->gr_mem == NULL) goto errfin; - for (;*c1 && *c2; ++c1, ++c2) + for (; *c1 && *c2; ++c1, ++c2) if (strcmp(*c1, *c2) != 0) goto errfin; - if ((*c1 != '\0') || (*c2 != '\0')) + if (*c1 != '\0' || *c2 != '\0') goto errfin; return 0; errfin: - if ((debug) && (mdata == NULL)) { + if (mdata == NULL) { printf("following structures are not equal:\n"); dump_group(grp1); dump_group(grp2); @@ -211,54 +208,55 @@ group_read_snapshot_func(struct group *g char *s, *ps, *ts; int i; - if (debug) - printf("1 line read from snapshot:\n%s\n", line); + printf("1 line read from snapshot:\n%s\n", line); i = 0; sl = NULL; ps = line; memset(grp, 0, sizeof(struct group)); - while ( (s = strsep(&ps, " ")) != NULL) { + while ((s = strsep(&ps, " ")) != NULL) { switch (i) { - case 0: - grp->gr_name = strdup(s); - assert(grp->gr_name != NULL); + case 0: + grp->gr_name = strdup(s); + ATF_REQUIRE(grp->gr_name != NULL); break; - case 1: - grp->gr_passwd = strdup(s); - assert(grp->gr_passwd != NULL); + case 1: + grp->gr_passwd = strdup(s); + ATF_REQUIRE(grp->gr_passwd != NULL); break; - case 2: - grp->gr_gid = (gid_t)strtol(s, &ts, 10); - if (*ts != '\0') { - free(grp->gr_name); - free(grp->gr_passwd); - return (-1); - } + case 2: + grp->gr_gid = (gid_t)strtol(s, &ts, 10); + if (*ts != '\0') { + free(grp->gr_name); + free(grp->gr_passwd); + grp->gr_name = NULL; + grp->gr_passwd = NULL; + return (-1); + } break; - default: - if (sl == NULL) { - if (strcmp(s, "(null)") == 0) - return (0); - - sl = sl_init(); - assert(sl != NULL); - - if (strcmp(s, "nomem") != 0) { - ts = strdup(s); - assert(ts != NULL); - sl_add(sl, ts); - } - } else { + default: + if (sl == NULL) { + if (strcmp(s, "(null)") == 0) + return (0); + + sl = sl_init(); + ATF_REQUIRE(sl != NULL); + + if (strcmp(s, "nomem") != 0) { ts = strdup(s); - assert(ts != NULL); + ATF_REQUIRE(ts != NULL); sl_add(sl, ts); } + } else { + ts = strdup(s); + ATF_REQUIRE(ts != NULL); + sl_add(sl, ts); + } break; - }; + } ++i; } @@ -308,10 +306,8 @@ group_fill_test_data(struct group_test_d static int group_test_correctness(struct group *grp, void *mdata) { - if (debug) { - printf("testing correctness with the following data:\n"); - dump_group(grp); - } + printf("testing correctness with the following data:\n"); + dump_group(grp); if (grp == NULL) goto errfin; @@ -325,13 +321,11 @@ group_test_correctness(struct group *grp if (grp->gr_mem == NULL) goto errfin; - if (debug) - printf("correct\n"); + printf("correct\n"); return (0); errfin: - if (debug) - printf("incorrect\n"); + printf("incorrect\n"); return (-1); } @@ -352,28 +346,20 @@ group_test_getgrnam(struct group *grp_mo { struct group *grp; - if (debug) { - printf("testing getgrnam() with the following data:\n"); - dump_group(grp_model); - } + printf("testing getgrnam() with the following data:\n"); + dump_group(grp_model); grp = getgrnam(grp_model->gr_name); if (group_test_correctness(grp, NULL) != 0) goto errfin; - if ((compare_group(grp, grp_model, NULL) != 0) && - (group_check_ambiguity((struct group_test_data *)mdata, grp) - !=0)) + if (compare_group(grp, grp_model, NULL) != 0 && + group_check_ambiguity((struct group_test_data *)mdata, grp) != 0) goto errfin; - if (debug) - printf("ok\n"); return (0); errfin: - if (debug) - printf("not ok\n"); - return (-1); } @@ -382,23 +368,16 @@ group_test_getgrgid(struct group *grp_mo { struct group *grp; - if (debug) { - printf("testing getgrgid() with the following data...\n"); - dump_group(grp_model); - } + printf("testing getgrgid() with the following data...\n"); + dump_group(grp_model); grp = getgrgid(grp_model->gr_gid); - if ((group_test_correctness(grp, NULL) != 0) || - ((compare_group(grp, grp_model, NULL) != 0) && - (group_check_ambiguity((struct group_test_data *)mdata, grp) - != 0))) { - if (debug) - printf("not ok\n"); - return (-1); + if (group_test_correctness(grp, NULL) != 0 || + (compare_group(grp, grp_model, NULL) != 0 && + group_check_ambiguity((struct group_test_data *)mdata, grp) != 0)) { + return (-1); } else { - if (debug) - printf("ok\n"); - return (0); + return (0); } } @@ -410,50 +389,11 @@ group_test_getgrent(struct group *grp, v return (group_test_correctness(grp, NULL)); } -static void -usage(void) -{ - (void)fprintf(stderr, - "Usage: %s -nge2 [-d] [-s ]\n", - getprogname()); - exit(1); -} - -int -main(int argc, char **argv) +static int +run_tests(const char *snapshot_file, enum test_methods method) { struct group_test_data td, td_snap, td_2pass; - char *snapshot_file; int rv; - int c; - - if (argc < 2) - usage(); - - snapshot_file = NULL; - while ((c = getopt(argc, argv, "nge2ds:")) != -1) - switch (c) { - case 'd': - debug++; - break; - case 'n': - method = TEST_GETGRNAM; - break; - case 'g': - method = TEST_GETGRGID; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A339A49EA1; Wed, 16 Dec 2015 13:56:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30FE8160C; Wed, 16 Dec 2015 13:56:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG4xV2L066459; Wed, 16 Dec 2015 04:59:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG4xUmr066457; Wed, 16 Dec 2015 04:59:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160459.tBG4xUmr066457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 04:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292316 - in head/tools/regression/lib/libc: nss resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:54 -0000 Author: ngie Date: Wed Dec 16 04:59:30 2015 New Revision: 292316 URL: https://svnweb.freebsd.org/changeset/base/292316 Log: Remove hosts that don't resolve properly with the nss and resolv tests MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/libc/nss/mach head/tools/regression/lib/libc/resolv/mach Modified: head/tools/regression/lib/libc/nss/mach ============================================================================== --- head/tools/regression/lib/libc/nss/mach Wed Dec 16 04:38:58 2015 (r292315) +++ head/tools/regression/lib/libc/nss/mach Wed Dec 16 04:59:30 2015 (r292316) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es Modified: head/tools/regression/lib/libc/resolv/mach ============================================================================== --- head/tools/regression/lib/libc/resolv/mach Wed Dec 16 04:38:58 2015 (r292315) +++ head/tools/regression/lib/libc/resolv/mach Wed Dec 16 04:59:30 2015 (r292316) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es From owner-svn-src-all@freebsd.org Wed Dec 16 13:56:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35AB0A49E4D; Wed, 16 Dec 2015 13:56:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5CF214E0; Wed, 16 Dec 2015 13:56:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG5Bv4l073158; Wed, 16 Dec 2015 05:11:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG5BvF7073152; Wed, 16 Dec 2015 05:11:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160511.tBG5BvF7073152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 05:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292317 - in head: etc/mtree lib/libc/tests lib/libc/tests/resolv tools/regression/lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 13:56:52 -0000 Author: ngie Date: Wed Dec 16 05:11:57 2015 New Revision: 292317 URL: https://svnweb.freebsd.org/changeset/base/292317 Log: Integrate tools/regression/lib/libc/resolv into the FreeBSD test suite as lib/libc/tests/resolv Convert the testcases to ATF MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/tests/resolv/ head/lib/libc/tests/resolv/mach - copied unchanged from r292316, head/tools/regression/lib/libc/resolv/mach head/lib/libc/tests/resolv/resolv_test.c - copied, changed from r292316, head/tools/regression/lib/libc/resolv/resolv.c Deleted: head/tools/regression/lib/libc/resolv/ Modified: head/etc/mtree/BSD.tests.dist head/lib/libc/tests/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Dec 16 04:59:30 2015 (r292316) +++ head/etc/mtree/BSD.tests.dist Wed Dec 16 05:11:57 2015 (r292317) @@ -275,6 +275,8 @@ data .. .. + resolv + .. rpc .. ssp Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Wed Dec 16 04:59:30 2015 (r292316) +++ head/lib/libc/tests/Makefile Wed Dec 16 05:11:57 2015 (r292317) @@ -11,6 +11,7 @@ TESTS_SUBDIRS+= hash TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= regex +TESTS_SUBDIRS+= resolv TESTS_SUBDIRS+= rpc TESTS_SUBDIRS+= stdio TESTS_SUBDIRS+= stdlib Copied: head/lib/libc/tests/resolv/mach (from r292316, head/tools/regression/lib/libc/resolv/mach) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/resolv/mach Wed Dec 16 05:11:57 2015 (r292317, copy of r292316, head/tools/regression/lib/libc/resolv/mach) @@ -0,0 +1,46 @@ +# $FreeBSD$ +localhost +anoncvs.cirr.com +anoncvs.netbsd.se +antioche.antioche.eu.org +centaurus.4web.cz +chur.math.ntnu.no +console.netbsd.org +cvs.netbsd.org +cvsup.netbsd.se +ftp.chg.ru +ftp.estpak.ee +ftp.fsn.hu +ftp.funet.fi +ftp.netbsd.org +ftp.nluug.nl +ftp.plig.org +ftp.uni-erlangen.de +ftp.xgate.co.kr +gd.tuwien.ac.at +gort.ludd.luth.se +irc.warped.net +knug.youn.co.kr +mail.jp.netbsd.org +mail.netbsd.org +melanoma.cs.rmit.edu.au +mirror.aarnet.edu.au +moon.vub.ac.be +net.bsd.cz +netbsd.3miasto.net +netbsd.4ka.mipt.ru +netbsd.csie.nctu.edu.tw +netbsd.enderunix.org +netbsd.ftp.fu-berlin.de +netbsd.pair.com +netbsdiso.interoute.net.uk +netbsdwww.cs.rmit.edu.au +netbsdwww.interoute.net.uk +ns.netbsd.org +skeleton.phys.spbu.ru +www.en.netbsd.de +www.netbsd.cl +www.netbsd.nl +www.netbsd.org +www.netbsd.ro +zeppo.rediris.es Copied and modified: head/lib/libc/tests/resolv/resolv_test.c (from r292316, head/tools/regression/lib/libc/resolv/resolv.c) ============================================================================== --- head/tools/regression/lib/libc/resolv/resolv.c Wed Dec 16 04:59:30 2015 (r292316, copy source) +++ head/lib/libc/tests/resolv/resolv_test.c Wed Dec 16 05:11:57 2015 (r292317) @@ -39,10 +39,11 @@ __RCSID("$NetBSD: resolv.c,v 1.6 2004/05 #include #include #include -#include #include #include +#include + #define NTHREADS 10 #define NHOSTS 100 #define WS " \t\n\r" @@ -54,13 +55,10 @@ enum method { }; static StringList *hosts = NULL; -static int debug = 0; static enum method method = METHOD_GETADDRINFO; -static int reverse = 0; static int *ask = NULL; static int *got = NULL; -static void usage(void) __attribute__((__noreturn__)); static void load(const char *); static void resolvone(int); static void *resolvloop(void *); @@ -69,15 +67,6 @@ static void run(int *); static pthread_mutex_t stats = PTHREAD_MUTEX_INITIALIZER; static void -usage(void) -{ - (void)fprintf(stderr, - "Usage: %s [-AdHIr] [-h ] [-n ] ...\n", - getprogname()); - exit(1); -} - -static void load(const char *fname) { FILE *fp; @@ -85,7 +74,7 @@ load(const char *fname) char *line; if ((fp = fopen(fname, "r")) == NULL) - err(1, "Cannot open `%s'", fname); + ATF_REQUIRE(fp != NULL); while ((line = fgetln(fp, &len)) != NULL) { char c = line[len]; char *ptr; @@ -114,21 +103,17 @@ resolv_getaddrinfo(pthread_t self, char hints.ai_flags = AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(host, portstr, &hints, &res); - if (debug) { - len = snprintf(buf, sizeof(buf), "%p: host %s %s\n", - self, host, error ? "not found" : "ok"); - (void)write(STDOUT_FILENO, buf, len); - } - if (error == 0 && reverse) { + len = snprintf(buf, sizeof(buf), "%p: host %s %s\n", + self, host, error ? "not found" : "ok"); + (void)write(STDOUT_FILENO, buf, len); + if (error == 0) { memset(hbuf, 0, sizeof(hbuf)); memset(pbuf, 0, sizeof(pbuf)); getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), 0); - if (debug) { - len = snprintf(buf, sizeof(buf), - "%p: reverse %s %s\n", self, hbuf, pbuf); - (void)write(STDOUT_FILENO, buf, len); - } + len = snprintf(buf, sizeof(buf), + "%p: reverse %s %s\n", self, hbuf, pbuf); + (void)write(STDOUT_FILENO, buf, len); } if (error == 0) freeaddrinfo(res); @@ -143,15 +128,13 @@ resolv_gethostby(pthread_t self, char *h int len; hp = gethostbyname(host); - if (debug) { - len = snprintf(buf, sizeof(buf), "%p: host %s %s\n", - self, host, (hp == NULL) ? "not found" : "ok"); - (void)write(STDOUT_FILENO, buf, len); - } - if (hp && reverse) { + len = snprintf(buf, sizeof(buf), "%p: host %s %s\n", + self, host, (hp == NULL) ? "not found" : "ok"); + (void)write(STDOUT_FILENO, buf, len); + if (hp) { memcpy(buf, hp->h_addr, hp->h_length); hp2 = gethostbyaddr(buf, hp->h_length, hp->h_addrtype); - if (hp2 && debug) { + if (hp2) { len = snprintf(buf, sizeof(buf), "%p: reverse %s\n", self, hp2->h_name); (void)write(STDOUT_FILENO, buf, len); @@ -168,16 +151,14 @@ resolv_getipnodeby(pthread_t self, char int len, h_error; hp = getipnodebyname(host, AF_INET, 0, &h_error); - if (debug) { - len = snprintf(buf, sizeof(buf), "%p: host %s %s\n", - self, host, (hp == NULL) ? "not found" : "ok"); - (void)write(STDOUT_FILENO, buf, len); - } - if (hp && reverse) { + len = snprintf(buf, sizeof(buf), "%p: host %s %s\n", + self, host, (hp == NULL) ? "not found" : "ok"); + (void)write(STDOUT_FILENO, buf, len); + if (hp) { memcpy(buf, hp->h_addr, hp->h_length); hp2 = getipnodebyaddr(buf, hp->h_length, hp->h_addrtype, &h_error); - if (hp2 && debug) { + if (hp2) { len = snprintf(buf, sizeof(buf), "%p: reverse %s\n", self, hp2->h_name); (void)write(STDOUT_FILENO, buf, len); @@ -200,11 +181,9 @@ resolvone(int n) struct addrinfo hints, *res; int error, len; - if (debug) { - len = snprintf(buf, sizeof(buf), "%p: %d resolving %s %d\n", - self, n, host, (int)i); - (void)write(STDOUT_FILENO, buf, len); - } + len = snprintf(buf, sizeof(buf), "%p: %d resolving %s %d\n", + self, n, host, (int)i); + (void)write(STDOUT_FILENO, buf, len); switch (method) { case METHOD_GETADDRINFO: error = resolv_getaddrinfo(self, host, i); @@ -239,13 +218,16 @@ resolvloop(void *p) static void run(int *nhosts) { - pthread_t self = pthread_self(); - if (pthread_create(&self, NULL, resolvloop, nhosts) != 0) - err(1, "pthread_create"); + pthread_t self; + int rc; + + self = pthread_self(); + rc = pthread_create(&self, NULL, resolvloop, nhosts); + ATF_REQUIRE_MSG(rc == 0, "pthread_create failed: %s", strerror(rc)); } -int -main(int argc, char *argv[]) +static int +run_tests(const char *hostlist_file, enum method method) { int nthreads = NTHREADS; int nhosts = NHOSTS; @@ -254,46 +236,18 @@ main(int argc, char *argv[]) srandom(1234); - while ((c = getopt(argc, argv, "Adh:HIn:r")) != -1) - switch (c) { - case 'A': - method = METHOD_GETADDRINFO; - break; - case 'd': - debug++; - break; - case 'h': - nhosts = atoi(optarg); - break; - case 'H': - method = METHOD_GETHOSTBY; - break; - case 'I': - method = METHOD_GETIPNODEBY; - break; - case 'n': - nthreads = atoi(optarg); - break; - case 'r': - reverse++; - break; - default: - usage(); - } + load(hostlist_file); - for (i = optind; i < argc; i++) - load(argv[i]); + ATF_REQUIRE_MSG(0 < hosts->sl_cur, "0 hosts in %s", hostlist_file); - if (hosts->sl_cur == 0) - usage(); + nleft = malloc(nthreads * sizeof(int)); + ATF_REQUIRE(nleft != NULL); - if ((nleft = malloc(nthreads * sizeof(int))) == NULL) - err(1, "malloc"); - if ((ask = calloc(hosts->sl_cur, sizeof(int))) == NULL) - err(1, "calloc"); - if ((got = calloc(hosts->sl_cur, sizeof(int))) == NULL) - err(1, "calloc"); + ask = calloc(hosts->sl_cur, sizeof(int)); + ATF_REQUIRE(ask != NULL); + got = calloc(hosts->sl_cur, sizeof(int)); + ATF_REQUIRE(got != NULL); for (i = 0; i < nthreads; i++) { nleft[i] = nhosts; @@ -313,7 +267,7 @@ main(int argc, char *argv[]) c = 0; for (i = 0; i < hosts->sl_cur; i++) { if (ask[i] != got[i] && got[i] != 0) { - warnx("Error: host %s ask %d got %d\n", + printf("Error: host %s ask %d got %d\n", hosts->sl_str[i], ask[i], got[i]); c++; } @@ -324,3 +278,44 @@ main(int argc, char *argv[]) sl_free(hosts, 1); return c; } + +#define HOSTLIST_FILE "mach" + +#define RUN_TESTS(tc, method) \ +do { \ + char *_hostlist_file; \ + ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ + atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ + ATF_REQUIRE(run_tests(_hostlist_file, method) == 0); \ +} while(0) + +ATF_TC_WITHOUT_HEAD(getaddrinfo_test); +ATF_TC_BODY(getaddrinfo_test, tc) +{ + + RUN_TESTS(tc, METHOD_GETADDRINFO); +} + +ATF_TC_WITHOUT_HEAD(gethostby_test); +ATF_TC_BODY(gethostby_test, tc) +{ + + RUN_TESTS(tc, METHOD_GETHOSTBY); +} + +ATF_TC_WITHOUT_HEAD(getipnodeby_test); +ATF_TC_BODY(getipnodeby_test, tc) +{ + + RUN_TESTS(tc, METHOD_GETIPNODEBY); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, getaddrinfo_test); + ATF_TP_ADD_TC(tp, gethostby_test); + ATF_TP_ADD_TC(tp, getipnodeby_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Wed Dec 16 14:01:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40894A43A11; Wed, 16 Dec 2015 14:01:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1025F1C86; Wed, 16 Dec 2015 14:01:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x232.google.com with SMTP id ph11so143243908igc.1; Wed, 16 Dec 2015 06:01:10 -0800 (PST) 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; bh=Sk04MCNj/+NgEiyT/s1DOYTI/2LpMYpwf8gnlBJrzmY=; b=J701NG6Et/OF/y0uWg4VPktyR/rymad7q0BCyFR3iDfqRqJ3Oq+H+PBmWpVNhR0H5Y HZ3OCmPzRSvV3lVMY3XfeqGdsVa4jlT5B314aDClZ4IOIvjQghUuoNP7H8NMvvbnF/L0 N8ZHFn7qAG/IWgamfmI88tLGv0ax1KTTxh8UGDXmloOmnPUUUcsNcJiCb2CyQqS8Bbzw hQpZGCXowgT8NPiRc/j2CdionrF0FaFU9fv/qaKnRfjhjxnKX1adqdPrYYSKW4KqEfRk hxibzUY7T16RDJ7a5bAv7QmgIbiU16BtF4Uulijb5PPMwyYX/Vtn2JIOFsFN4Knwx5Sq vhSw== X-Received: by 10.107.30.80 with SMTP id e77mr41582910ioe.180.1450274469527; Wed, 16 Dec 2015 06:01:09 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.142.69 with HTTP; Wed, 16 Dec 2015 06:00:50 -0800 (PST) In-Reply-To: <201512160056.tBG0ujqA067178@repo.freebsd.org> References: <201512160056.tBG0ujqA067178@repo.freebsd.org> From: Ed Maste Date: Wed, 16 Dec 2015 14:00:50 +0000 X-Google-Sender-Auth: 6VsT7E7gXMWTU9M5xrJBJVmmheA Message-ID: Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks To: Randall Stewart Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 14:01:10 -0000 On 16 December 2015 at 00:56, Randall Stewart wrote: > Author: rrs > Date: Wed Dec 16 00:56:45 2015 > New Revision: 292309 > URL: https://svnweb.freebsd.org/changeset/base/292309 > > Log: > First cut of the modularization of our TCP stack. Still > to do is to clean up the timer handling using the async-drain. > Other optimizations may be coming to go with this. Whats here > will allow differnet tcp implementations (one included). > Reviewed by: jtl, hiren, transports > Sponsored by: Netflix Inc. > Differential Revision: D4055 This broke at least powerpc builds: /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:148: warning: redundant redeclaration of 'tcp_dooptions' [-Wredundant-decls] /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:736: warning: previous declaration of 'tcp_dooptions' was here /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:150: warning: redundant redeclaration of 'tcp_dropwithreset' [-Wredundant-decls] /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:738: warning: previous declaration of 'tcp_dropwithreset' was here /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:152: warning: redundant redeclaration of 'tcp_pulloutofband' [-Wredundant-decls] /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:740: warning: previous declaration of 'tcp_pulloutofband' was here /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_stacks/fastpath.c:153: warning: redundant redeclaration of 'tcp_xmit_timer' [-Wredundant-decls] /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:741: warning: previous declaration of 'tcp_xmit_timer' was here ... From owner-svn-src-all@freebsd.org Wed Dec 16 14:22:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD76A44302; Wed, 16 Dec 2015 14:22:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2C91F38; Wed, 16 Dec 2015 14:22:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGEM0Ms053345; Wed, 16 Dec 2015 14:22:00 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGEM013053344; Wed, 16 Dec 2015 14:22:00 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512161422.tBGEM013053344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 16 Dec 2015 14:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292335 - stable/10/share/man/man4 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 14:22:01 -0000 Author: brueffer Date: Wed Dec 16 14:22:00 2015 New Revision: 292335 URL: https://svnweb.freebsd.org/changeset/base/292335 Log: MFH: r291766 ARC-1203 is supported since the latest driver update. Modified: stable/10/share/man/man4/arcmsr.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/arcmsr.4 ============================================================================== --- stable/10/share/man/man4/arcmsr.4 Wed Dec 16 10:55:19 2015 (r292334) +++ stable/10/share/man/man4/arcmsr.4 Wed Dec 16 14:22:00 2015 (r292335) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd December 4, 2015 .Dt ARCMSR 4 .Os .Sh NAME @@ -94,6 +94,8 @@ ARC-1200 .It ARC-1201 .It +ARC-1203 +.It ARC-1210 .It ARC-1212 From owner-svn-src-all@freebsd.org Wed Dec 16 14:43:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F53AA48381 for ; Wed, 16 Dec 2015 14:43:09 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2FA1023 for ; Wed, 16 Dec 2015 14:43:09 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x235.google.com with SMTP id p187so4182505wmp.0 for ; Wed, 16 Dec 2015 06:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=pKjFcmzMCMI6VJDOVB79QiJlj1vtEZcJd9ubWXZrYi4=; b=AMsG4L0hmK6TASGDJ3kJhwuYF0h35SJIluUbLnGAld4i5dfOIlfGbdD91GQhuTkWNR tFcS1KNy9QgD7BwJMc4zcKFcQZNDoy5DCOV9vyaqBRiWAKDMIzSTASbIZnGkLy7XEF58 ZUTVPksfsn8vX8c+Ip2tozsMqBmuwXA6UYqqnsAWf56dxSEYUXSrQ3q7A4qXwstYxA8o 6ugAuUKLcMYA1aEVVNHvN9fJTV6+N4fJv0icpb/i1AZ6F72x+hvZJ7dekmZD8vm8qArq Lbj1sWOX1rBe0L7IE+srCxSw6N724PlhjH7y6nCTt2wVSZeGIWhJCn7A9Er0VmRP7xS4 jehA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=pKjFcmzMCMI6VJDOVB79QiJlj1vtEZcJd9ubWXZrYi4=; b=caFyEm+EdVLbXPI2L5Vmbtj89namvkbx4++oP4rxrYk59gBORntQIAws7zKRiszGCr D0aeqi38FnG6Uz3N5J0CQAlhzAOydJ5pGkONdrUpmf5H1Kwzx7va4Vr0YdnnTmMScjTL xkjLPxeHN1YjryOsp8Sc7sY1kuA5s7xznJJBpY6fB4U5AXnrnQHhpHO8Gk3AE2CxBxzq pfDRyMIlOMsZYY4+/YapD5EjiIYJ2KcsvCYk2djxBbwtzZiUhHIj5Y1MV1Ik0IN3LW/q bCKSTbHUZkJJc0RBuQnOQiNM8fSgi/q9xgzuHTeskpo4kMBp7dFdTim3vTMsveM7hKXP +r7w== X-Gm-Message-State: ALoCoQkaojtnGRg2sysKmjz9JLtCGCpsE2kjXR/Q5oo2HEYw9AK9oiH2wLTgkTGxoGBhdt1BpZcI26vyYdaMchsjhItvhjJZag== X-Received: by 10.28.4.72 with SMTP id 69mr12188093wme.10.1450276987585; Wed, 16 Dec 2015 06:43:07 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id e136sm7713353wma.23.2015.12.16.06.43.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Dec 2015 06:43:05 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 To: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <633021450256567@web13o.yandex.ru> Message-ID: <5671787E.4060303@freebsd.org> Date: Wed, 16 Dec 2015 14:43:10 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <633021450256567@web13o.yandex.ru> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 14:43:09 -0000 On 16/12/2015 09:02, Alexander V. Chernikov wrote: > 15.12.2015, 19:02, "Steven Hartland" : >> Author: smh >> Date: Tue Dec 15 16:02:11 2015 >> New Revision: 292275 >> URL: https://svnweb.freebsd.org/changeset/base/292275 >> >> Log: >> Fix lagg failover due to missing notifications >> >> When using lagg failover mode neither Gratuitous ARP (IPv4) or Unsolicited >> Neighbour Advertisements (IPv6) are sent to notify other nodes that the >> address may have moved. >> >> This results is slow failover, dropped packets and network outages for the >> lagg interface when the primary link goes down. >> >> We now use the new if_link_state_change_cond with the force param set to >> allow lagg to force through link state changes and hence fire a >> ifnet_link_event which are now monitored by rip and nd6. >> >> Upon receiving these events each protocol trigger the relevant >> notifications: >> * inet4 => Gratuitous ARP >> * inet6 => Unsolicited Neighbour Announce > Steven, I believe that having DELAY() called inside callout routine is incorrect - you are delaying other consumers for arbitrary amount of time. > If you really want to do it that way you should create separate taskqueue for that. > Also, destroying interface while doing these DELAYs would very likely crash the system > :"#define IN6_MAX_ANYCAST_DELAY_TIME_MS 1000000" is misguiding > There are some style(9) issues like lack of empty line between nd6_init() and nd6_ifnet_link_event() > ... Thanks Alexander, do you think an acceptable workaround for the time being is to remove the DELAY, until I get some time to work on a taskqueue? Also do you have any input on the questions I raised about Kristof's panic due to NULL ifp->if_addr arp_announce? From owner-svn-src-all@freebsd.org Wed Dec 16 15:08:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C1E2A49AFF for ; Wed, 16 Dec 2015 15:08:54 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B60F18DA for ; Wed, 16 Dec 2015 15:08:54 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x236.google.com with SMTP id e66so13873863pfe.0 for ; Wed, 16 Dec 2015 07:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=tc+2PmISkM2qJYJKtcraU/URwndZ/OEzhrhXs4vMJ1Q=; b=EMzBzQkxAEPaG7PuX7B76j27U4BeRnNse/U4CY+6E6xFge3ri+icsDEaTMqtyF17b7 wsmyWsRQAAqFqpy30GHJqcmMe7xIRVOHRH7HSyc1fQLnktCPP6T+QckfWzVtM5H/FFlI /rpTnMN79H2Zs9TFhGZMkIR6yoVx9Pw2qc50E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=tc+2PmISkM2qJYJKtcraU/URwndZ/OEzhrhXs4vMJ1Q=; b=aUV7f1p8vXex25i6beYem+Y19xjOdPWmVC4mxw/DGr02yNrWTfthLfyLHkYAyfcGRL Uz9yuvG/ljG9kNi0velNmBhdC6briITxkAGOpU/AlS/h5L24Yd44yHGactZz80I5LiUo 2yN8xhpdQIB3NiWOMM/ptjZBbS/mxIb7D3JHUozEJfwJZCw3ixVbjc6lBtykqpc78iGY GGNIHgAxWfriGxv7WlaExYkN3so06Tg4KSKnjeiwHMnymlFFfyzpqOCqL1Iax7tKxei3 uwe/k/RLOKdeSwMuIqg8q8C6WjVnSMVVXYrjt6uWuYeLcgEq1Wu3oPBXjodXmtrg0W+l dRkw== X-Gm-Message-State: ALoCoQl32BcthSWXxwxNzApGRjH7WG3k5OnDL1pmNAnkYJl3DC+dPPojhRPO6biGfhn6GrKYYgpfR04FG4MQ9idpOK6/6pKiag== X-Received: by 10.98.73.19 with SMTP id w19mr1845556pfa.103.1450278533744; Wed, 16 Dec 2015 07:08:53 -0800 (PST) Received: from [10.0.104.77] (173-164-135-226-SFBA.hfc.comcastbusiness.net. [173.164.135.226]) by smtp.gmail.com with ESMTPSA id 7sm5523938pfb.62.2015.12.16.07.08.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Dec 2015 07:08:52 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks From: Randall Stewart In-Reply-To: Date: Wed, 16 Dec 2015 07:08:49 -0800 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <1A3645F3-3287-4CD8-B69D-AC053507D435@netflix.com> References: <201512160056.tBG0ujqA067178@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 15:08:54 -0000 Ahh I think I see this is a difference between our friend clang and gcc.. since I bet ppc uses gcc not clang :-o I will have something for you in a sec.. sorry about that Ed R This is the difference between=20 On Dec 16, 2015, at 6:00 AM, Ed Maste wrote: > On 16 December 2015 at 00:56, Randall Stewart wrote: >> Author: rrs >> Date: Wed Dec 16 00:56:45 2015 >> New Revision: 292309 >> URL: https://svnweb.freebsd.org/changeset/base/292309 >>=20 >> Log: >> First cut of the modularization of our TCP stack. Still >> to do is to clean up the timer handling using the async-drain. >> Other optimizations may be coming to go with this. Whats here >> will allow differnet tcp implementations (one included). >> Reviewed by: jtl, hiren, transports >> Sponsored by: Netflix Inc. >> Differential Revision: D4055 >=20 > This broke at least powerpc builds: >=20 > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:148: > warning: redundant redeclaration of 'tcp_dooptions' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:736: warning: > previous declaration of 'tcp_dooptions' was here > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:150: > warning: redundant redeclaration of 'tcp_dropwithreset' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:738: warning: > previous declaration of 'tcp_dropwithreset' was here > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:152: > warning: redundant redeclaration of 'tcp_pulloutofband' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:740: warning: > previous declaration of 'tcp_pulloutofband' was here > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:153: > warning: redundant redeclaration of 'tcp_xmit_timer' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:741: warning: > previous declaration of 'tcp_xmit_timer' was here > ... -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Wed Dec 16 15:16:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A99EFA480DE; Wed, 16 Dec 2015 15:16:45 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76D2F10DB; Wed, 16 Dec 2015 15:16:45 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGFGieN071988; Wed, 16 Dec 2015 15:16:44 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGFGi8L071987; Wed, 16 Dec 2015 15:16:44 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512161516.tBGFGi8L071987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 16 Dec 2015 15:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292336 - head/sys/netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 15:16:45 -0000 Author: rrs Date: Wed Dec 16 15:16:44 2015 New Revision: 292336 URL: https://svnweb.freebsd.org/changeset/base/292336 Log: Remove redundant extern's that make the ppc compile fail. Thanks Ed Maste for the heads up. Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Dec 16 14:22:00 2015 (r292335) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Dec 16 15:16:44 2015 (r292336) @@ -142,31 +142,6 @@ VNET_DECLARE(int, tcp_insecure_rst); VNET_DECLARE(int, tcp_insecure_syn); #define V_tcp_insecure_syn VNET(tcp_insecure_syn) - - - -extern void tcp_dooptions(struct tcpopt *, u_char *, int, int); -extern void tcp_dropwithreset(struct mbuf *, struct tcphdr *, - struct tcpcb *, int, int); -extern void tcp_pulloutofband(struct socket *, - struct tcphdr *, struct mbuf *, int); -extern void tcp_xmit_timer(struct tcpcb *, int); -extern void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -extern void tcp_mss(struct tcpcb *tp, int offer); -extern void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, - uint16_t type); -extern void cc_conn_init(struct tcpcb *tp); -extern void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); -extern void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); -extern void hhook_run_tcp_est_in(struct tcpcb *tp, - struct tcphdr *th, struct tcpopt *to); - -extern void kmod_tcpstat_inc(int statnum); -#ifdef TCP_SIGNATURE -extern int tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen, - struct tcpopt *to, struct tcphdr *th, u_int tcpbflag); -#endif - static void tcp_do_segment_fastslow(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int, int, uint8_t, int); From owner-svn-src-all@freebsd.org Wed Dec 16 15:17:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F194DA4829A for ; Wed, 16 Dec 2015 15:17:57 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C074213E1 for ; Wed, 16 Dec 2015 15:17:57 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x229.google.com with SMTP id o64so13528665pfb.3 for ; Wed, 16 Dec 2015 07:17:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=9U9jng4fDoasdc7zYT0m+z1SwkoZewktRDafn4qNGtw=; b=qfyP22rpOoMa8B30l01SZwwoxGNXr/FULarwBNPoQPCaG6cE5QEG3ht6VBz1WnaDZi 1dGI80f1twKmoH9u2XGkITRyeoS1R/uCDcWVtcv9hQFj+sXL/TxIZwNDVVi0xV8jIaMH HW9/CVJfW0olzQWU6hUP6dukklZpEDDJFc/Ok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=9U9jng4fDoasdc7zYT0m+z1SwkoZewktRDafn4qNGtw=; b=I4tUbbZOkwoLPB9kcbx4d4qZkvmaMD1664wB6S2m6lE1puwqJr+vM5ZwMAYoOe+wa5 EqddnvTWtePCKCulOBJuql+3sSVPL+mYnbRW/sqezPhb+PmHipuJWuS3ahn7Dawl6gx2 N1DFX4d0mdpn/0vjxZClQfvohszX3BWCL/C7wCoQOf8ac6pQkVRpY7ZFxLSZq/RJSJ6y 03NUSzl+wLAFQgR7iXpJvxd8JWi7XR35Bi3JV79KRuMZk1XsQcEI3c1xSvgoLPx3ZK6n vlbC5jiZUTIVF1jPBdhbqLEewV8Zijx3ltwado504EBe4vkNDV5I1Gs1gS6xFqQRN7WC Xp4A== X-Gm-Message-State: ALoCoQmqk/fOgRhOk9zAhe/yiZAzc3cgLT+qqyDP5YZf5/g35PYi8Isl1lj4gujuPftlxfZr2P1xaiBlIjCg1ayGjrw36pmvsw== X-Received: by 10.98.16.66 with SMTP id y63mr6106308pfi.106.1450279077284; Wed, 16 Dec 2015 07:17:57 -0800 (PST) Received: from [10.0.104.77] (173-164-135-226-SFBA.hfc.comcastbusiness.net. [173.164.135.226]) by smtp.gmail.com with ESMTPSA id tb8sm9956413pab.22.2015.12.16.07.17.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Dec 2015 07:17:56 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks From: Randall Stewart In-Reply-To: Date: Wed, 16 Dec 2015 07:17:49 -0800 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201512160056.tBG0ujqA067178@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 15:17:58 -0000 r292336 should take care of that let me know if it does not.. I am getting on a plane to head back from CA. to S.C. shortly but I will = be online for a couple more hours :-) R On Dec 16, 2015, at 6:00 AM, Ed Maste wrote: > On 16 December 2015 at 00:56, Randall Stewart wrote: >> Author: rrs >> Date: Wed Dec 16 00:56:45 2015 >> New Revision: 292309 >> URL: https://svnweb.freebsd.org/changeset/base/292309 >>=20 >> Log: >> First cut of the modularization of our TCP stack. Still >> to do is to clean up the timer handling using the async-drain. >> Other optimizations may be coming to go with this. Whats here >> will allow differnet tcp implementations (one included). >> Reviewed by: jtl, hiren, transports >> Sponsored by: Netflix Inc. >> Differential Revision: D4055 >=20 > This broke at least powerpc builds: >=20 > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:148: > warning: redundant redeclaration of 'tcp_dooptions' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:736: warning: > previous declaration of 'tcp_dooptions' was here > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:150: > warning: redundant redeclaration of 'tcp_dropwithreset' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:738: warning: > previous declaration of 'tcp_dropwithreset' was here > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:152: > warning: redundant redeclaration of 'tcp_pulloutofband' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:740: warning: > previous declaration of 'tcp_pulloutofband' was here > = /scratch/tmp/emaste/freebsd/sys/modules/tcp/fastpath/../../../netinet/tcp_= stacks/fastpath.c:153: > warning: redundant redeclaration of 'tcp_xmit_timer' > [-Wredundant-decls] > /scratch/tmp/emaste/freebsd/sys/netinet/tcp_var.h:741: warning: > previous declaration of 'tcp_xmit_timer' was here > ... -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Wed Dec 16 15:26:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744F4A489CD; Wed, 16 Dec 2015 15:26:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 441CB1C1D; Wed, 16 Dec 2015 15:26:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGFQVp5074686; Wed, 16 Dec 2015 15:26:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGFQVv3074685; Wed, 16 Dec 2015 15:26:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512161526.tBGFQVv3074685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 16 Dec 2015 15:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292337 - head/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 15:26:32 -0000 Author: ian Date: Wed Dec 16 15:26:31 2015 New Revision: 292337 URL: https://svnweb.freebsd.org/changeset/base/292337 Log: Build mount_smbfs for arm. Also sort the subdirs. Modified: head/usr.sbin/Makefile.arm Modified: head/usr.sbin/Makefile.arm ============================================================================== --- head/usr.sbin/Makefile.arm Wed Dec 16 15:16:44 2015 (r292336) +++ head/usr.sbin/Makefile.arm Wed Dec 16 15:26:31 2015 (r292337) @@ -1,4 +1,5 @@ # $FreeBSD$ -SUBDIR+= ofwdump SUBDIR+= kgmon +SUBDIR+= mount_smbfs +SUBDIR+= ofwdump From owner-svn-src-all@freebsd.org Wed Dec 16 16:08:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55757A48A36; Wed, 16 Dec 2015 16:08:43 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0127.outbound.protection.outlook.com [207.46.100.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EB381B3E; Wed, 16 Dec 2015 16:08:41 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from BL2PR05CA0030.namprd05.prod.outlook.com (10.255.226.30) by BL2PR05MB050.namprd05.prod.outlook.com (10.255.228.146) with Microsoft SMTP Server (TLS) id 15.1.337.19; Wed, 16 Dec 2015 16:08:34 +0000 Received: from BL2FFO11FD027.protection.gbl (2a01:111:f400:7c09::177) by BL2PR05CA0030.outlook.office365.com (2a01:111:e400:c04::30) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Wed, 16 Dec 2015 16:08:34 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11FD027.mail.protection.outlook.com (10.173.161.106) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Wed, 16 Dec 2015 16:08:33 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 16 Dec 2015 07:58:53 -0800 Received: from [172.29.35.15] (nroy-sslvpn-nc.jnpr.net [172.29.35.15]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id tBGFwnD53019; Wed, 16 Dec 2015 07:58:50 -0800 (PST) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/14.5.9.151119 Date: Wed, 16 Dec 2015 10:58:47 -0500 Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks From: "Jonathan T. Looney" Sender: Jonathan Looney To: Randall Stewart , Ed Maste CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Thread-Topic: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks References: <201512160056.tBG0ujqA067178@repo.freebsd.org> <1A3645F3-3287-4CD8-B69D-AC053507D435@netflix.com> In-Reply-To: <1A3645F3-3287-4CD8-B69D-AC053507D435@netflix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD027; 1:ZMchFzZxJtjo+flZqasfMLwFgf1ZYaeXr8w0SFt4oR2DgyCzXIUOcHO664H/YOb0Mx9jslVDYcJakqX41JtgJXHJw1DAsM/2LJMM54y0bmWQxA+euXxM4o37fimNzC29NZfFIPTojLXOow7TeQtGLosaE/pleXh02otI8rF7MPp1npWihpl1dN6Vuc2Z8o4LQsed+59VB+1awVgtST7BBLF2xQymdYxSSsCnckml53LpO6UfO8DfavOuscDLmy+jCbj/mLBfvdnIeyvWYgNcAUDTT7GOYLCaGERR9+tfXnYAX3r3/ZIIzpsnBhSZktRrZQIfY2oaKNCXHz1sjki0t6dyn+gBpSHVxXxzbegeynGWjjYY04kNDMBNT7lPwuCk X-Forefront-Antispam-Report: CIP:66.129.239.19; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(189002)(24454002)(377454003)(50466002)(105596002)(77096005)(46406003)(47776003)(1096002)(1220700001)(106466001)(2950100001)(11100500001)(92566002)(16796002)(23726003)(586003)(230700001)(6806005)(5001770100001)(50986999)(81156007)(76176999)(97736004)(54356999)(86362001)(87936001)(83506001)(19580405001)(19580395003)(5001960100002)(4001350100001)(189998001)(36756003)(69596002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR05MB050; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB050; 2:0GavTiHz0DpyLZEc+UONOoSHVcqIgJf10WvQIr5Z7kwRnDKDA7ue2gRgPjou1wv8j6TTiqwGpnLSa9v+lNuu4hShjEjlOSNjJmKMjL1XrKm43yIIvxDnAym7/VkANwLNY42p2FEmITJF6K6P0kqbKQ==; 3:xe6DdUC3H7YfsC/6vg+q+eTzvIcRGuRM/BxGNb8kPR8dCrGlcSMsPuO9MUpCfv+Q3qtA1u6XaYHcUz8a5NVYD5JrD+TLwtpZREz7RUkw9gYIFPX1+tlHa0T+L/ozzJ/gVNgTeX+Os13tvczTbGMWGlC0zJ4qfeSQ8nqhyAVVhiyqdFrV1eM0CPBixSPsdK6Bspt0mMSYYZwtT+BehXcBsPkvqXva2edjjEonHOrVsBA=; 25:SB+kxok6SF779Yhqe3joiQSeJwNzB7KEhz2SFewMjsYJgVSErlth671TaexfkLxbmVNkstkjDwyC5j67c0vH2aXfp1pYUN9NW3jY4H8YSMxItwxs46qc+PLSQ/KkzT3UmDVIWki2iSzCjc42q3GNn2d89DtCK7KysrkajhdrlDQxn6tBSFRX2uXGEkeZsVgl4mbod1e+hYvbp4w967PpR97ZPRPlWdJsovSWDywM4UGs89Souiv4N+sV6K6UO2Bj X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR05MB050; X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB050; 20:Sy/r3l8q+fEIp7W9pe8q+Hr7TB0jFjUzBXK45RGCvKKzbugD528dx6SYBi7e/wmPn+htoWRU2+sr3S/be3KVE6MGshPn7o6HKa90JD9HRyb5rDn4X6U3aSL1slYkdvvAGs0umzaOFdheLMzt4RBTysATvazeTqRP8pJhwKrc1MLx49uoLxXquJ61W0sV7tH/ePAouZeIz4FaeUWdfoatbwwrSAXYFviP9uXg7AOhM9rgRnItKzjIcT1g+jz6XPzlDcbGeYm87U70qKqQze83a0bsR1G0X4DTsNlOJNs2ygxAkhJDVYghBGXAW2S/YVG5UliwUsBtFlfBTW9hWhc8f4Z2Btvi7atYIkHsV450kCgnX11imd4wyu0NIdmKkBxpXDrMccZMXK1dXGDYsXWwPfvPIRzVWLkH91DUx0TuB3XGu6R8c+x17w2QZTIEVbCl9orRkumdmyvcouYoHpq+QsiSn8AReVQvdDoZuJTemA3xR5y8ayRkq6LGa86p1hzK; 4:MJqC8FGhpe4OBFqLWiS7e4UTPLulZJnfw1uibhoaia/uJ6aYJMAZY+mVWG3yPjI2wh0NPnQY9iS3oFi43S03zIQufAaV+0z/1Yc0lHhu8oHd5eka8wOqDZr5t2y45Nt/MnERxWJfL7qZAzCIVjaOZZ2yA+BgGWHJ/WU5QH3XJw5ML6If/wR7unXKJeHyiHpmK+TXv9MwOwFxKcpBoY+HbsIOAOepvZTB0O4iUtEWZzmUypsDzlM3fwqq9b7uJ5xXXtuontsA+CQbLPSCanabiWbnenN99MfXDk62EgYovOxx0tFpl6y6Zay5SOYNJf1LIX6oCqy4QTEiHOzDqHo7TOvyD2rPF9lT9i1UAyY/H4csEMhULT0X2D/GpNJu34y2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046); SRVR:BL2PR05MB050; BCL:0; PCL:0; RULEID:; SRVR:BL2PR05MB050; X-Forefront-PRVS: 0792DBEAD0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR05MB050; 23:DkuzwxMAwH+jfGEe5Ut6jsgt88E6Bu6+uUhfT5/SnF?= =?us-ascii?Q?4LZWOCt0sW27h5nkvQw+vlocy/GHZ62M2QSXo4NndS6HTNGK3PjbFyVRPpF1?= =?us-ascii?Q?ZW/8m9qeWZqn9PPkDdCibDlsRvzaQhbHiGzpqK7gMzrogfGguh4RH7Gy2/7g?= =?us-ascii?Q?9HU7lPndQmtm6WDYywkOjDQjQnQD6TYX2fx+vdiciOQVzAb7ET4H3HKVeTEm?= =?us-ascii?Q?JM7QVncAvn/UplDEjfwEv1VjNF8r0lxr2cBGRGg4xjE9jRbAeSF4TfW81W04?= =?us-ascii?Q?W7KGnZeVU+l6FE/KnJcSKeHCWx8zRZCCevrZM8wHOoVoD3jgWtkSdncepQbw?= =?us-ascii?Q?xbUR+aXbnwxe8Yrs4yYwX44R8WikVR4r29WtHdLWstKfJWlMQUbgjy7TnXuD?= =?us-ascii?Q?WkUq8KgDT13/YPH/rjx1jK7luHK/PBPzOrueliBMlAdC74Nl1yWYr7xiIgam?= =?us-ascii?Q?xPRG6q41pTiz1qIxA0jnmmqJIkM25/+E4tgww1/tVrbGzi9VUeg0UFHghB77?= =?us-ascii?Q?5WR6OquGdEGqvoaZSn0gzN9J2zj0NTvH8qbIDLvVPpfJglzv+ioVNuUgzbn4?= =?us-ascii?Q?35il5TOlYNnBenhFRzic2euargaXyiE4O4apv3SFL3RyH/hR8uq5ShY2nIxA?= =?us-ascii?Q?ajIr5psTr45HLpVTdkIDHc7wZzd3UxwCHOkWXH9rnxAtb9NIOgZZ+aHTk1pQ?= =?us-ascii?Q?4hl7OrpOmAFQy1slkZpaZVVu99u5THsBWNfoOXZz2naIAA3j6Z+3tfn7kajF?= =?us-ascii?Q?zo6ADh6KJaUlqzzD/3lIlT6tVF7Ix3ms2CxD5+l7I8gEeyf2duK0lTDMhdTS?= =?us-ascii?Q?9g7BdSX5l//nc8qH/U7LhUPI3cXMnB/+jR45bO9/Nu630csPqd7k9qBTC4tn?= =?us-ascii?Q?DtTZfT2UlTrXHQ6FUJqDGJ85ij3IA47HI8HC9c/EdU+8aMZBa7PU+HrKO50e?= =?us-ascii?Q?dpva53Bx0eMrKrg5BK+AC+j/6m+SEO/aPRcIEkvT/aXTlC8IjYh3gAYnj4eR?= =?us-ascii?Q?owMAv4KUTkcVQ4fDRzzUdmT9dl/Txme9r5ksiYeLQmzdxcKjXF6/W/H2gzUe?= =?us-ascii?Q?K3bM8=3D?= X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB050; 5:UB8SWeMvNHDZg4looOi8HZCeCNnPRHWO32tv0wJi/sDNZAleALdvCIVQW2Zd2BOeQjQ9gaI4i7coFKxjohdcA9jZxYq2mHwrWG/Y5RH8sDemgV9p1KCKxNxFZR2L+Rcl8ZcseihShjmMZMh02Jtw8w==; 24:/m56EKwo5RBqarmW6ZDKP9otfNxjWqEoRBmGy4OJbjjvW/c8uPuUfqrWIs0GGOf/F/PTZ0ZGNzHlaz9cPTKsKU1i1xjEdjS3Nb+u2/LI0Sk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2015 16:08:33.6348 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR05MB050 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:08:43 -0000 On Dec 16, 2015, at 10:08 AM, Randall Stewart wrote: > Ahh I think I see this is a difference between our friend > clang and gcc.. since I bet ppc uses gcc not clang :-o This sort of thing seems to happen often enough that it would be nice if there was an option to automatically build two kernels, one with each compiler. Is there already such an option? Jonathan From owner-svn-src-all@freebsd.org Wed Dec 16 16:15:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B63D5A48FFF; Wed, 16 Dec 2015 16:15:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94CCD10C3; Wed, 16 Dec 2015 16:15:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E3134B93C; Wed, 16 Dec 2015 11:15:48 -0500 (EST) From: John Baldwin To: "Jonathan T. Looney" Cc: Randall Stewart , Ed Maste , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks Date: Wed, 16 Dec 2015 08:15:38 -0800 Message-ID: <1627913.WATQQLTEnG@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201512160056.tBG0ujqA067178@repo.freebsd.org> <1A3645F3-3287-4CD8-B69D-AC053507D435@netflix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 16 Dec 2015 11:15:49 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:15:50 -0000 On Wednesday, December 16, 2015 10:58:47 AM Jonathan T. Looney wrote: > On Dec 16, 2015, at 10:08 AM, Randall Stewart wrote: > > Ahh I think I see this is a difference between our friend > > clang and gcc.. since I bet ppc uses gcc not clang :-o > > This sort of thing seems to happen often enough that it would be nice if > there was an option to automatically build two kernels, one with each > compiler. Is there already such an option? make tinderbox effectively does that, but at a bit more expense. amd64 doesn't build GCC 4.2 by default, so the simplest way is to build a kernel for a non-clang platform, e.g.: make TARGET=sparc64 kernel-toolchain make TARGET=sparc64 buildkernel (Note you only need to do the kernel-toolchain step once or after toolchain changes like compiler upgrades.) -- John Baldwin From owner-svn-src-all@freebsd.org Wed Dec 16 16:15:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115E5A49016; Wed, 16 Dec 2015 16:15:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E55B810E8; Wed, 16 Dec 2015 16:15:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0424AB981; Wed, 16 Dec 2015 11:15:53 -0500 (EST) From: John Baldwin To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks Date: Wed, 16 Dec 2015 07:06:31 -0800 Message-ID: <1972466.CRnu3P14jO@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512160056.tBG0ujqA067178@repo.freebsd.org> References: <201512160056.tBG0ujqA067178@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 16 Dec 2015 11:15:53 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:15:54 -0000 On Wednesday, December 16, 2015 12:56:45 AM Randall Stewart wrote: > Author: rrs > Date: Wed Dec 16 00:56:45 2015 > New Revision: 292309 > URL: https://svnweb.freebsd.org/changeset/base/292309 > > Log: > First cut of the modularization of our TCP stack. Still > to do is to clean up the timer handling using the async-drain. > Other optimizations may be coming to go with this. Whats here > will allow differnet tcp implementations (one included). > Reviewed by: jtl, hiren, transports > Sponsored by: Netflix Inc. > Differential Revision: D4055 Have you considered treating TOE as a separate stack? We already have a bit of a split to handle TOE specially. It might be nice if it was able to plug in via this. That might also help flesh out the abstraction a bit by giving another use case. Also, note that the Differential Revision tag should be the full URL to the review (in which case it auto-closes it for you). -- John Baldwin From owner-svn-src-all@freebsd.org Wed Dec 16 16:19:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFE16A491FA; Wed, 16 Dec 2015 16:19:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7802147E; Wed, 16 Dec 2015 16:19:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGJIQe089762; Wed, 16 Dec 2015 16:19:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGJILQ089756; Wed, 16 Dec 2015 16:19:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161619.tBGGJILQ089756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292338 - in head/sys/boot/efi/loader: . arch/amd64 arch/arm arch/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:19:20 -0000 Author: emaste Date: Wed Dec 16 16:19:18 2015 New Revision: 292338 URL: https://svnweb.freebsd.org/changeset/base/292338 Log: UEFI: combine GetMemoryMap and ExitBootServices and retry on error The EFI memory map may change before or during the first ExitBootServices call. In that case ExitBootServices returns an error, and GetMemoryMap and ExitBootServices must be retried. Glue together calls to GetMemoryMap(), ExitBootServices() and storage of (now up-to-date) MODINFOMD_EFI_MAP metadata within a single function. That new function - bi_add_efi_data_and_exit() - uses space previously allocated in bi_load_efi_data() to store the memory map (it will fail if that space is too short). It handles re-calling GetMemoryMap() once to update the map key if necessary. Finally, if ExitBootServices() is successful, it stores the memory map and its header as MODINFOMD_EFI_MAP metadata. ExitBootServices() calls are now done earlier, from within arch- independent bi_load() code. PR: 202455 Submitted by: Ganael LAPLANCHE Reviewed by: kib MFC after: 2 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D4296 Modified: head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c head/sys/boot/efi/loader/arch/arm/exec.c head/sys/boot/efi/loader/arch/arm64/exec.c head/sys/boot/efi/loader/bootinfo.c head/sys/boot/efi/loader/loader_efi.h Modified: head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Wed Dec 16 15:26:31 2015 (r292337) +++ head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Wed Dec 16 16:19:18 2015 (r292338) @@ -174,13 +174,6 @@ elf64_exec(struct preloaded_file *fp) if (err != 0) return(err); - status = BS->ExitBootServices(IH, efi_mapkey); - if (EFI_ERROR(status)) { - printf("%s: ExitBootServices() returned 0x%lx\n", __func__, - (long)status); - return (EINVAL); - } - dev_cleanup(); trampoline(trampstack, efi_copy_finish, kernend, modulep, PT4, Modified: head/sys/boot/efi/loader/arch/arm/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm/exec.c Wed Dec 16 15:26:31 2015 (r292337) +++ head/sys/boot/efi/loader/arch/arm/exec.c Wed Dec 16 16:19:18 2015 (r292338) @@ -82,13 +82,6 @@ __elfN(arm_exec)(struct preloaded_file * printf("modulep: %#x\n", modulep); printf("relocation_offset %llx\n", __elfN(relocation_offset)); - status = BS->ExitBootServices(IH, efi_mapkey); - if (EFI_ERROR(status)) { - printf("%s: ExitBootServices() returned 0x%lx\n", __func__, - (long)status); - return (EINVAL); - } - dev_cleanup(); (*entry)((void *)modulep); Modified: head/sys/boot/efi/loader/arch/arm64/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/exec.c Wed Dec 16 15:26:31 2015 (r292337) +++ head/sys/boot/efi/loader/arch/arm64/exec.c Wed Dec 16 16:19:18 2015 (r292338) @@ -118,13 +118,6 @@ elf64_exec(struct preloaded_file *fp) if (err != 0) return (err); - status = BS->ExitBootServices(IH, efi_mapkey); - if (EFI_ERROR(status)) { - printf("%s: ExitBootServices() returned 0x%lx\n", __func__, - (long)status); - return (EINVAL); - } - /* Clean D-cache under kernel area and invalidate whole I-cache */ clean_addr = efi_translate(fp->f_addr); clean_size = efi_translate(kernendp) - clean_addr; Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Wed Dec 16 15:26:31 2015 (r292337) +++ head/sys/boot/efi/loader/bootinfo.c Wed Dec 16 16:19:18 2015 (r292338) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #endif -UINTN efi_mapkey; - static const char howto_switches[] = "aCdrgDmphsv"; static int howto_masks[] = { RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, @@ -234,12 +232,50 @@ bi_copymodules(vm_offset_t addr) } static int +bi_add_efi_data_and_exit(struct preloaded_file *kfp, + struct efi_map_header *efihdr, size_t efisz, EFI_MEMORY_DESCRIPTOR *mm, + UINTN sz) +{ + UINTN efi_mapkey; + UINTN mmsz; + UINT32 mmver; + EFI_STATUS status; + UINTN retry; + + /* + * It is possible that the first call to ExitBootServices may change + * the map key. Fetch a new map key and retry ExitBootServices in that + * case. + */ + for (retry = 2; retry > 0; retry--) { + status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); + if (EFI_ERROR(status)) { + printf("%s: GetMemoryMap() returned 0x%lx\n", __func__, + (long)status); + return (EINVAL); + } + status = BS->ExitBootServices(IH, efi_mapkey); + if (EFI_ERROR(status) == 0) { + efihdr->memory_size = sz; + efihdr->descriptor_size = mmsz; + efihdr->descriptor_version = mmver; + file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, + efihdr); + return (0); + } + } + printf("ExitBootServices() returned 0x%lx\n", (long)status); + return (EINVAL); +} + +static int bi_load_efi_data(struct preloaded_file *kfp) { EFI_MEMORY_DESCRIPTOR *mm; EFI_PHYSICAL_ADDRESS addr; EFI_STATUS status; size_t efisz; + UINTN efi_mapkey; UINTN mmsz, pages, sz; UINT32 mmver; struct efi_map_header *efihdr; @@ -294,20 +330,8 @@ bi_load_efi_data(struct preloaded_file * efihdr = (struct efi_map_header *)addr; mm = (void *)((uint8_t *)efihdr + efisz); sz = (EFI_PAGE_SIZE * pages) - efisz; - status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); - if (EFI_ERROR(status)) { - printf("%s: GetMemoryMap() returned 0x%lx\n", __func__, - (long)status); - return (EINVAL); - } - - efihdr->memory_size = sz; - efihdr->descriptor_size = mmsz; - efihdr->descriptor_version = mmver; - file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, efihdr); - - return (0); + return (bi_add_efi_data_and_exit(kfp, efihdr, efisz, mm, sz)); } /* Modified: head/sys/boot/efi/loader/loader_efi.h ============================================================================== --- head/sys/boot/efi/loader/loader_efi.h Wed Dec 16 15:26:31 2015 (r292337) +++ head/sys/boot/efi/loader/loader_efi.h Wed Dec 16 16:19:18 2015 (r292338) @@ -44,8 +44,6 @@ ssize_t efi_copyout(const vm_offset_t sr ssize_t efi_readin(const int fd, vm_offset_t dest, const size_t len); void * efi_translate(vm_offset_t ptr); -extern UINTN efi_mapkey; - void efi_copy_finish(void); #endif /* _LOADER_EFI_COPY_H_ */ From owner-svn-src-all@freebsd.org Wed Dec 16 16:40:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68830A49EED; Wed, 16 Dec 2015 16:40:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF291FE5; Wed, 16 Dec 2015 16:40:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGekrF095530; Wed, 16 Dec 2015 16:40:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGekD6095528; Wed, 16 Dec 2015 16:40:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161640.tBGGekD6095528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:40: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: r292339 - in stable/10: . lib 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:40:47 -0000 Author: emaste Date: Wed Dec 16 16:40:45 2015 New Revision: 292339 URL: https://svnweb.freebsd.org/changeset/base/292339 Log: MFC r282821: Remove redundant csu subdir logic The appropriate subdirectories are handled by lib/csu/Makefile. There's no need to duplicate this logic in Makefile.inc1 and lib/Makefile. Sponsored by: The FreeBSD Foundation Modified: stable/10/Makefile.inc1 stable/10/lib/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Wed Dec 16 16:19:18 2015 (r292338) +++ stable/10/Makefile.inc1 Wed Dec 16 16:40:45 2015 (r292339) @@ -1617,13 +1617,7 @@ _prereq_libs= gnu/lib/libssp/libssp_nons # all shared libraries for ELF. # _startup_libs= gnu/lib/csu -.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) -_startup_libs+= lib/csu/${MACHINE_ARCH} -.else -_startup_libs+= lib/csu/${MACHINE_CPUARCH} -.endif +_startup_libs+= lib/csu _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Wed Dec 16 16:19:18 2015 (r292338) +++ stable/10/lib/Makefile Wed Dec 16 16:40:45 2015 (r292339) @@ -8,7 +8,7 @@ # and the main list to avoid needing a SUBDIR_DEPEND line on every library # naming just these few items. -SUBDIR_ORDERED= ${_csu} \ +SUBDIR_ORDERED= csu \ .WAIT \ libc \ libc_nonshared \ @@ -142,16 +142,6 @@ SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} -.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) -_csu=csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/csu/${MACHINE_ARCH}) -_csu=csu/${MACHINE_ARCH} -.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) -_csu=csu/${MACHINE_CPUARCH} -.else -_csu=csu -.endif - # NB: keep these sorted by MK_* knobs .if ${MK_ATM} != "no" From owner-svn-src-all@freebsd.org Wed Dec 16 16:42:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46785A480C5; Wed, 16 Dec 2015 16:42:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC381388; Wed, 16 Dec 2015 16:42:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGgP6i098193; Wed, 16 Dec 2015 16:42:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGgOaX098191; Wed, 16 Dec 2015 16:42:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161642.tBGGgOaX098191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:42:24 +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: r292340 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:42:26 -0000 Author: emaste Date: Wed Dec 16 16:42:24 2015 New Revision: 292340 URL: https://svnweb.freebsd.org/changeset/base/292340 Log: MFC r256859: Don't force 64-bit DWARF2 on MIPS 64-bit debug data is only necessary for objects with greater than 4GB of debug data, and is not used on other 64-bit FreeBSD targets. Modified: stable/10/contrib/binutils/gas/config/tc-mips.c stable/10/contrib/binutils/gas/config/tc-mips.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-mips.c Wed Dec 16 16:40:45 2015 (r292339) +++ stable/10/contrib/binutils/gas/config/tc-mips.c Wed Dec 16 16:42:24 2015 (r292340) @@ -15420,21 +15420,6 @@ MIPS options:\n\ -mno-octeon-useun generate MIPS unaligned load/store instructions\n")); } -enum dwarf2_format -mips_dwarf2_format (void) -{ - if (HAVE_64BIT_SYMBOLS) - { -#ifdef TE_IRIX - return dwarf2_format_64bit_irix; -#else - return dwarf2_format_64bit; -#endif - } - else - return dwarf2_format_32bit; -} - int mips_dwarf2_addr_size (void) { Modified: stable/10/contrib/binutils/gas/config/tc-mips.h ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-mips.h Wed Dec 16 16:40:45 2015 (r292339) +++ stable/10/contrib/binutils/gas/config/tc-mips.h Wed Dec 16 16:42:24 2015 (r292340) @@ -155,10 +155,6 @@ extern void mips_emit_delays (void); extern void mips_enable_auto_align (void); #define md_elf_section_change_hook() mips_enable_auto_align() -enum dwarf2_format; -extern enum dwarf2_format mips_dwarf2_format (void); -#define DWARF2_FORMAT() mips_dwarf2_format () - extern int mips_dwarf2_addr_size (void); #define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size () From owner-svn-src-all@freebsd.org Wed Dec 16 16:44:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2162DA48499; Wed, 16 Dec 2015 16:44:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6B97164B; Wed, 16 Dec 2015 16:44:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGiu0a098350; Wed, 16 Dec 2015 16:44:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGiuf5098346; Wed, 16 Dec 2015 16:44:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161644.tBGGiuf5098346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292341 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:44:58 -0000 Author: emaste Date: Wed Dec 16 16:44:56 2015 New Revision: 292341 URL: https://svnweb.freebsd.org/changeset/base/292341 Log: MFC r289349: mkimg: support fat16b partitions (MBR type 06h) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/mkimg/ebr.c stable/10/usr.bin/mkimg/mbr.c stable/10/usr.bin/mkimg/scheme.c stable/10/usr.bin/mkimg/scheme.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/ebr.c ============================================================================== --- stable/10/usr.bin/mkimg/ebr.c Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/ebr.c Wed Dec 16 16:44:56 2015 (r292341) @@ -39,11 +39,15 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT16B +#define DOSPTYP_FAT16B 0x06 +#endif #ifndef DOSPTYP_FAT32 #define DOSPTYP_FAT32 0x0b #endif static struct mkimg_alias ebr_aliases[] = { + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NONE, 0 } Modified: stable/10/usr.bin/mkimg/mbr.c ============================================================================== --- stable/10/usr.bin/mkimg/mbr.c Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/mbr.c Wed Dec 16 16:44:56 2015 (r292341) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT16B +#define DOSPTYP_FAT16B 0x06 +#endif #ifndef DOSPTYP_FAT32 #define DOSPTYP_FAT32 0x0b #endif @@ -49,6 +52,7 @@ __FBSDID("$FreeBSD$"); static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_EFI, ALIAS_INT2TYPE(DOSPTYP_EFI) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) }, Modified: stable/10/usr.bin/mkimg/scheme.c ============================================================================== --- stable/10/usr.bin/mkimg/scheme.c Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/scheme.c Wed Dec 16 16:44:56 2015 (r292341) @@ -50,6 +50,7 @@ static struct { } scheme_alias[] = { { "ebr", ALIAS_EBR }, { "efi", ALIAS_EFI }, + { "fat16b", ALIAS_FAT16B }, { "fat32", ALIAS_FAT32 }, { "freebsd", ALIAS_FREEBSD }, { "freebsd-boot", ALIAS_FREEBSD_BOOT }, Modified: stable/10/usr.bin/mkimg/scheme.h ============================================================================== --- stable/10/usr.bin/mkimg/scheme.h Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/scheme.h Wed Dec 16 16:44:56 2015 (r292341) @@ -36,6 +36,7 @@ enum alias { /* start */ ALIAS_EBR, ALIAS_EFI, + ALIAS_FAT16B, ALIAS_FAT32, ALIAS_FREEBSD, ALIAS_FREEBSD_BOOT, From owner-svn-src-all@freebsd.org Wed Dec 16 16:46:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5BE2A48573; Wed, 16 Dec 2015 16:46:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7320F1888; Wed, 16 Dec 2015 16:46:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGk8r6098452; Wed, 16 Dec 2015 16:46:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGk81R098451; Wed, 16 Dec 2015 16:46:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161646.tBGGk81R098451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292342 - stable/10/sys/boot/efi/include 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:46:09 -0000 Author: emaste Date: Wed Dec 16 16:46:08 2015 New Revision: 292342 URL: https://svnweb.freebsd.org/changeset/base/292342 Log: MFC r274439: Add the FDT table GUID. This is used to pass the device tree blob from UEFI to the loader in a similar way to the ACPI tables. This will be used on arm64 but is not specific to the architecture. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/efi/include/efiapi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/include/efiapi.h ============================================================================== --- stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:44:56 2015 (r292341) +++ stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:46:08 2015 (r292342) @@ -846,6 +846,8 @@ typedef struct { #define SAL_SYSTEM_TABLE_GUID \ { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define FDT_TABLE_GUID \ + { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; From owner-svn-src-all@freebsd.org Wed Dec 16 16:49:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3535BA48764; Wed, 16 Dec 2015 16:49:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107AA1AA2; Wed, 16 Dec 2015 16:49:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGn0Sw098600; Wed, 16 Dec 2015 16:49:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGn0l9098598; Wed, 16 Dec 2015 16:49:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161649.tBGGn0l9098598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292343 - in stable/10/sys/boot: amd64/efi efi/include 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 16:49:01 -0000 Author: emaste Date: Wed Dec 16 16:48:59 2015 New Revision: 292343 URL: https://svnweb.freebsd.org/changeset/base/292343 Log: MFC r278234: EFI: print more information about EFI Tables. This adds the GUIDs for DXE, HOB, Memory Type Information and Debug Image Info. Modified: stable/10/sys/boot/amd64/efi/main.c stable/10/sys/boot/efi/include/efiapi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/main.c ============================================================================== --- stable/10/sys/boot/amd64/efi/main.c Wed Dec 16 16:46:08 2015 (r292342) +++ stable/10/sys/boot/amd64/efi/main.c Wed Dec 16 16:48:59 2015 (r292343) @@ -54,6 +54,10 @@ EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; EFI_GUID mps = MPS_TABLE_GUID; EFI_GUID netid = EFI_SIMPLE_NETWORK_PROTOCOL; EFI_GUID smbios = SMBIOS_TABLE_GUID; +EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; +EFI_GUID hoblist = HOB_LIST_TABLE_GUID; +EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; +EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_STATUS main(int argc, CHAR16 *argv[]) @@ -274,6 +278,14 @@ command_configuration(int argc, char *ar printf("ACPI 2.0 Table"); else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) printf("SMBIOS Table"); + else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) + printf("DXE Table"); + else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) + printf("HOB List Table"); + else if (!memcmp(guid, &memtype, sizeof(EFI_GUID))) + printf("Memory Type Information Table"); + else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID))) + printf("Debug Image Info Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); @@ -329,7 +341,7 @@ command_mode(int argc, char *argv[]) } if (i != 0) - printf("Choose the mode with \"col \"\n"); + printf("Choose the mode with \"col \"\n"); return (CMD_OK); } Modified: stable/10/sys/boot/efi/include/efiapi.h ============================================================================== --- stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:46:08 2015 (r292342) +++ stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:48:59 2015 (r292343) @@ -88,7 +88,7 @@ EFI_STATUS IN VOID *Buffer ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) ( IN UINTN MemoryMapSize, @@ -103,7 +103,7 @@ EFI_STATUS #define EFI_INTERNAL_PTR 0x00000004 // Pointer to internal runtime data -typedef +typedef EFI_STATUS (EFIAPI *EFI_CONVERT_POINTER) ( IN UINTN DebugDisposition, @@ -168,7 +168,7 @@ EFI_STATUS IN EFI_EVENT Event ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_WAIT_FOR_EVENT) ( IN UINTN NumberOfEvents, @@ -194,8 +194,8 @@ EFI_STATUS #define TPL_APPLICATION 4 #define TPL_CALLBACK 8 -#define TPL_NOTIFY 16 -#define TPL_HIGH_LEVEL 31 +#define TPL_NOTIFY 16 +#define TPL_HIGH_LEVEL 31 typedef EFI_TPL @@ -324,14 +324,14 @@ EFI_STATUS // Image Entry prototype -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_ENTRY_POINT) ( IN EFI_HANDLE ImageHandle, IN struct _EFI_SYSTEM_TABLE *SystemTable ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_LOAD) ( IN BOOLEAN BootPolicy, @@ -342,7 +342,7 @@ EFI_STATUS OUT EFI_HANDLE *ImageHandle ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_START) ( IN EFI_HANDLE ImageHandle, @@ -359,7 +359,7 @@ EFI_STATUS IN CHAR16 *ExitData OPTIONAL ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_UNLOAD) ( IN EFI_HANDLE ImageHandle @@ -495,7 +495,7 @@ EFI_STATUS ); typedef -EFI_STATUS +EFI_STATUS (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) ( IN EFI_GUID *Protocol, IN EFI_EVENT Event, @@ -539,7 +539,7 @@ EFI_STATUS ); typedef -EFI_STATUS +EFI_STATUS (EFIAPI *EFI_CONNECT_CONTROLLER) ( IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, @@ -548,19 +548,19 @@ EFI_STATUS ); typedef -EFI_STATUS +EFI_STATUS (EFIAPI *EFI_DISCONNECT_CONTROLLER)( IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverImageHandle, OPTIONAL IN EFI_HANDLE ChildHandle OPTIONAL - ); + ); -#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 -#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 -#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 -#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 -#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 -#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 +#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 +#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 +#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 +#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 +#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 typedef EFI_STATUS @@ -808,7 +808,7 @@ typedef struct { // EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle; EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer; - EFI_LOCATE_PROTOCOL LocateProtocol; + EFI_LOCATE_PROTOCOL LocateProtocol; EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces; EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces; @@ -849,6 +849,18 @@ typedef struct { #define FDT_TABLE_GUID \ { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } +#define DXE_SERVICES_TABLE_GUID \ + { 0x5ad34ba, 0x6f02, 0x4214, 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } + +#define HOB_LIST_TABLE_GUID \ + { 0x7739f24c, 0x93d7, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + +#define MEMORY_TYPE_INFORMATION_TABLE_GUID \ + { 0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } + +#define DEBUG_IMAGE_INFO_TABLE_GUID \ + { 0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } + typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; VOID *VendorTable; From owner-svn-src-all@freebsd.org Wed Dec 16 17:13:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C281DA497DD; Wed, 16 Dec 2015 17:13:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85B1C1BC1; Wed, 16 Dec 2015 17:13:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGHD9cm007263; Wed, 16 Dec 2015 17:13:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGHD942007257; Wed, 16 Dec 2015 17:13:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512161713.tBGHD942007257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 16 Dec 2015 17:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292344 - in head: . lib/libstand sys/boot/i386/libi386 sys/boot/i386/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 17:13:11 -0000 Author: bapt Date: Wed Dec 16 17:13:09 2015 New Revision: 292344 URL: https://svnweb.freebsd.org/changeset/base/292344 Log: pxeboot: make the tftp loader use the option root-path directive pxeboot in tftp loader mode (when built with LOADER_TFTP_SUPPORT) now prefix all the path to open with the path obtained via the option 'root-path' directive. This allows to be able to use the traditional content /boot out of box. Meaning it now works pretty much like all other loaders. It simplifies hosting hosting multiple version of FreeBSD on a tftp server. As a consequence, pxeboot does not look anymore for a pxeboot.4th (which was never provided) Note: that pxeboot in tftp loader mode is not built by default. Reviewed by: rpokala Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D4590 Modified: head/UPDATING head/lib/libstand/tftp.c head/sys/boot/i386/libi386/libi386.h head/sys/boot/i386/libi386/pxe.c head/sys/boot/i386/loader/main.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Dec 16 16:48:59 2015 (r292343) +++ head/UPDATING Wed Dec 16 17:13:09 2015 (r292344) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20151216: + The tftp loader (pxeboot) now uses the option root-path directive. As a + consequence it no longer looks for a pxeboot.4th file on the tftp + server. Instead it uses the regular /boot infrastructure as with the + other loaders. + 20151211: The code to start recording plug and play data into the modules has been committed. While the old tools will properly build a new kernel, Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Dec 16 16:48:59 2015 (r292343) +++ head/lib/libstand/tftp.c Wed Dec 16 17:13:09 2015 (r292344) @@ -399,6 +399,8 @@ tftp_open(const char *path, struct open_ struct tftp_handle *tftpfile; struct iodesc *io; int res; + size_t pathsize; + const char *extraslash; if (strcmp(f->f_dev->dv_name, "net") != 0) { #ifdef __i386__ @@ -424,10 +426,22 @@ tftp_open(const char *path, struct open_ io->destip = servip; tftpfile->off = 0; - tftpfile->path = strdup(path); + pathsize = (strlen(rootpath) + 1 + strlen(path) + 1) * sizeof(char); + tftpfile->path = malloc(pathsize); if (tftpfile->path == NULL) { - free(tftpfile); - return(ENOMEM); + free(tftpfile); + return(ENOMEM); + } + if (rootpath[strlen(rootpath) - 1] == '/' || path[0] == '/') + extraslash = ""; + else + extraslash = "/"; + res = snprintf(tftpfile->path, pathsize, "%s%s%s", + rootpath, extraslash, path); + if (res < 0 || res > pathsize) { + free(tftpfile->path); + free(tftpfile); + return(ENOMEM); } res = tftp_makereq(tftpfile); Modified: head/sys/boot/i386/libi386/libi386.h ============================================================================== --- head/sys/boot/i386/libi386/libi386.h Wed Dec 16 16:48:59 2015 (r292343) +++ head/sys/boot/i386/libi386/libi386.h Wed Dec 16 17:13:09 2015 (r292344) @@ -123,5 +123,4 @@ int bi_load32(char *args, int *howtop, i int bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, vm_offset_t *kernend, int add_smap); -char *pxe_default_rc(void); void pxe_enable(void *pxeinfo); Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Wed Dec 16 16:48:59 2015 (r292343) +++ head/sys/boot/i386/libi386/pxe.c Wed Dec 16 17:13:09 2015 (r292344) @@ -288,8 +288,10 @@ pxe_open(struct open_file *f, ...) bootp(pxe_sock, BOOTP_PXE); if (rootip.s_addr == 0) rootip.s_addr = bootplayer.sip; +#ifdef LOADER_NFS_SUPPORT if (!rootpath[0]) strcpy(rootpath, PXENFSROOTPATH); +#endif for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) if (rootpath[i] == ':') @@ -317,6 +319,7 @@ pxe_open(struct open_file *f, ...) setenv("boot.nfsroot.path", rootpath, 1); #else setenv("boot.netif.server", inet_ntoa(rootip), 1); + setenv("boot.tftproot.path", rootpath, 1); #endif setenv("dhcp.host-name", hostname, 1); @@ -705,26 +708,3 @@ readudp(struct iodesc *h, void *pkt, siz uh->uh_sport = udpread_p->s_port; return udpread_p->buffer_size; } - -char * -pxe_default_rc(void) -{ - char *rc; - size_t count, rcsz; - - /* XXX It may not be a good idea to modify the PXE boot file. */ - rc = (char *)bootplayer.bootfile; - rcsz = sizeof(bootplayer.bootfile); - - /* Ignore how we define rc and rcsz above -- it can change. */ - if (rcsz < 6) - return (NULL); - if (*rc == '\0') { - strncpy(rc, "pxeboot", rcsz); - rc[rcsz - 1] = '\0'; - } - count = strlen(rc); - strncat(rc, ".4th", rcsz - count - 1); - printf("PXE: loading Forth from %s\n", rc); - return (rc); -} Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Wed Dec 16 16:48:59 2015 (r292343) +++ head/sys/boot/i386/loader/main.c Wed Dec 16 17:13:09 2015 (r292344) @@ -196,11 +196,6 @@ main(void) bios_getsmap(); -#ifdef LOADER_TFTP_SUPPORT - if (kargs->bootflags & KARGS_FLAGS_PXE) - interact(pxe_default_rc()); - else -#endif interact(NULL); /* if we ever get here, it is an error */ From owner-svn-src-all@freebsd.org Wed Dec 16 17:43:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D0AA48B72; Wed, 16 Dec 2015 17:43:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D42121BAE; Wed, 16 Dec 2015 17:43:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x232.google.com with SMTP id mv3so143414049igc.0; Wed, 16 Dec 2015 09:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=9Bc5OS24IwyO7wF5NI6y/DoNGHL3nOZqHkjfU5sNECQ=; b=DSrTWiA2Qi2+F/Ed5yMOqLYnahu42iGPzVF83cSohKJU41a0yhO+p5Bx7KoVHqJOLl 714QL+ooC3HgSh32hh+5EBlkogGqYWNH0vTQbm71Co1xSbIHLwWwVtJ1058OzjENznQI tdbFnj6N8n6zgwYzzPF+KpleH9t4B3p4rJiVQhlfxiF2/BvdK9Qh5V1jE9Dz6fVoRxsa ytoiCk5K8EjooSZfLJjb+TMK5Fcbp1yPDsJvBH1Z8uJOR2HtiRXLExGAgr5t3B8WBi8r dMeYyAuKLOx+TFoxcyhNX/lh+4hjPYBW1Oq1CP1XD/ZTFIs/C7AsADZkSn3sJ713dO5j arDQ== MIME-Version: 1.0 X-Received: by 10.107.10.199 with SMTP id 68mr41097738iok.75.1450287787165; Wed, 16 Dec 2015 09:43:07 -0800 (PST) Received: by 10.36.121.202 with HTTP; Wed, 16 Dec 2015 09:43:06 -0800 (PST) In-Reply-To: <56715486.1000901@freebsd.org> References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> <56715486.1000901@freebsd.org> Date: Wed, 16 Dec 2015 09:43:06 -0800 Message-ID: Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 From: Adrian Chadd To: Steven Hartland Cc: Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 17:43:09 -0000 hi, yeah, switchports at the moment are pure L2 interfaces, they don't have addressing. This may eventually change if etherswitch grows slave switch port support. But I didn't think it was creating ifnet interfaces, only miibusses and mii's for link status. -a On 16 December 2015 at 04:09, Steven Hartland wrot= e: > On 15/12/2015 22:58, Kristof Provost wrote: >>> >>> On 15 Dec 2015, at 23:15, Kristof Provost wrote: >>> Based on the arp_announce() in the backtrace this commit looks like a >>> possible cause. >> >> I see this in arp_announce(): >> KP: arp_announce() ifp->if_addr =3D 0 >> >> So that explains why we panic in 'lladdr =3D IF_LLADDR(ifp);=E2=80=99. >> >> I=E2=80=99ve done a very quick hack: >> diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c >> index 2214542..9b25356 100644 >> --- a/sys/netinet/if_ether.c >> +++ b/sys/netinet/if_ether.c >> @@ -1246,9 +1246,15 @@ arp_announce(struct ifnet *ifp) >> } >> IF_ADDR_RUNLOCK(ifp); >> >> - lladdr =3D IF_LLADDR(ifp); >> - for (i =3D 0; i < cnt; i++) { >> - arp_announce_addr(ifp, head + i, lladdr); >> + printf("KP: %s() ifp =3D %p\n", __FUNCTION__, ifp); >> + printf("KP: %s() ifp->if_addr =3D %p\n", __FUNCTION__, >> ifp->if_addr); >> + >> + if (ifp->if_addr) { >> + printf("KP: %s() ifp->if_addr->ifa_addr =3D %p\n", >> __FUNCTION__, ifp->if_addr->ifa_addr); >> + lladdr =3D IF_LLADDR(ifp); >> + for (i =3D 0; i < cnt; i++) { >> + arp_announce_addr(ifp, head + i, lladdr); >> + } >> } >> free(head, M_TEMP); >> } >> >> With this patch the device boots. I haven=E2=80=99t been able to verify = if >> everything works because of a different issue ("Shared object >> "lib80211.so.1" not found, required by =E2=80=9Cifconfig=E2=80=9D=E2=80= =9D, no doubt just a small >> problem with the freebsd-wifi-build scripts). >> >> Regards, >> Kristof > > Thanks for all the info Kristof appreciated. > > It seems really odd that you're getting a link up event for an interface > that doesn't have a LLA, so I'm wondering if this is the result of an iss= ue > elsewhere which this change brings to light, its as though if_attach hasn= 't > been called. > > Looking at your trace the device seems to be an arswitch. If it never > allocates a LLA to each port then maybe the more correct fix would be to > ensure it IFF_NOARP in if_flags? > > I've attached a patch which should fix if you could test that would be > great, but I'd still like to understand if there is something wrong > elsewhere before I do. > > Regards > Steve > > From owner-svn-src-all@freebsd.org Wed Dec 16 17:43:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9203A48BDC; Wed, 16 Dec 2015 17:43:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2CCD1D1E; Wed, 16 Dec 2015 17:43:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id to4so75518854igc.0; Wed, 16 Dec 2015 09:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=h6UFupoWaAcinP5nVgYotqVkkcC1JQz5yIxGEXus/U8=; b=BAzIAFo3pJZdyxnkduMVz4Gtzm3udWq/dB8/pPcCTbl3zRPmON/xGEUP5p88ke9840 y1eafKPlgVoOr56Lkw6Z3gSz3dAaHmwD/YcmXh5FfsHQiULA6U+qtP6iSBR9R2GWCGYy Ik5bk5DX4fTSJr8oyo8QvUvZ3ERNqU9q8Bj/AQ3NwkQy5GL9Z96vNvkLyNN1mRdIF1Nc 4rDsJTzS6RJbbI5SIl/lIpdYF0dEmEvN5MX0o+tenhRlRQ2P/YYLBj/MW5oSSs1CxcC0 gSlY5lcWNoqPdP69z3duuqEsY70v7f9e87Hbx70bJnRMXWt+sCk6Z/dbGu9fAaDETShp aLSQ== MIME-Version: 1.0 X-Received: by 10.107.162.21 with SMTP id l21mr39803317ioe.123.1450287808310; Wed, 16 Dec 2015 09:43:28 -0800 (PST) Received: by 10.36.121.202 with HTTP; Wed, 16 Dec 2015 09:43:28 -0800 (PST) In-Reply-To: References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> <56715486.1000901@freebsd.org> Date: Wed, 16 Dec 2015 09:43:28 -0800 Message-ID: Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 From: Adrian Chadd To: Steven Hartland Cc: Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 17:43:29 -0000 right, it's: arswitch.c: err = mii_attach(sc->sc_dev, &sc->miibus[phy], sc->ifp[phy], arswitch.c: device_get_nameunit(sc->miibus[phy]), -a From owner-svn-src-all@freebsd.org Wed Dec 16 17:43:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BADAEA48C63; Wed, 16 Dec 2015 17:43:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x22a.google.com (mail-ob0-x22a.google.com [IPv6:2607:f8b0:4003:c01::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 843A21E81; Wed, 16 Dec 2015 17:43:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x22a.google.com with SMTP id no2so37894172obc.3; Wed, 16 Dec 2015 09:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BBmI/CZhoy2W5Uszvytgscz8oJAnu+WdiN0DrCuHWFQ=; b=WhdIMNpF8lDQd4AD1Y3yvLPZKtXvnzFquoFieT9y/zVj+4jg/ztlzIFAYgcf2FVBpw /gTMrL2Q1y2y5lifqrDEnFHybi3Zz8j6FJh2Rmy0BRzeCPYGbt0docLmNy1zFdNIpW3L R2Ssl4jGgxNu3skE/l2gzwUu8zgB48OB/NiLxto3ZCFj/VMXnUG6BRx1ar7CtcCZO5MH 2weMeSzK43LM+MekyDsVQVv/9nw9DsEFGQjNjKNENHJnUXRiL89PsxdOUxNMLS1gaqOu GBnTlqhkJn0U4gEgBiqNUilsB2eg64nK7G7ZrI+fcl8p0bT8M+qshjO0TziuAZwhICbb GgDg== X-Received: by 10.60.82.168 with SMTP id j8mr36783057oey.39.1450287817915; Wed, 16 Dec 2015 09:43:37 -0800 (PST) Received: from [192.168.20.11] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id z3sm2093444oej.1.2015.12.16.09.43.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Dec 2015 09:43:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: <1627913.WATQQLTEnG@ralph.baldwin.cx> Date: Wed, 16 Dec 2015 09:43:34 -0800 Cc: "Jonathan T. Looney" , Randall Stewart , Ed Maste , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201512160056.tBG0ujqA067178@repo.freebsd.org> <1A3645F3-3287-4CD8-B69D-AC053507D435@netflix.com> <1627913.WATQQLTEnG@ralph.baldwin.cx> To: John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 17:43:38 -0000 > On Dec 16, 2015, at 08:15, John Baldwin wrote: >=20 >> On Wednesday, December 16, 2015 10:58:47 AM Jonathan T. Looney wrote: >>> On Dec 16, 2015, at 10:08 AM, Randall Stewart wrote: >>> Ahh I think I see this is a difference between our friend >>> clang and gcc.. since I bet ppc uses gcc not clang :-o >>=20 >> This sort of thing seems to happen often enough that it would be nice if >> there was an option to automatically build two kernels, one with each >> compiler. Is there already such an option? >=20 > make tinderbox effectively does that, but at a bit more expense. amd64 > doesn't build GCC 4.2 by default, so the simplest way is to build a kernel= > for a non-clang platform, e.g.: >=20 > make TARGET=3Dsparc64 kernel-toolchain > make TARGET=3Dsparc64 buildkernel >=20 > (Note you only need to do the kernel-toolchain step once or after toolchai= n > changes like compiler upgrades.) I run make tinderbox on ref10-amd64/ref11-amd64 periodically because (unfort= unately) Jenkins has been largely unreachable via the web interface for the p= ast few weeks. It's good to use those hosts if you want to do a final compile test run. Cheers!= From owner-svn-src-all@freebsd.org Wed Dec 16 17:44:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AB7A48D44; Wed, 16 Dec 2015 17:44:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66B0E1068; Wed, 16 Dec 2015 17:44:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id to18so58538045igc.0; Wed, 16 Dec 2015 09:44:32 -0800 (PST) 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=VazcnaIPQyF23xU9XEPbHhG3JhFFO3QPy7+jfH/+chY=; b=v9gm67fY1eBSctVCaVFrDkZzw+h3Dnt0EqXJZ67swuV2gmWbSYKDqOh1zeSTlGWw8G 9Zv2i2t2ZJrQZJtSaFEb8ShUr/qhvMX3ePaVhnZHR8N4HSt93E1QXmixxrZ4pHUYiMMX b4sJPWbecRmMFgmpWqGRWmwKm0YVmJ1antUNEH7SsYwKO1cunxhdJxjUiwGiHG789ST+ vqC93/fD/nY0rTGj/2ysATaLxLzy6M0H3n9H2k4AaZxxpNw0V+wwJvp50rsubNE+58VA JJMZC1KdyzBzRQA4m3ZpCGDJWwUeaQTfBRoggl7vY2pydbik9G+4v89nizN5dpjRf5WQ rmug== MIME-Version: 1.0 X-Received: by 10.107.10.199 with SMTP id 68mr41104471iok.75.1450287871855; Wed, 16 Dec 2015 09:44:31 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Wed, 16 Dec 2015 09:44:31 -0800 (PST) In-Reply-To: <20151216080154.GP3625@kib.kiev.ua> References: <201512160013.tBG0DGhd048910@repo.freebsd.org> <20151216080154.GP3625@kib.kiev.ua> Date: Wed, 16 Dec 2015 09:44:31 -0800 X-Google-Sender-Auth: Ju4Qxxd74R12lDVg_P5143SEndQ Message-ID: Subject: Re: svn commit: r292299 - head/sys/kern From: Adrian Chadd To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 17:44:32 -0000 On 16 December 2015 at 00:01, Konstantin Belousov wrote: > On Wed, Dec 16, 2015 at 12:13:16AM +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Wed Dec 16 00:13:16 2015 >> New Revision: 292299 >> URL: https://svnweb.freebsd.org/changeset/base/292299 >> >> Log: >> Don't call wakeup if we're just returning reserved space; just >> return the reservation and wait for more space to appear. > Issue which is supposedly fixed by the commit is not due to the possibly > excessive wakeups. bufspace_release() and bufspace_wakeup() clear > the needsbuffer variable, while the code flow in getnewbuf() calls > bufspace_wait() to wait for the condition, which prevented the buffer > allocation from succeeding, to pass. Right. There's still some more work to do there to chase issues down so I can remove that sched_yield() workaround I added. > >> >> Submitted by: jeff >> Reviewed by: kib >> >> Modified: >> head/sys/kern/vfs_bio.c >> >> Modified: head/sys/kern/vfs_bio.c >> ============================================================================== >> --- head/sys/kern/vfs_bio.c Wed Dec 16 00:09:57 2015 (r292298) >> +++ head/sys/kern/vfs_bio.c Wed Dec 16 00:13:16 2015 (r292299) >> @@ -2909,7 +2909,7 @@ getnewbuf(struct vnode *vp, int slpflag, >> } while(buf_scan(false) == 0); >> >> if (reserved) >> - bufspace_release(maxsize); >> + atomic_subtract_long(&bufspace, maxsize); >> if (bp != NULL) { >> bp->b_flags |= B_INVAL; >> brelse(bp); > From owner-svn-src-all@freebsd.org Wed Dec 16 17:45:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F20FA48DC4; Wed, 16 Dec 2015 17:45:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B62B11D8; Wed, 16 Dec 2015 17:45:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGHj3P9016078; Wed, 16 Dec 2015 17:45:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGHj3Xh016077; Wed, 16 Dec 2015 17:45:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512161745.tBGHj3Xh016077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 16 Dec 2015 17:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292345 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 17:45:04 -0000 Author: bapt Date: Wed Dec 16 17:45:03 2015 New Revision: 292345 URL: https://svnweb.freebsd.org/changeset/base/292345 Log: Use human readable representation of ip for the pxeboot.ip kenv While here use colon as a separator for pxeboot.hwaddr kenv Sponsored by: Gandi.net Modified: head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Wed Dec 16 17:13:09 2015 (r292344) +++ head/sys/boot/i386/libi386/pxe.c Wed Dec 16 17:45:03 2015 (r292345) @@ -323,10 +323,9 @@ pxe_open(struct open_file *f, ...) #endif setenv("dhcp.host-name", hostname, 1); - sprintf(temp, "%08X", ntohl(myip.s_addr)); - setenv("pxeboot.ip", temp, 1); + setenv("pxeboot.ip", inet_ntoa(myip), 1); if (bootplayer.Hardware == ETHER_TYPE) { - sprintf(temp, "%6D", bootplayer.CAddr, "-"); + sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("pxeboot.hwaddr", temp, 1); } } From owner-svn-src-all@freebsd.org Wed Dec 16 19:01:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3894A48083; Wed, 16 Dec 2015 19:01:16 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 814EC1A05; Wed, 16 Dec 2015 19:01:16 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGJ1Fmo036898; Wed, 16 Dec 2015 19:01:15 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGJ1FQr036890; Wed, 16 Dec 2015 19:01:15 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201512161901.tBGJ1FQr036890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 16 Dec 2015 19:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292348 - in stable/10: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/ia64/include sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 19:01:16 -0000 Author: ken Date: Wed Dec 16 19:01:14 2015 New Revision: 292348 URL: https://svnweb.freebsd.org/changeset/base/292348 Log: MFC r291716, r291724, r291741, r291742 In addition to those revisions, add this change to a file that is not in head: sys/ia64/include/bus.h: Guard kernel-only parts of the ia64 machine/bus.h header with #ifdef _KERNEL. This allows userland programs to include to get the definition of bus_addr_t and bus_size_t. ------------------------------------------------------------------------ r291716 | ken | 2015-12-03 15:54:55 -0500 (Thu, 03 Dec 2015) | 257 lines Add asynchronous command support to the pass(4) driver, and the new camdd(8) utility. CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and completed CCBs may be retrieved via the CAMIOGET ioctl. User processes can use poll(2) or kevent(2) to get notification when I/O has completed. While the existing CAMIOCOMMAND blocking ioctl interface only supports user virtual data pointers in a CCB (generally only one per CCB), the new CAMIOQUEUE ioctl supports user virtual and physical address pointers, as well as user virtual and physical scatter/gather lists. This allows user applications to have more flexibility in their data handling operations. Kernel memory for data transferred via the queued interface is allocated from the zone allocator in MAXPHYS sized chunks, and user data is copied in and out. This is likely faster than the vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in configurations with many processors (there are more TLB shootdowns caused by the mapping/unmapping operation) but may not be as fast as running with unmapped I/O. The new memory handling model for user requests also allows applications to send CCBs with request sizes that are larger than MAXPHYS. The pass(4) driver now limits queued requests to the I/O size listed by the SIM driver in the maxio field in the Path Inquiry (XPT_PATH_INQ) CCB. There are some things things would be good to add: 1. Come up with a way to do unmapped I/O on multiple buffers. Currently the unmapped I/O interface operates on a struct bio, which includes only one address and length. It would be nice to be able to send an unmapped scatter/gather list down to busdma. This would allow eliminating the copy we currently do for data. 2. Add an ioctl to list currently outstanding CCBs in the various queues. 3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do that. 4. Test physical address support. Virtual pointers and scatter gather lists have been tested, but I have not yet tested physical addresses or scatter/gather lists. 5. Investigate multiple queue support. At the moment there is one queue of commands per pass(4) device. If multiple processes open the device, they will submit I/O into the same queue and get events for the same completions. This is probably the right model for most applications, but it is something that could be changed later on. Also, add a new utility, camdd(8) that uses the asynchronous pass(4) driver interface. This utility is intended to be a basic data transfer/copy utility, a simple benchmark utility, and an example of how to use the asynchronous pass(4) interface. It can copy data to and from pass(4) devices using any target queue depth, starting offset and blocksize for the input and ouptut devices. It currently only supports SCSI devices, but could be easily extended to support ATA devices. It can also copy data to and from regular files, block devices, tape devices, pipes, stdin, and stdout. It does not support queueing multiple commands to any of those targets, since it uses the standard read(2)/write(2)/writev(2)/readv(2) system calls. The I/O is done by two threads, one for the reader and one for the writer. The reader thread sends completed read requests to the writer thread in strictly sequential order, even if they complete out of order. That could be modified later on for random I/O patterns or slightly out of order I/O. camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from the pass(4) driver and also to send request notifications internally. For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR) per CAM CCB on the reading side, and a scatter/gather list (CAM_DATA_SG) on the writing side. In addition to testing both interfaces, this makes any potential reblocking of I/O easier. No data is copied between the reader and the writer, but rather the reader's buffers are split into multiple I/O requests or combined into a single I/O request depending on the input and output blocksize. For the file I/O path, camdd(8) also uses a single buffer (read(2), write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list (readv(2), writev(2), preadv(2), pwritev(2)) on writes. Things that would be nice to do for camdd(8) eventually: 1. Add support for I/O pattern generation. Patterns like all zeros, all ones, LBA-based patterns, random patterns, etc. Right Now you can always use /dev/zero, /dev/random, etc. 2. Add support for a "sink" mode, so we do only reads with no writes. Right now, you can use /dev/null. 3. Add support for automatic queue depth probing, so that we can figure out the right queue depth on the input and output side for maximum throughput. At the moment it defaults to 6. 4. Add support for SATA device passthrough I/O. 5. Add support for random LBAs and/or lengths on the input and output sides. 6. Track average per-I/O latency and busy time. The busy time and latency could also feed in to the automatic queue depth determination. sys/cam/scsi/scsi_pass.h: Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue and fetch asynchronous CAM CCBs respectively. Although these ioctls do not have a declared argument, they both take a union ccb pointer. If we declare a size here, the ioctl code in sys/kern/sys_generic.c will malloc and free a buffer for either the CCB or the CCB pointer (depending on how it is declared). Since we have to keep a copy of the CCB (which is fairly large) anyway, having the ioctl malloc and free a CCB for each call is wasteful. sys/cam/scsi/scsi_pass.c: Add asynchronous CCB support. Add two new ioctls, CAMIOQUEUE and CAMIOGET. CAMIOQUEUE adds a CCB to the incoming queue. The CCB is executed immediately (and moved to the active queue) if it is an immediate CCB, but otherwise it will be executed in passstart() when a CCB is available from the transport layer. When CCBs are completed (because they are immediate or passdone() if they are queued), they are put on the done queue. If we get the final close on the device before all pending I/O is complete, all active I/O is moved to the abandoned queue and we increment the peripheral reference count so that the peripheral driver instance doesn't go away before all pending I/O is done. The new passcreatezone() function is called on the first call to the CAMIOQUEUE ioctl on a given device to allocate the UMA zones for I/O requests and S/G list buffers. This may be good to move off to a taskqueue at some point. The new passmemsetup() function allocates memory and scatter/gather lists to hold the user's data, and copies in any data that needs to be written. For virtual pointers (CAM_DATA_VADDR), the kernel buffer is malloced from the new pass(4) driver malloc bucket. For virtual scatter/gather lists (CAM_DATA_SG), buffers are allocated from a new per-pass(9) UMA zone in MAXPHYS-sized chunks. Physical pointers are passed in unchanged. We have support for up to 16 scatter/gather segments (for the user and kernel S/G lists) in the default struct pass_io_req, so requests with longer S/G lists require an extra kernel malloc. The new passcopysglist() function copies a user scatter/gather list to a kernel scatter/gather list. The number of elements in each list may be different, but (obviously) the amount of data stored has to be identical. The new passmemdone() function copies data out for the CAM_DATA_VADDR and CAM_DATA_SG cases. The new passiocleanup() function restores data pointers in user CCBs and frees memory. Add new functions to support kqueue(2)/kevent(2): passreadfilt() tells kevent whether or not the done queue is empty. passkqfilter() adds a knote to our list. passreadfiltdetach() removes a knote from our list. Add a new function, passpoll(), for poll(2)/select(2) to use. Add devstat(9) support for the queued CCB path. sys/cam/ata/ata_da.c: Add support for the BIO_VLIST bio type. sys/cam/cam_ccb.h: Add a new enumeration for the xflags field in the CCB header. (This doesn't change the CCB header, just adds an enumeration to use.) sys/cam/cam_xpt.c: Add a new function, xpt_setup_ccb_flags(), that allows specifying CCB flags. sys/cam/cam_xpt.h: Add a prototype for xpt_setup_ccb_flags(). sys/cam/scsi/scsi_da.c: Add support for BIO_VLIST. sys/dev/md/md.c: Add BIO_VLIST support to md(4). sys/geom/geom_disk.c: Add BIO_VLIST support to the GEOM disk class. Re-factor the I/O size limiting code in g_disk_start() a bit. sys/kern/subr_bus_dma.c: Change _bus_dmamap_load_vlist() to take a starting offset and length. Add a new function, _bus_dmamap_load_pages(), that will load a list of physical pages starting at an offset. Update _bus_dmamap_load_bio() to allow loading BIO_VLIST bios. Allow unmapped I/O to start at an offset. sys/kern/subr_uio.c: Add two new functions, physcopyin_vlist() and physcopyout_vlist(). sys/pc98/include/bus.h: Guard kernel-only parts of the pc98 machine/bus.h header with #ifdef _KERNEL. This allows userland programs to include to get the definition of bus_addr_t and bus_size_t. sys/sys/bio.h: Add a new bio flag, BIO_VLIST. sys/sys/uio.h: Add prototypes for physcopyin_vlist() and physcopyout_vlist(). share/man/man4/pass.4: Document the CAMIOQUEUE and CAMIOGET ioctls. usr.sbin/Makefile: Add camdd. usr.sbin/camdd/Makefile: Add a makefile for camdd(8). usr.sbin/camdd/camdd.8: Man page for camdd(8). usr.sbin/camdd/camdd.c: The new camdd(8) utility. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r291724 | ken | 2015-12-03 17:07:01 -0500 (Thu, 03 Dec 2015) | 6 lines Fix typos in the camdd(8) usage() function output caused by an error in my diff filter script. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r291741 | ken | 2015-12-03 22:38:35 -0500 (Thu, 03 Dec 2015) | 10 lines Fix g_disk_vlist_limit() to work properly with deletes. Add a new bp argument to g_disk_maxsegs(), and add a new function, g_disk_maxsize() tha will properly determine the maximum I/O size for a delete or non-delete bio. Submitted by: will Sponsored by: Spectra Logic ------------------------------------------------------------------------ ------------------------------------------------------------------------ r291742 | ken | 2015-12-03 22:44:12 -0500 (Thu, 03 Dec 2015) | 5 lines Fix a style issue in g_disk_limit(). Noticed by: bdrewery ------------------------------------------------------------------------ Sponsored by: Spectra Logic Added: stable/10/usr.sbin/camdd/ - copied from r291716, head/usr.sbin/camdd/ Modified: stable/10/share/man/man4/pass.4 stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/cam_ccb.h stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/cam_xpt.h stable/10/sys/cam/scsi/scsi_da.c stable/10/sys/cam/scsi/scsi_pass.c stable/10/sys/cam/scsi/scsi_pass.h stable/10/sys/dev/md/md.c stable/10/sys/geom/geom_disk.c stable/10/sys/geom/geom_io.c stable/10/sys/ia64/include/bus.h stable/10/sys/kern/subr_bus_dma.c stable/10/sys/kern/subr_uio.c stable/10/sys/pc98/include/bus.h stable/10/sys/sys/bio.h stable/10/sys/sys/uio.h stable/10/usr.sbin/Makefile stable/10/usr.sbin/camdd/camdd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/pass.4 ============================================================================== --- stable/10/share/man/man4/pass.4 Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/share/man/man4/pass.4 Wed Dec 16 19:01:14 2015 (r292348) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 1998 +.Dd March 17, 2015 .Dt PASS 4 .Os .Sh NAME @@ -53,9 +53,13 @@ The .Nm driver attaches to every .Tn SCSI +and +.Tn ATA device found in the system. Since it attaches to every device, it provides a generic means of accessing .Tn SCSI +and +.Tn ATA devices, and allows the user to access devices which have no "standard" peripheral driver associated with them. .Sh KERNEL CONFIGURATION @@ -65,10 +69,12 @@ device in the kernel; .Nm devices are automatically allocated as .Tn SCSI +and +.Tn ATA devices are found. .Sh IOCTLS -.Bl -tag -width 012345678901234 -.It CAMIOCOMMAND +.Bl -tag -width 5n +.It CAMIOCOMMAND union ccb * This ioctl takes most kinds of CAM CCBs and passes them through to the CAM transport layer for action. Note that some CCB types are not allowed @@ -79,7 +85,7 @@ Some examples of xpt-only CCBs are XPT_S XPT_DEV_MATCH, XPT_RESET_BUS, XPT_SCAN_LUN, XPT_ENG_INQ, and XPT_ENG_EXEC. These CCB types have various attributes that make it illogical or impossible to service them through the passthrough interface. -.It CAMGETPASSTHRU +.It CAMGETPASSTHRU union ccb * This ioctl takes an XPT_GDEVLIST CCB, and returns the passthrough device corresponding to the device in question. Although this ioctl is available through the @@ -90,6 +96,109 @@ ioctl. It is probably more useful to issue this ioctl through the .Xr xpt 4 device. +.It CAMIOQUEUE union ccb * +Queue a CCB to the +.Xr pass 4 +driver to be executed asynchronously. +The caller may use +.Xr select 2 , +.Xr poll 2 +or +.Xr kevent 2 +to receive notification when the CCB has completed. +.Pp +This ioctl takes most CAM CCBs, but some CCB types are not allowed through +the pass device, and must be sent through the +.Xr xpt 4 +device instead. +Some examples of xpt-only CCBs are XPT_SCAN_BUS, +XPT_DEV_MATCH, XPT_RESET_BUS, XPT_SCAN_LUN, XPT_ENG_INQ, and XPT_ENG_EXEC. +These CCB types have various attributes that make it illogical or +impossible to service them through the passthrough interface. +.Pp +Although the +.Dv CAMIOQUEUE +ioctl is not defined to take an argument, it does require a +pointer to a union ccb. +It is not defined to take an argument to avoid an extra malloc and copy +inside the generic +.Xr ioctl 2 +handler. +.pp +The completed CCB will be returned via the +.Dv CAMIOGET +ioctl. +An error will only be returned from the +.Dv CAMIOQUEUE +ioctl if there is an error allocating memory for the request or copying +memory from userland. +All other errors will be reported as standard CAM CCB status errors. +Since the CCB is not copied back to the user process from the pass driver +in the +.Dv CAMIOQUEUE +ioctl, the user's passed-in CCB will not be modfied. +This is the case even with immediate CCBs. +Instead, the completed CCB must be retrieved via the +.Dv CAMIOGET +ioctl and the status examined. +.Pp +Multiple CCBs may be queued via the +.Dv CAMIOQUEUE +ioctl at any given time, and they may complete in a different order than +the order that they were submitted. +The caller must take steps to identify CCBs that are queued and completed. +The +.Dv periph_priv +structure inside struct ccb_hdr is available for userland use with the +.Dv CAMIOQUEUE +and +.Dv CAMIOGET +ioctls, and will be preserved across calls. +Also, the periph_links linked list pointers inside struct ccb_hdr are +available for userland use with the +.Dv CAMIOQUEUE +and +.Dv CAMIOGET +ioctls and will be preserved across calls. +.It CAMIOGET union ccb * +Retrieve completed CAM CCBs queued via the +.Dv CAMIOQUEUE +ioctl. +An error will only be returned from the +.Dv CAMIOGET +ioctl if the +.Xr pass 4 +driver fails to copy data to the user process or if there are no completed +CCBs available to retrieve. +If no CCBs are available to retrieve, +errno will be set to +.Dv ENOENT . +.Pp +All other errors will be reported as standard CAM CCB status errors. +.Pp +Although the +.Dv CAMIOGET +ioctl is not defined to take an argument, it does require a +pointer to a union ccb. +It is not defined to take an argument to avoid an extra malloc and copy +inside the generic +.Xr ioctl 2 +handler. +.Pp +The pass driver will report via +.Xr select 2 , +.Xr poll 2 +or +.Xr kevent 2 +when a CCB has completed. +One CCB may be retrieved per +.Dv CAMIOGET +call. +CCBs may be returned in an order different than the order they were +submitted. +So the caller should use the +.Dv periph_priv +area inside the CCB header to store pointers to identifying information. .El .Sh FILES .Bl -tag -width /dev/passn -compact @@ -103,18 +212,21 @@ CAM subsystem. .Sh DIAGNOSTICS None. .Sh SEE ALSO +.Xr kqueue 2 , +.Xr poll 2 , +.Xr select 2 , .Xr cam 3 , .Xr cam 4 , .Xr cam_cdbparse 3 , +.Xr cd 4 , +.Xr ctl 4 , +.Xr da 4 , +.Xr sa 4 , .Xr xpt 4 , -.Xr camcontrol 8 +.Xr camcontrol 8 , +.Xr camdd 8 .Sh HISTORY The CAM passthrough driver first appeared in .Fx 3.0 . .Sh AUTHORS .An Kenneth Merry Aq ken@FreeBSD.org -.Sh BUGS -It might be nice to have a way to asynchronously send CCBs through the -passthrough driver. -This would probably require some sort of read/write -interface or an asynchronous ioctl interface. Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/ata/ata_da.c Wed Dec 16 19:01:14 2015 (r292348) @@ -1573,12 +1573,26 @@ adastart(struct cam_periph *periph, unio } switch (bp->bio_cmd) { case BIO_WRITE: - softc->flags |= ADA_FLAG_DIRTY; - /* FALLTHROUGH */ case BIO_READ: { uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; + void *data_ptr; + int rw_op; + + if (bp->bio_cmd == BIO_WRITE) { + softc->flags |= ADA_FLAG_DIRTY; + rw_op = CAM_DIR_OUT; + } else { + rw_op = CAM_DIR_IN; + } + + data_ptr = bp->bio_data; + if ((bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0) { + rw_op |= CAM_DATA_BIO; + data_ptr = bp; + } + #ifdef ADA_TEST_FAILURE int fail = 0; @@ -1623,12 +1637,9 @@ adastart(struct cam_periph *periph, unio cam_fill_ataio(ataio, ada_retry_count, adadone, - (bp->bio_cmd == BIO_READ ? CAM_DIR_IN : - CAM_DIR_OUT) | ((bp->bio_flags & BIO_UNMAPPED) - != 0 ? CAM_DATA_BIO : 0), + rw_op, tag_code, - ((bp->bio_flags & BIO_UNMAPPED) != 0) ? (void *)bp : - bp->bio_data, + data_ptr, bp->bio_bcount, ada_default_timeout*1000); Modified: stable/10/sys/cam/cam_ccb.h ============================================================================== --- stable/10/sys/cam/cam_ccb.h Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/cam_ccb.h Wed Dec 16 19:01:14 2015 (r292348) @@ -111,6 +111,9 @@ typedef enum { typedef enum { CAM_EXTLUN_VALID = 0x00000001,/* 64bit lun field is valid */ + CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ + CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ + CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/cam_xpt.c Wed Dec 16 19:01:14 2015 (r292348) @@ -3337,7 +3337,8 @@ xpt_merge_ccb(union ccb *master_ccb, uni } void -xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority) +xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, struct cam_path *path, + u_int32_t priority, u_int32_t flags) { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_setup_ccb\n")); @@ -3355,10 +3356,16 @@ xpt_setup_ccb(struct ccb_hdr *ccb_h, str ccb_h->target_lun = CAM_TARGET_WILDCARD; } ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; - ccb_h->flags = 0; + ccb_h->flags = flags; ccb_h->xflags = 0; } +void +xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority) +{ + xpt_setup_ccb_flags(ccb_h, path, priority, /*flags*/ 0); +} + /* Path manipulation functions */ cam_status xpt_create_path(struct cam_path **new_path_ptr, struct cam_periph *perph, Modified: stable/10/sys/cam/cam_xpt.h ============================================================================== --- stable/10/sys/cam/cam_xpt.h Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/cam_xpt.h Wed Dec 16 19:01:14 2015 (r292348) @@ -70,6 +70,10 @@ void xpt_action_default(union ccb *new union ccb *xpt_alloc_ccb(void); union ccb *xpt_alloc_ccb_nowait(void); void xpt_free_ccb(union ccb *free_ccb); +void xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, + struct cam_path *path, + u_int32_t priority, + u_int32_t flags); void xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority); Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/scsi/scsi_da.c Wed Dec 16 19:01:14 2015 (r292348) @@ -2332,29 +2332,40 @@ skipstate: switch (bp->bio_cmd) { case BIO_WRITE: - softc->flags |= DA_FLAG_DIRTY; - /* FALLTHROUGH */ case BIO_READ: + { + void *data_ptr; + int rw_op; + + if (bp->bio_cmd == BIO_WRITE) { + softc->flags |= DA_FLAG_DIRTY; + rw_op = SCSI_RW_WRITE; + } else { + rw_op = SCSI_RW_READ; + } + + data_ptr = bp->bio_data; + if ((bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0) { + rw_op |= SCSI_RW_BIO; + data_ptr = bp; + } + scsi_read_write(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone, /*tag_action*/tag_code, - /*read_op*/(bp->bio_cmd == BIO_READ ? - SCSI_RW_READ : SCSI_RW_WRITE) | - ((bp->bio_flags & BIO_UNMAPPED) != 0 ? - SCSI_RW_BIO : 0), + rw_op, /*byte2*/0, softc->minimum_cmd_size, /*lba*/bp->bio_pblkno, /*block_count*/bp->bio_bcount / softc->params.secsize, - /*data_ptr*/ (bp->bio_flags & - BIO_UNMAPPED) != 0 ? (void *)bp : - bp->bio_data, + data_ptr, /*dxfer_len*/ bp->bio_bcount, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); break; + } case BIO_FLUSH: /* * BIO_FLUSH doesn't currently communicate Modified: stable/10/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pass.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/scsi/scsi_pass.c Wed Dec 16 19:01:14 2015 (r292348) @@ -28,27 +28,39 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include +#include #include #include -#include -#include -#include -#include +#include #include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include + +#include #include #include #include #include +#include #include #include -#include #include +#include #include #include @@ -57,7 +69,11 @@ typedef enum { PASS_FLAG_OPEN = 0x01, PASS_FLAG_LOCKED = 0x02, PASS_FLAG_INVALID = 0x04, - PASS_FLAG_INITIAL_PHYSPATH = 0x08 + PASS_FLAG_INITIAL_PHYSPATH = 0x08, + PASS_FLAG_ZONE_INPROG = 0x10, + PASS_FLAG_ZONE_VALID = 0x20, + PASS_FLAG_UNMAPPED_CAPABLE = 0x40, + PASS_FLAG_ABANDONED_REF_SET = 0x80 } pass_flags; typedef enum { @@ -65,38 +81,104 @@ typedef enum { } pass_state; typedef enum { - PASS_CCB_BUFFER_IO + PASS_CCB_BUFFER_IO, + PASS_CCB_QUEUED_IO } pass_ccb_types; #define ccb_type ppriv_field0 -#define ccb_bp ppriv_ptr1 +#define ccb_ioreq ppriv_ptr1 -struct pass_softc { - pass_state state; - pass_flags flags; - u_int8_t pd_type; - union ccb saved_ccb; - int open_count; - u_int maxio; - struct devstat *device_stats; - struct cdev *dev; - struct cdev *alias_dev; - struct task add_physpath_task; +/* + * The maximum number of memory segments we preallocate. + */ +#define PASS_MAX_SEGS 16 + +typedef enum { + PASS_IO_NONE = 0x00, + PASS_IO_USER_SEG_MALLOC = 0x01, + PASS_IO_KERN_SEG_MALLOC = 0x02, + PASS_IO_ABANDONED = 0x04 +} pass_io_flags; + +struct pass_io_req { + union ccb ccb; + union ccb *alloced_ccb; + union ccb *user_ccb_ptr; + camq_entry user_periph_links; + ccb_ppriv_area user_periph_priv; + struct cam_periph_map_info mapinfo; + pass_io_flags flags; + ccb_flags data_flags; + int num_user_segs; + bus_dma_segment_t user_segs[PASS_MAX_SEGS]; + int num_kern_segs; + bus_dma_segment_t kern_segs[PASS_MAX_SEGS]; + bus_dma_segment_t *user_segptr; + bus_dma_segment_t *kern_segptr; + int num_bufs; + uint32_t dirs[CAM_PERIPH_MAXMAPS]; + uint32_t lengths[CAM_PERIPH_MAXMAPS]; + uint8_t *user_bufs[CAM_PERIPH_MAXMAPS]; + uint8_t *kern_bufs[CAM_PERIPH_MAXMAPS]; + struct bintime start_time; + TAILQ_ENTRY(pass_io_req) links; }; +struct pass_softc { + pass_state state; + pass_flags flags; + u_int8_t pd_type; + union ccb saved_ccb; + int open_count; + u_int maxio; + struct devstat *device_stats; + struct cdev *dev; + struct cdev *alias_dev; + struct task add_physpath_task; + struct task shutdown_kqueue_task; + struct selinfo read_select; + TAILQ_HEAD(, pass_io_req) incoming_queue; + TAILQ_HEAD(, pass_io_req) active_queue; + TAILQ_HEAD(, pass_io_req) abandoned_queue; + TAILQ_HEAD(, pass_io_req) done_queue; + struct cam_periph *periph; + char zone_name[12]; + char io_zone_name[12]; + uma_zone_t pass_zone; + uma_zone_t pass_io_zone; + size_t io_zone_size; +}; static d_open_t passopen; static d_close_t passclose; static d_ioctl_t passioctl; static d_ioctl_t passdoioctl; +static d_poll_t passpoll; +static d_kqfilter_t passkqfilter; +static void passreadfiltdetach(struct knote *kn); +static int passreadfilt(struct knote *kn, long hint); static periph_init_t passinit; static periph_ctor_t passregister; static periph_oninv_t passoninvalidate; static periph_dtor_t passcleanup; -static void pass_add_physpath(void *context, int pending); +static periph_start_t passstart; +static void pass_shutdown_kqueue(void *context, int pending); +static void pass_add_physpath(void *context, int pending); static void passasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); +static void passdone(struct cam_periph *periph, + union ccb *done_ccb); +static int passcreatezone(struct cam_periph *periph); +static void passiocleanup(struct pass_softc *softc, + struct pass_io_req *io_req); +static int passcopysglist(struct cam_periph *periph, + struct pass_io_req *io_req, + ccb_flags direction); +static int passmemsetup(struct cam_periph *periph, + struct pass_io_req *io_req); +static int passmemdone(struct cam_periph *periph, + struct pass_io_req *io_req); static int passerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); static int passsendccb(struct cam_periph *periph, union ccb *ccb, @@ -116,9 +198,19 @@ static struct cdevsw pass_cdevsw = { .d_open = passopen, .d_close = passclose, .d_ioctl = passioctl, + .d_poll = passpoll, + .d_kqfilter = passkqfilter, .d_name = "pass", }; +static struct filterops passread_filtops = { + .f_isfd = 1, + .f_detach = passreadfiltdetach, + .f_event = passreadfilt +}; + +static MALLOC_DEFINE(M_SCSIPASS, "scsi_pass", "scsi passthrough buffers"); + static void passinit(void) { @@ -138,6 +230,60 @@ passinit(void) } static void +passrejectios(struct cam_periph *periph) +{ + struct pass_io_req *io_req, *io_req2; + struct pass_softc *softc; + + softc = (struct pass_softc *)periph->softc; + + /* + * The user can no longer get status for I/O on the done queue, so + * clean up all outstanding I/O on the done queue. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->done_queue, links, io_req2) { + TAILQ_REMOVE(&softc->done_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + /* + * The underlying device is gone, so we can't issue these I/Os. + * The devfs node has been shut down, so we can't return status to + * the user. Free any I/O left on the incoming queue. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->incoming_queue, links, io_req2) { + TAILQ_REMOVE(&softc->incoming_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + /* + * Normally we would put I/Os on the abandoned queue and acquire a + * reference when we saw the final close. But, the device went + * away and devfs may have moved everything off to deadfs by the + * time the I/O done callback is called; as a result, we won't see + * any more closes. So, if we have any active I/Os, we need to put + * them on the abandoned queue. When the abandoned queue is empty, + * we'll release the remaining reference (see below) to the peripheral. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->active_queue, links, io_req2) { + TAILQ_REMOVE(&softc->active_queue, io_req, links); + io_req->flags |= PASS_IO_ABANDONED; + TAILQ_INSERT_TAIL(&softc->abandoned_queue, io_req, links); + } + + /* + * If we put any I/O on the abandoned queue, acquire a reference. + */ + if ((!TAILQ_EMPTY(&softc->abandoned_queue)) + && ((softc->flags & PASS_FLAG_ABANDONED_REF_SET) == 0)) { + cam_periph_doacquire(periph); + softc->flags |= PASS_FLAG_ABANDONED_REF_SET; + } +} + +static void passdevgonecb(void *arg) { struct cam_periph *periph; @@ -165,17 +311,26 @@ passdevgonecb(void *arg) /* * Release the reference held for the device node, it is gone now. + * Accordingly, inform all queued I/Os of their fate. */ cam_periph_release_locked(periph); + passrejectios(periph); /* - * We reference the lock directly here, instead of using + * We reference the SIM lock directly here, instead of using * cam_periph_unlock(). The reason is that the final call to * cam_periph_release_locked() above could result in the periph * getting freed. If that is the case, dereferencing the periph * with a cam_periph_unlock() call would cause a page fault. */ mtx_unlock(mtx); + + /* + * We have to remove our kqueue context from a thread because it + * may sleep. It would be nice if we could get a callback from + * kqueue when it is done cleaning up resources. + */ + taskqueue_enqueue(taskqueue_thread, &softc->shutdown_kqueue_task); } static void @@ -197,12 +352,6 @@ passoninvalidate(struct cam_periph *peri * when it has cleaned up its state. */ destroy_dev_sched_cb(softc->dev, passdevgonecb, periph); - - /* - * XXX Return all queued I/O with ENXIO. - * XXX Handle any transactions queued to the card - * with XPT_ABORT_CCB. - */ } static void @@ -212,9 +361,40 @@ passcleanup(struct cam_periph *periph) softc = (struct pass_softc *)periph->softc; + cam_periph_assert(periph, MA_OWNED); + KASSERT(TAILQ_EMPTY(&softc->active_queue), + ("%s called when there are commands on the active queue!\n", + __func__)); + KASSERT(TAILQ_EMPTY(&softc->abandoned_queue), + ("%s called when there are commands on the abandoned queue!\n", + __func__)); + KASSERT(TAILQ_EMPTY(&softc->incoming_queue), + ("%s called when there are commands on the incoming queue!\n", + __func__)); + KASSERT(TAILQ_EMPTY(&softc->done_queue), + ("%s called when there are commands on the done queue!\n", + __func__)); + devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); + + /* + * We call taskqueue_drain() for the physpath task to make sure it + * is complete. We drop the lock because this can potentially + * sleep. XXX KDM that is bad. Need a way to get a callback when + * a taskqueue is drained. + * + * Note that we don't drain the kqueue shutdown task queue. This + * is because we hold a reference on the periph for kqueue, and + * release that reference from the kqueue shutdown task queue. So + * we cannot come into this routine unless we've released that + * reference. Also, because that could be the last reference, we + * could be called from the cam_periph_release() call in + * pass_shutdown_kqueue(). In that case, the taskqueue_drain() + * would deadlock. It would be preferable if we had a way to + * get a callback when a taskqueue is done. + */ taskqueue_drain(taskqueue_thread, &softc->add_physpath_task); cam_periph_lock(periph); @@ -223,10 +403,29 @@ passcleanup(struct cam_periph *periph) } static void +pass_shutdown_kqueue(void *context, int pending) +{ + struct cam_periph *periph; + struct pass_softc *softc; + + periph = context; + softc = periph->softc; + + knlist_clear(&softc->read_select.si_note, /*is_locked*/ 0); + knlist_destroy(&softc->read_select.si_note); + + /* + * Release the reference we held for kqueue. + */ + cam_periph_release(periph); +} + +static void pass_add_physpath(void *context, int pending) { struct cam_periph *periph; struct pass_softc *softc; + struct mtx *mtx; char *physpath; /* @@ -236,34 +435,38 @@ pass_add_physpath(void *context, int pen periph = context; softc = periph->softc; physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); - cam_periph_lock(periph); - if (periph->flags & CAM_PERIPH_INVALID) { - cam_periph_unlock(periph); + mtx = cam_periph_mtx(periph); + mtx_lock(mtx); + + if (periph->flags & CAM_PERIPH_INVALID) goto out; - } + if (xpt_getattr(physpath, MAXPATHLEN, "GEOM::physpath", periph->path) == 0 && strlen(physpath) != 0) { - cam_periph_unlock(periph); + mtx_unlock(mtx); make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev, softc->dev, softc->alias_dev, physpath); - cam_periph_lock(periph); + mtx_lock(mtx); } +out: /* * Now that we've made our alias, we no longer have to have a * reference to the device. */ - if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) { + if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) softc->flags |= PASS_FLAG_INITIAL_PHYSPATH; - cam_periph_unlock(periph); - dev_rel(softc->dev); - } - else - cam_periph_unlock(periph); -out: + /* + * We always acquire a reference to the periph before queueing this + * task queue function, so it won't go away before we run. + */ + while (pending-- > 0) + cam_periph_release_locked(periph); + mtx_unlock(mtx); + free(physpath, M_DEVBUF); } @@ -291,7 +494,7 @@ passasync(void *callback_arg, u_int32_t * process. */ status = cam_periph_alloc(passregister, passoninvalidate, - passcleanup, NULL, "pass", + passcleanup, passstart, "pass", CAM_PERIPH_BIO, path, passasync, AC_FOUND_DEVICE, cgd); @@ -315,8 +518,19 @@ passasync(void *callback_arg, u_int32_t buftype = (uintptr_t)arg; if (buftype == CDAI_TYPE_PHYS_PATH) { struct pass_softc *softc; + cam_status status; softc = (struct pass_softc *)periph->softc; + /* + * Acquire a reference to the periph before we + * start the taskqueue, so that we don't run into + * a situation where the periph goes away before + * the task queue has a chance to run. + */ + status = cam_periph_acquire(periph); + if (status != CAM_REQ_CMP) + break; + taskqueue_enqueue(taskqueue_thread, &softc->add_physpath_task); } @@ -361,6 +575,17 @@ passregister(struct cam_periph *periph, softc->pd_type = T_DIRECT; periph->softc = softc; + softc->periph = periph; + TAILQ_INIT(&softc->incoming_queue); + TAILQ_INIT(&softc->active_queue); + TAILQ_INIT(&softc->abandoned_queue); + TAILQ_INIT(&softc->done_queue); + snprintf(softc->zone_name, sizeof(softc->zone_name), "%s%d", + periph->periph_name, periph->unit_number); + snprintf(softc->io_zone_name, sizeof(softc->io_zone_name), "%s%dIO", + periph->periph_name, periph->unit_number); + softc->io_zone_size = MAXPHYS; + knlist_init_mtx(&softc->read_select.si_note, cam_periph_mtx(periph)); bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); @@ -374,6 +599,9 @@ passregister(struct cam_periph *periph, else softc->maxio = cpi.maxio; /* real value */ + if (cpi.hba_misc & PIM_UNMAPPED) + softc->flags |= PASS_FLAG_UNMAPPED_CAPABLE; + /* * We pass in 0 for a blocksize, since we don't * know what the blocksize of this device is, if @@ -391,6 +619,23 @@ passregister(struct cam_periph *periph, DEVSTAT_PRIORITY_PASS); /* + * Initialize the taskqueue handler for shutting down kqueue. + */ + TASK_INIT(&softc->shutdown_kqueue_task, /*priority*/ 0, + pass_shutdown_kqueue, periph); + + /* + * Acquire a reference to the periph that we can release once we've + * cleaned up the kqueue. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + + /* * Acquire a reference to the periph before we create the devfs * instance for it. We'll release this reference once the devfs * instance has been freed. @@ -408,12 +653,15 @@ passregister(struct cam_periph *periph, periph->periph_name, periph->unit_number); /* - * Now that we have made the devfs instance, hold a reference to it - * until the task queue has run to setup the physical path alias. - * That way devfs won't get rid of the device before we add our - * alias. + * Hold a reference to the periph before we create the physical + * path alias so it can't go away. */ - dev_ref(softc->dev); + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } cam_periph_lock(periph); softc->dev->si_drv1 = periph; @@ -514,6 +762,55 @@ passclose(struct cdev *dev, int flag, in softc = periph->softc; softc->open_count--; + if (softc->open_count == 0) { + struct pass_io_req *io_req, *io_req2; + int need_unlock; + + need_unlock = 0; + + TAILQ_FOREACH_SAFE(io_req, &softc->done_queue, links, io_req2) { + TAILQ_REMOVE(&softc->done_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + TAILQ_FOREACH_SAFE(io_req, &softc->incoming_queue, links, + io_req2) { + TAILQ_REMOVE(&softc->incoming_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + /* + * If there are any active I/Os, we need to forcibly acquire a + * reference to the peripheral so that we don't go away + * before they complete. We'll release the reference when + * the abandoned queue is empty. + */ + io_req = TAILQ_FIRST(&softc->active_queue); + if ((io_req != NULL) + && (softc->flags & PASS_FLAG_ABANDONED_REF_SET) == 0) { + cam_periph_doacquire(periph); + softc->flags |= PASS_FLAG_ABANDONED_REF_SET; + } + + /* + * Since the I/O in the active queue is not under our + * control, just set a flag so that we can clean it up when + * it completes and put it on the abandoned queue. This + * will prevent our sending spurious completions in the + * event that the device is opened again before these I/Os + * complete. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->active_queue, links, + io_req2) { + TAILQ_REMOVE(&softc->active_queue, io_req, links); + io_req->flags |= PASS_IO_ABANDONED; + TAILQ_INSERT_TAIL(&softc->abandoned_queue, io_req, + links); + } + } + cam_periph_release_locked(periph); /* @@ -533,123 +830,1338 @@ passclose(struct cdev *dev, int flag, in return (0); } -static int -passioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - int error; - - if ((error = passdoioctl(dev, cmd, addr, flag, td)) == ENOTTY) { - error = cam_compat_ioctl(dev, cmd, addr, flag, td, passdoioctl); - } - return (error); -} -static int -passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) +static void +passstart(struct cam_periph *periph, union ccb *start_ccb) { - struct cam_periph *periph; - struct pass_softc *softc; - int error; - uint32_t priority; - - periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); + struct pass_softc *softc; - cam_periph_lock(periph); softc = (struct pass_softc *)periph->softc; - error = 0; - - switch (cmd) { - - case CAMIOCOMMAND: - { - union ccb *inccb; - union ccb *ccb; - int ccb_malloced; - - inccb = (union ccb *)addr; + switch (softc->state) { + case PASS_STATE_NORMAL: { + struct pass_io_req *io_req; /* - * Some CCB types, like scan bus and scan lun can only go - * through the transport layer device. + * Check for any queued I/O requests that require an + * allocated slot. */ - if (inccb->ccb_h.func_code & XPT_FC_XPT_ONLY) { - xpt_print(periph->path, "CCB function code %#x is " - "restricted to the XPT device\n", - inccb->ccb_h.func_code); - error = ENODEV; + io_req = TAILQ_FIRST(&softc->incoming_queue); + if (io_req == NULL) { + xpt_release_ccb(start_ccb); break; } + TAILQ_REMOVE(&softc->incoming_queue, io_req, links); + TAILQ_INSERT_TAIL(&softc->active_queue, io_req, links); + /* + * Merge the user's CCB into the allocated CCB. + */ + xpt_merge_ccb(start_ccb, &io_req->ccb); + start_ccb->ccb_h.ccb_type = PASS_CCB_QUEUED_IO; + start_ccb->ccb_h.ccb_ioreq = io_req; + start_ccb->ccb_h.cbfcnp = passdone; + io_req->alloced_ccb = start_ccb; + binuptime(&io_req->start_time); + devstat_start_transaction(softc->device_stats, + &io_req->start_time); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 19:23:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9F1A49211; Wed, 16 Dec 2015 19:23:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7D21B45; Wed, 16 Dec 2015 19:23:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGJNAev045196; Wed, 16 Dec 2015 19:23:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGJNAMS045195; Wed, 16 Dec 2015 19:23:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161923.tBGJNAMS045195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 19:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292350 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 19:23:11 -0000 Author: emaste Date: Wed Dec 16 19:23:10 2015 New Revision: 292350 URL: https://svnweb.freebsd.org/changeset/base/292350 Log: Enable LLDB by default on amd64 and arm64 LLDB is usable for userland core file and live debugging on amd64, and for userland core file debugging on arm64. In general it works at least as well on FreeBSD as our in-tree gdb version, so enable it by default to allow for broader use and testing. An LLDB tutorial is available at http://lldb.llvm.org/tutorial.html, and a table mapping GDB commands to LLDB commands can be found at http://lldb.llvm.org/lldb-gdb.html . LLDB also has some level of support for FreeBSD on arm, mips, i386, and powerpc, but is not yet ready to have them enabled by default. Reviewed by: gnn Relnotes: Yes Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Dec 16 19:14:37 2015 (r292349) +++ head/share/mk/src.opts.mk Wed Dec 16 19:23:10 2015 (r292350) @@ -180,7 +180,6 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ EISA \ HESIOD \ - LLDB \ NAND \ OFED \ OPENLDAP \ @@ -240,6 +239,11 @@ BROKEN_OPTIONS+=PROFILE # "sorry, unimpl BROKEN_OPTIONS+=TESTS # "undefined reference to `_Unwind_Resume'" BROKEN_OPTIONS+=CXX # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'" .endif +.if ${__T} == "aarch64" || ${__T} == "amd64" +__DEFAULT_YES_OPTIONS+=LLDB +.else +__DEFAULT_NO_OPTIONS+=LLDB +.endif # LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB From owner-svn-src-all@freebsd.org Wed Dec 16 19:41:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C1DA49C49; Wed, 16 Dec 2015 19:41:26 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E1741844; Wed, 16 Dec 2015 19:41:26 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x233.google.com with SMTP id v86so16978455pfa.2; Wed, 16 Dec 2015 11:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=nmX081NQVe3hK8L5NNYrgbXVMJN6ghdaZntxszv30g4=; b=O2cy8XnnMRQVCxKTagxlyegMXDqA2xnxCghUWzReH2V9fltpOq/g12uBiqLDa/aoG3 T13IteW+K3hE9sV05eFChQwNolBd5RIj28OXrDQ0EDGUCnIGXRTCRDPJ/76HpDEL/vxQ pygu7zR3huWSjLo5xMw6qPRutHRwJzShqGK5H7YWc+i9QaVTrUoUah8zSlXmGw6ZiydY Aw12CwzGmkrrOEmsgPy7Lv6dR6Eh0DdfEfy5GPfsGGh4OuHVbjfJSBzt9dQxPIP0q20P H9fKtn5ede26vM41i27NWC0Y0YO353WMcDnt5EW0YifTW643vit+aUdxXtzcYNvVPgve Np1g== X-Received: by 10.98.74.77 with SMTP id x74mr8339137pfa.102.1450294886207; Wed, 16 Dec 2015 11:41:26 -0800 (PST) Received: from ox ([2601:641:c000:600:224:d7ff:fe08:23a0]) by smtp.gmail.com with ESMTPSA id sg4sm10860661pac.48.2015.12.16.11.41.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Dec 2015 11:41:24 -0800 (PST) Date: Wed, 16 Dec 2015 11:41:22 -0800 From: Navdeep Parhar To: John Baldwin Cc: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks Message-ID: <20151216194122.GC21462@ox> Mail-Followup-To: John Baldwin , Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512160056.tBG0ujqA067178@repo.freebsd.org> <1972466.CRnu3P14jO@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1972466.CRnu3P14jO@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 19:41:26 -0000 On Wed, Dec 16, 2015 at 07:06:31AM -0800, John Baldwin wrote: > On Wednesday, December 16, 2015 12:56:45 AM Randall Stewart wrote: > > Author: rrs > > Date: Wed Dec 16 00:56:45 2015 > > New Revision: 292309 > > URL: https://svnweb.freebsd.org/changeset/base/292309 > > > > Log: > > First cut of the modularization of our TCP stack. Still > > to do is to clean up the timer handling using the async-drain. > > Other optimizations may be coming to go with this. Whats here > > will allow differnet tcp implementations (one included). > > Reviewed by: jtl, hiren, transports > > Sponsored by: Netflix Inc. > > Differential Revision: D4055 > > Have you considered treating TOE as a separate stack? We already > have a bit of a split to handle TOE specially. It might be nice if > it was able to plug in via this. That might also help flesh out the > abstraction a bit by giving another use case. That's an interesting thought. The TOE code should be a great test for any KPI that aims to allow multiple TCP stacks to coexist (TOEs are nothing but alternate TCP stacks running in the hardware). The only oddball thing about TOE is that the offload vs don't offload decision is made on the fly (based on the route lookup) and not when the socket is created. Regards, Navdeep > > Also, note that the Differential Revision tag should be the full > URL to the review (in which case it auto-closes it for you). > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Wed Dec 16 19:48:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3B56A49FDF; Wed, 16 Dec 2015 19:48:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 742DF1B3D; Wed, 16 Dec 2015 19:48:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGJm3EJ051379; Wed, 16 Dec 2015 19:48:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGJm3xG051378; Wed, 16 Dec 2015 19:48:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161948.tBGJm3xG051378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 19:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292355 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 19:48:04 -0000 Author: emaste Date: Wed Dec 16 19:48:03 2015 New Revision: 292355 URL: https://svnweb.freebsd.org/changeset/base/292355 Log: Remove lldb(1) files if WITHOUT_LLDB is set Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 16 19:34:58 2015 (r292354) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 16 19:48:03 2015 (r292355) @@ -4254,6 +4254,11 @@ OLD_DIRS+=usr/include/c++/v1 # to be filled in #.endif +.if ${MK_LLDB} == no +OLD_FILES+=usr/bin/lldb +OLD_FILES+=usr/share/man/man1/lldb.1.gz +.endif + .if ${MK_LOCALES} == no OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_CTYPE From owner-svn-src-all@freebsd.org Wed Dec 16 20:33:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC2A2A48E2D; Wed, 16 Dec 2015 20:33:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 884521C18; Wed, 16 Dec 2015 20:33:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:ac4f:653e:7774:bfe2] (unknown [IPv6:2a02:1811:2419:4e02:ac4f:653e:7774:bfe2]) by venus.codepro.be (Postfix) with ESMTPSA id 520DA85CC; Wed, 16 Dec 2015 21:33:28 +0100 (CET) Subject: Re: svn commit: r292275 - in head/sys: net netinet netinet6 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=us-ascii From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <56715486.1000901@freebsd.org> Date: Wed, 16 Dec 2015 21:33:26 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3A89FE3E-4CC1-4404-9153-969B64C8BEC6@FreeBSD.org> References: <201512151602.tBFG2BTX089543@repo.freebsd.org> <8CEE530E-C08D-4BD1-B908-8EBBCEEAD1CD@FreeBSD.org> <1016D8B2-F850-44B9-B773-632BD9ABC95D@FreeBSD.org> <56715486.1000901@freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 20:33:32 -0000 > On 16 Dec 2015, at 13:09, Steven Hartland = wrote: >=20 > I've attached a patch which should fix if you could test that would be = great, but I'd still like to understand if there is something wrong = elsewhere before I do. The board boots & works with this patch. Thanks, Kristof= From owner-svn-src-all@freebsd.org Wed Dec 16 20:33:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA103A48E76; Wed, 16 Dec 2015 20:33:48 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 999041D6C; Wed, 16 Dec 2015 20:33:48 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGKXlpW066183; Wed, 16 Dec 2015 20:33:47 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGKXlau066182; Wed, 16 Dec 2015 20:33:47 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512162033.tBGKXlau066182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 16 Dec 2015 20:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292360 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 20:33:48 -0000 Author: jilles Date: Wed Dec 16 20:33:47 2015 New Revision: 292360 URL: https://svnweb.freebsd.org/changeset/base/292360 Log: sh: Fix use-after-free when attempting to modify a read-only variable. Reported by: bapt MFC after: 1 week Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Wed Dec 16 20:17:57 2015 (r292359) +++ head/bin/sh/var.c Wed Dec 16 20:33:47 2015 (r292360) @@ -330,7 +330,7 @@ setvareq(char *s, int flags) if (vp->flags & VREADONLY) { if ((flags & (VTEXTFIXED|VSTACK)) == 0) ckfree(s); - error("%.*s: is read only", vp->name_len, s); + error("%.*s: is read only", vp->name_len, vp->text); } if (flags & VNOSET) { if ((flags & (VTEXTFIXED|VSTACK)) == 0) From owner-svn-src-all@freebsd.org Wed Dec 16 20:54:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBCCCA49C47; Wed, 16 Dec 2015 20:54:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991131EEC; Wed, 16 Dec 2015 20:54:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGKsSPc072354; Wed, 16 Dec 2015 20:54:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGKsS6a072353; Wed, 16 Dec 2015 20:54:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512162054.tBGKsS6a072353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 16 Dec 2015 20:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292366 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 20:54:29 -0000 Author: ian Date: Wed Dec 16 20:54:28 2015 New Revision: 292366 URL: https://svnweb.freebsd.org/changeset/base/292366 Log: Flag the first port on a Sheevaplug ftdi serial device as jtag. Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Dec 16 20:52:00 2015 (r292365) +++ head/sys/dev/usb/serial/uftdi.c Wed Dec 16 20:54:28 2015 (r292366) @@ -563,7 +563,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(KOBIL, CONV_B1, 0), UFTDI_DEV(KOBIL, CONV_KAAN, 0), UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, 0), - UFTDI_DEV(MARVELL, SHEEVAPLUG, 0), + UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, 0), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, 0), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, 0), From owner-svn-src-all@freebsd.org Wed Dec 16 21:30:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FE9FA48330; Wed, 16 Dec 2015 21:30:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42A5719DE; Wed, 16 Dec 2015 21:30:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGLUl9s083597; Wed, 16 Dec 2015 21:30:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGLUjPj083575; Wed, 16 Dec 2015 21:30:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201512162130.tBGLUjPj083575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Dec 2015 21:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 21:30:48 -0000 Author: glebius Date: Wed Dec 16 21:30:45 2015 New Revision: 292373 URL: https://svnweb.freebsd.org/changeset/base/292373 Log: A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES(). o With new KPI consumers can request contiguous ranges of pages, and unlike before, all pages will be kept busied on return, like it was done before with the 'reqpage' only. Now the reqpage goes away. With new interface it is easier to implement code protected from race conditions. Such arrayed requests for now should be preceeded by a call to vm_pager_haspage() to make sure that request is possible. This could be improved later, making vm_pager_haspage() obsolete. Strenghtening the promises on the business of the array of pages allows us to remove such hacks as swp_pager_free_nrpage() and vm_pager_free_nonreq(). o New KPI accepts two integer pointers that may optionally point at values for read ahead and read behind, that a pager may do, if it can. These pages are completely owned by pager, and not controlled by the caller. This shifts the UFS-specific readahead logic from vm_fault.c, which should be file system agnostic, into vnode_pager.c. It also removes one VOP_BMAP() request per hard fault. Discussed with: kib, alc, jeff, scottl Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/share/man/man9/VOP_GETPAGES.9 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_tt.c head/sys/dev/md/md.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/kern_exec.c head/sys/kern/uipc_shm.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_default.c head/sys/kern/vnode_if.src head/sys/sys/buf.h head/sys/vm/default_pager.c head/sys/vm/device_pager.c head/sys/vm/phys_pager.c head/sys/vm/sg_pager.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h head/sys/vm/vnode_pager.c head/sys/vm/vnode_pager.h Modified: head/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- head/share/man/man9/VOP_GETPAGES.9 Wed Dec 16 21:15:12 2015 (r292372) +++ head/share/man/man9/VOP_GETPAGES.9 Wed Dec 16 21:30:45 2015 (r292373) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 2014 +.Dd December 16, 2015 .Dt VOP_GETPAGES 9 .Os .Sh NAME @@ -41,7 +41,7 @@ .In sys/vnode.h .In vm/vm.h .Ft int -.Fn VOP_GETPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int reqpage" +.Fn VOP_GETPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int *rbehind" "int *rahead" .Ft int .Fn VOP_PUTPAGES "struct vnode *vp" "vm_page_t *ma" "int count" "int sync" "int *rtvals" .Sh DESCRIPTION @@ -63,7 +63,7 @@ locks are held. Both methods return in the same state on both success and error returns. .Pp The arguments are: -.Bl -tag -width reqpage +.Bl -tag -width rbehind .It Fa vp The file to access. .It Fa ma @@ -78,9 +78,16 @@ if the write should be synchronous. An array of VM system result codes indicating the status of each page written by .Fn VOP_PUTPAGES . -.It Fa reqpage -The index in the page array of the requested page; i.e., the one page which -the implementation of this method must handle. +.It Fa rbehind +Optional pointer to integer specifying number of pages to be read behind, if +possible. +If the filesystem supports that feature, number of actually read pages is +reported back, otherwise zero is returned. +.It Fa rahead +Optional pointer to integer specifying number of pages to be read ahead, if +possible. +If the filesystem supports that feature, number of actually read pages is +reported back, otherwise zero is returned. .El .Pp The status of the Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Dec 16 21:30:45 2015 (r292373) @@ -5762,12 +5762,13 @@ ioflags(int ioflags) } static int -zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) +zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, + int *rahead) { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; objset_t *os = zp->z_zfsvfs->z_os; - vm_page_t mfirst, mlast, mreq; + vm_page_t mlast; vm_object_t object; caddr_t va; struct sf_buf *sf; @@ -5776,82 +5777,46 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_pindex_t reqstart, reqend; int pcount, lsize, reqsize, size; + if (rbehind) + *rbehind = 0; + if (rahead) + *rahead = 0; + ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); pcount = OFF_TO_IDX(round_page(count)); - mreq = m[reqpage]; - object = mreq->object; - error = 0; - - if (pcount > 1 && zp->z_blksz > PAGESIZE) { - startoff = rounddown(IDX_TO_OFF(mreq->pindex), zp->z_blksz); - reqstart = OFF_TO_IDX(round_page(startoff)); - if (reqstart < m[0]->pindex) - reqstart = 0; - else - reqstart = reqstart - m[0]->pindex; - endoff = roundup(IDX_TO_OFF(mreq->pindex) + PAGE_SIZE, - zp->z_blksz); - reqend = OFF_TO_IDX(trunc_page(endoff)) - 1; - if (reqend > m[pcount - 1]->pindex) - reqend = m[pcount - 1]->pindex; - reqsize = reqend - m[reqstart]->pindex + 1; - KASSERT(reqstart <= reqpage && reqpage < reqstart + reqsize, - ("reqpage beyond [reqstart, reqstart + reqsize[ bounds")); - } else { - reqstart = reqpage; - reqsize = 1; - } - mfirst = m[reqstart]; - mlast = m[reqstart + reqsize - 1]; zfs_vmobject_wlock(object); - - for (i = 0; i < reqstart; i++) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - for (i = reqstart + reqsize; i < pcount; i++) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - - if (mreq->valid && reqsize == 1) { - if (mreq->valid != VM_PAGE_BITS_ALL) - vm_page_zero_invalid(mreq, TRUE); + if (m[pcount - 1]->valid != 0 && --pcount == 0) { zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_ok); } - PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, reqsize); + object = m[0]->object; + mlast = m[pcount - 1]; - if (IDX_TO_OFF(mreq->pindex) >= object->un_pager.vnp.vnp_size) { - for (i = reqstart; i < reqstart + reqsize; i++) { - if (i != reqpage) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - } + if (IDX_TO_OFF(mlast->pindex) >= + object->un_pager.vnp.vnp_size) { zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } + PCPU_INC(cnt.v_vnodein); + PCPU_ADD(cnt.v_vnodepgsin, reqsize); + lsize = PAGE_SIZE; if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) - lsize = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mlast->pindex); - + lsize = object->un_pager.vnp.vnp_size - + IDX_TO_OFF(mlast->pindex); zfs_vmobject_wunlock(object); - for (i = reqstart; i < reqstart + reqsize; i++) { + error = 0; + for (i = 0; i < pcount; i++) { size = PAGE_SIZE; - if (i == (reqstart + reqsize - 1)) + if (i == pcount - 1) size = lsize; va = zfs_map_page(m[i], &sf); error = dmu_read(os, zp->z_id, IDX_TO_OFF(m[i]->pindex), @@ -5860,21 +5825,15 @@ zfs_getpages(struct vnode *vp, vm_page_t bzero(va + size, PAGE_SIZE - size); zfs_unmap_page(sf); if (error != 0) - break; + goto out; } zfs_vmobject_wlock(object); - - for (i = reqstart; i < reqstart + reqsize; i++) { - if (!error) - m[i]->valid = VM_PAGE_BITS_ALL; - KASSERT(m[i]->dirty == 0, ("zfs_getpages: page %p is dirty", m[i])); - if (i != reqpage) - vm_page_readahead_finish(m[i]); - } - + for (i = 0; i < pcount; i++) + m[i]->valid = VM_PAGE_BITS_ALL; zfs_vmobject_wunlock(object); +out: ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); return (error ? zfs_vm_pagerret_error : zfs_vm_pagerret_ok); @@ -5886,11 +5845,13 @@ zfs_freebsd_getpages(ap) struct vnode *a_vp; vm_page_t *a_m; int a_count; - int a_reqpage; + int *a_rbehind; + int *a_rahead; } */ *ap; { - return (zfs_getpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_reqpage)); + return (zfs_getpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_rbehind, + ap->a_rahead)); } static int Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Dec 16 21:30:45 2015 (r292373) @@ -4338,7 +4338,7 @@ i915_gem_wire_page(vm_object_t object, v page = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (page->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(object, pindex, NULL, NULL)) { - rv = vm_pager_get_pages(object, &page, 1, 0); + rv = vm_pager_get_pages(object, &page, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(page); vm_page_free(page); Modified: head/sys/dev/drm2/ttm/ttm_tt.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_tt.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/dev/drm2/ttm/ttm_tt.c Wed Dec 16 21:30:45 2015 (r292373) @@ -291,7 +291,8 @@ int ttm_tt_swapin(struct ttm_tt *ttm) from_page = vm_page_grab(obj, i, VM_ALLOC_NORMAL); if (from_page->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(obj, i, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &from_page, 1, 0); + rv = vm_pager_get_pages(obj, &from_page, 1, + NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(from_page); vm_page_free(from_page); Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/dev/md/md.c Wed Dec 16 21:30:45 2015 (r292373) @@ -1019,7 +1019,8 @@ mdstart_swap(struct md_s *sc, struct bio if (m->valid == VM_PAGE_BITS_ALL) rv = VM_PAGER_OK; else - rv = vm_pager_get_pages(sc->object, &m, 1, 0); + rv = vm_pager_get_pages(sc->object, &m, 1, + NULL, NULL); if (rv == VM_PAGER_ERROR) { vm_page_xunbusy(m); break; @@ -1046,7 +1047,8 @@ mdstart_swap(struct md_s *sc, struct bio } } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) - rv = vm_pager_get_pages(sc->object, &m, 1, 0); + rv = vm_pager_get_pages(sc->object, &m, 1, + NULL, NULL); else rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { @@ -1065,7 +1067,8 @@ mdstart_swap(struct md_s *sc, struct bio m->valid = VM_PAGE_BITS_ALL; } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) - rv = vm_pager_get_pages(sc->object, &m, 1, 0); + rv = vm_pager_get_pages(sc->object, &m, 1, + NULL, NULL); else rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/fs/fuse/fuse_vnops.c Wed Dec 16 21:30:45 2015 (r292373) @@ -1753,6 +1753,10 @@ fuse_vnop_getpages(struct vop_getpages_a cred = curthread->td_ucred; /* XXX */ pages = ap->a_m; count = ap->a_count; + if (ap->a_rbehind) + *ap->a_rbehind = 0; + if (ap->a_rahead) + *ap->a_rahead = 0; if (!fsess_opt_mmap(vnode_mount(vp))) { FS_DEBUG("called on non-cacheable vnode??\n"); @@ -1761,26 +1765,21 @@ fuse_vnop_getpages(struct vop_getpages_a npages = btoc(count); /* - * 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. + * If the last 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. + * + * XXXGL: is that true for FUSE, which is a local filesystem, + * but still somewhat disconnected from the kernel? */ - VM_OBJECT_WLOCK(vp->v_object); - fuse_vm_page_lock_queues(); - if (pages[ap->a_reqpage]->valid != 0) { - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) { - fuse_vm_page_lock(pages[i]); - vm_page_free(pages[i]); - fuse_vm_page_unlock(pages[i]); - } + if (pages[npages - 1]->valid != 0) { + if (--npages == 0) { + VM_OBJECT_WUNLOCK(vp->v_object); + return (VM_PAGER_OK); } - fuse_vm_page_unlock_queues(); - VM_OBJECT_WUNLOCK(vp->v_object); - return 0; - } - fuse_vm_page_unlock_queues(); + count = npages << PAGE_SHIFT; + } VM_OBJECT_WUNLOCK(vp->v_object); /* @@ -1811,17 +1810,6 @@ fuse_vnop_getpages(struct vop_getpages_a if (error && (uio.uio_resid == count)) { FS_DEBUG("error %d\n", error); - VM_OBJECT_WLOCK(vp->v_object); - fuse_vm_page_lock_queues(); - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) { - fuse_vm_page_lock(pages[i]); - vm_page_free(pages[i]); - fuse_vm_page_unlock(pages[i]); - } - } - fuse_vm_page_unlock_queues(); - VM_OBJECT_WUNLOCK(vp->v_object); return VM_PAGER_ERROR; } /* @@ -1862,8 +1850,6 @@ fuse_vnop_getpages(struct vop_getpages_a */ ; } - if (i != ap->a_reqpage) - vm_page_readahead_finish(m); } fuse_vm_page_unlock_queues(); VM_OBJECT_WUNLOCK(vp->v_object); Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Dec 16 21:30:45 2015 (r292373) @@ -101,6 +101,10 @@ ncl_getpages(struct vop_getpages_args *a nmp = VFSTONFS(vp->v_mount); pages = ap->a_m; count = ap->a_count; + if (ap->a_rbehind) + *ap->a_rbehind = 0; + if (ap->a_rahead) + *ap->a_rahead = 0; if ((object = vp->v_object) == NULL) { ncl_printf("nfs_getpages: called with non-merged cache vnode??\n"); @@ -132,12 +136,18 @@ ncl_getpages(struct vop_getpages_args *a * 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. + * + * XXXGL: is that true for NFS, where short read can occur??? */ - if (pages[ap->a_reqpage]->valid != 0) { - vm_pager_free_nonreq(object, pages, ap->a_reqpage, npages, - FALSE); - return (VM_PAGER_OK); + VM_OBJECT_WLOCK(object); + if (pages[npages - 1]->valid != 0) { + if (--npages == 0) { + VM_OBJECT_WUNLOCK(object); + return (VM_PAGER_OK); + } + count = npages << PAGE_SHIFT; } + VM_OBJECT_WUNLOCK(object); /* * We use only the kva address for the buffer, but this is extremely @@ -167,8 +177,6 @@ ncl_getpages(struct vop_getpages_args *a if (error && (uio.uio_resid == count)) { ncl_printf("nfs_getpages: error %d\n", error); - vm_pager_free_nonreq(object, pages, ap->a_reqpage, npages, - FALSE); return (VM_PAGER_ERROR); } @@ -212,8 +220,6 @@ ncl_getpages(struct vop_getpages_args *a */ ; } - if (i != ap->a_reqpage) - vm_page_readahead_finish(m); } VM_OBJECT_WUNLOCK(object); return (0); Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/fs/smbfs/smbfs_io.c Wed Dec 16 21:30:45 2015 (r292373) @@ -424,7 +424,7 @@ smbfs_getpages(ap) #ifdef SMBFS_RWGENERIC return vop_stdgetpages(ap); #else - int i, error, nextoff, size, toff, npages, count, reqpage; + int i, error, nextoff, size, toff, npages, count; struct uio uio; struct iovec iov; vm_offset_t kva; @@ -436,7 +436,7 @@ smbfs_getpages(ap) struct smbnode *np; struct smb_cred *scred; vm_object_t object; - vm_page_t *pages, m; + vm_page_t *pages; vp = ap->a_vp; if ((object = vp->v_object) == NULL) { @@ -451,26 +451,25 @@ smbfs_getpages(ap) pages = ap->a_m; count = ap->a_count; npages = btoc(count); - reqpage = ap->a_reqpage; + if (ap->a_rbehind) + *ap->a_rbehind = 0; + if (ap->a_rahead) + *ap->a_rahead = 0; /* * 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. + * + * XXXGL: is that true for SMB filesystem? */ - m = pages[reqpage]; - VM_OBJECT_WLOCK(object); - if (m->valid != 0) { - for (i = 0; i < npages; ++i) { - if (i != reqpage) { - vm_page_lock(pages[i]); - vm_page_free(pages[i]); - vm_page_unlock(pages[i]); - } + if (pages[npages - 1]->valid != 0) { + if (--npages == 0) { + VM_OBJECT_WUNLOCK(object); + return (VM_PAGER_OK); } - VM_OBJECT_WUNLOCK(object); - return 0; + count = npages << PAGE_SHIFT; } VM_OBJECT_WUNLOCK(object); @@ -500,22 +499,14 @@ smbfs_getpages(ap) relpbuf(bp, &smbfs_pbuf_freecnt); - VM_OBJECT_WLOCK(object); if (error && (uio.uio_resid == count)) { printf("smbfs_getpages: error %d\n",error); - for (i = 0; i < npages; i++) { - if (reqpage != i) { - vm_page_lock(pages[i]); - vm_page_free(pages[i]); - vm_page_unlock(pages[i]); - } - } - VM_OBJECT_WUNLOCK(object); return VM_PAGER_ERROR; } size = count - uio.uio_resid; + VM_OBJECT_WLOCK(object); for (i = 0, toff = 0; i < npages; i++, toff = nextoff) { vm_page_t m; nextoff = toff + PAGE_SIZE; @@ -544,9 +535,6 @@ smbfs_getpages(ap) */ ; } - - if (i != reqpage) - vm_page_readahead_finish(m); } VM_OBJECT_WUNLOCK(object); return 0; Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 16 21:30:45 2015 (r292373) @@ -1370,7 +1370,8 @@ retry: VM_OBJECT_WLOCK(uobj); goto retry; } else if (m->valid != VM_PAGE_BITS_ALL) - rv = vm_pager_get_pages(uobj, &m, 1, 0); + rv = vm_pager_get_pages(uobj, &m, 1, + NULL, NULL); else /* A cached page was reactivated. */ rv = VM_PAGER_OK; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/kern/kern_exec.c Wed Dec 16 21:30:45 2015 (r292373) @@ -950,8 +950,7 @@ int exec_map_first_page(imgp) struct image_params *imgp; { - int rv, i; - int initial_pagein; + int rv, i, after, initial_pagein; vm_page_t ma[VM_INITIAL_PAGEIN]; vm_object_t object; @@ -967,9 +966,18 @@ exec_map_first_page(imgp) #endif ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL); if (ma[0]->valid != VM_PAGE_BITS_ALL) { - initial_pagein = VM_INITIAL_PAGEIN; - if (initial_pagein > object->size) - initial_pagein = object->size; + if (!vm_pager_has_page(object, 0, NULL, &after)) { + vm_page_lock(ma[0]); + vm_page_free(ma[0]); + vm_page_unlock(ma[0]); + vm_page_xunbusy(ma[0]); + VM_OBJECT_WUNLOCK(object); + return (EIO); + } + initial_pagein = min(after, VM_INITIAL_PAGEIN); + KASSERT(initial_pagein <= object->size, + ("%s: initial_pagein %d object->size %ju", + __func__, initial_pagein, (uintmax_t )object->size)); for (i = 1; i < initial_pagein; i++) { if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) @@ -984,14 +992,19 @@ exec_map_first_page(imgp) } } initial_pagein = i; - rv = vm_pager_get_pages(object, ma, initial_pagein, 0); + rv = vm_pager_get_pages(object, ma, initial_pagein, NULL, NULL); if (rv != VM_PAGER_OK) { - vm_page_lock(ma[0]); - vm_page_free(ma[0]); - vm_page_unlock(ma[0]); + for (i = 0; i < initial_pagein; i++) { + vm_page_lock(ma[i]); + vm_page_free(ma[i]); + vm_page_unlock(ma[i]); + vm_page_xunbusy(ma[i]); + } VM_OBJECT_WUNLOCK(object); return (EIO); } + for (i = 1; i < initial_pagein; i++) + vm_page_readahead_finish(ma[i]); } vm_page_xunbusy(ma[0]); vm_page_lock(ma[0]); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/kern/uipc_shm.c Wed Dec 16 21:30:45 2015 (r292373) @@ -189,7 +189,7 @@ uiomove_object_page(vm_object_t obj, siz m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(obj, idx, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &m, 1, 0); + rv = vm_pager_get_pages(obj, &m, 1, NULL, NULL); if (rv != VM_PAGER_OK) { printf( "uiomove_object: vm_obj %p idx %jd valid %x pager error %d\n", @@ -460,7 +460,7 @@ retry: goto retry; } else if (m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(object, &m, 1, - 0); + NULL, NULL); else /* A cached page was reactivated. */ rv = VM_PAGER_OK; Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/kern/uipc_syscalls.c Wed Dec 16 21:30:45 2015 (r292373) @@ -2033,7 +2033,7 @@ sendfile_readpage(vm_object_t obj, struc VM_OBJECT_WLOCK(obj); } else { if (vm_pager_has_page(obj, pindex, NULL, NULL)) { - rv = vm_pager_get_pages(obj, &m, 1, 0); + rv = vm_pager_get_pages(obj, &m, 1, NULL, NULL); SFSTAT_INC(sf_iocnt); if (rv != VM_PAGER_OK) { vm_page_lock(m); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/kern/vfs_default.c Wed Dec 16 21:30:45 2015 (r292373) @@ -731,12 +731,13 @@ vop_stdgetpages(ap) struct vnode *a_vp; vm_page_t *a_m; int a_count; - int a_reqpage; + int *a_rbehind; + int *a_rahead; } */ *ap; { return vnode_pager_generic_getpages(ap->a_vp, ap->a_m, - ap->a_count, ap->a_reqpage, NULL, NULL); + ap->a_count, ap->a_rbehind, ap->a_rahead, NULL, NULL); } static int @@ -744,8 +745,9 @@ vop_stdgetpages_async(struct vop_getpage { int error; - error = VOP_GETPAGES(ap->a_vp, ap->a_m, ap->a_count, ap->a_reqpage); - ap->a_iodone(ap->a_arg, ap->a_m, ap->a_reqpage, error); + error = VOP_GETPAGES(ap->a_vp, ap->a_m, ap->a_count, ap->a_rbehind, + ap->a_rahead); + ap->a_iodone(ap->a_arg, ap->a_m, ap->a_count, error); return (error); } Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/kern/vnode_if.src Wed Dec 16 21:30:45 2015 (r292373) @@ -473,7 +473,8 @@ vop_getpages { IN struct vnode *vp; IN vm_page_t *m; IN int count; - IN int reqpage; + IN int *rbehind; + IN int *rahead; }; @@ -483,7 +484,8 @@ vop_getpages_async { IN struct vnode *vp; IN vm_page_t *m; IN int count; - IN int reqpage; + IN int *rbehind; + IN int *rahead; IN vop_getpages_iodone_t *iodone; IN void *arg; }; Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/sys/buf.h Wed Dec 16 21:30:45 2015 (r292373) @@ -122,14 +122,13 @@ struct buf { struct ucred *b_rcred; /* Read credentials reference. */ struct ucred *b_wcred; /* Write credentials reference. */ union { - TAILQ_ENTRY(buf) bu_freelist; /* (Q) */ + TAILQ_ENTRY(buf) b_freelist; /* (Q) */ struct { - void (*pg_iodone)(void *, vm_page_t *, int, int); - int pg_reqpage; - } bu_pager; - } b_union; -#define b_freelist b_union.bu_freelist -#define b_pager b_union.bu_pager + void (*b_pgiodone)(void *, vm_page_t *, int, int); + int b_pgbefore; + int b_pgafter; + }; + }; union cluster_info { TAILQ_HEAD(cluster_list_head, buf) cluster_head; TAILQ_ENTRY(buf) cluster_entry; Modified: head/sys/vm/default_pager.c ============================================================================== --- head/sys/vm/default_pager.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/vm/default_pager.c Wed Dec 16 21:30:45 2015 (r292373) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static vm_object_t default_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *); static void default_pager_dealloc(vm_object_t); -static int default_pager_getpages(vm_object_t, vm_page_t *, int, int); +static int default_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void default_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *, @@ -122,13 +122,11 @@ default_pager_dealloc(object) * see a vm_page with assigned swap here. */ static int -default_pager_getpages(object, m, count, reqpage) - vm_object_t object; - vm_page_t *m; - int count; - int reqpage; +default_pager_getpages(vm_object_t object, vm_page_t *m, int count, + int *rbehind, int *rahead) { - return VM_PAGER_FAIL; + + return (VM_PAGER_FAIL); } /* Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/vm/device_pager.c Wed Dec 16 21:30:45 2015 (r292373) @@ -59,7 +59,7 @@ static void dev_pager_init(void); static vm_object_t dev_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *); static void dev_pager_dealloc(vm_object_t); -static int dev_pager_getpages(vm_object_t, vm_page_t *, int, int); +static int dev_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void dev_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); static void dev_pager_free_page(vm_object_t object, vm_page_t m); @@ -257,28 +257,33 @@ dev_pager_dealloc(vm_object_t object) } static int -dev_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int reqpage) +dev_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int *rbehind, + int *rahead) { int error; + /* Since our haspage reports zero after/before, the count is 1. */ + KASSERT(count == 1, ("%s: count %d", __func__, count)); VM_OBJECT_ASSERT_WLOCKED(object); error = object->un_pager.devp.ops->cdev_pg_fault(object, - IDX_TO_OFF(ma[reqpage]->pindex), PROT_READ, &ma[reqpage]); + IDX_TO_OFF(ma[0]->pindex), PROT_READ, &ma[0]); VM_OBJECT_ASSERT_WLOCKED(object); - vm_pager_free_nonreq(object, ma, reqpage, count, TRUE); - if (error == VM_PAGER_OK) { KASSERT((object->type == OBJT_DEVICE && - (ma[reqpage]->oflags & VPO_UNMANAGED) != 0) || + (ma[0]->oflags & VPO_UNMANAGED) != 0) || (object->type == OBJT_MGTDEVICE && - (ma[reqpage]->oflags & VPO_UNMANAGED) == 0), - ("Wrong page type %p %p", ma[reqpage], object)); + (ma[0]->oflags & VPO_UNMANAGED) == 0), + ("Wrong page type %p %p", ma[0], object)); if (object->type == OBJT_DEVICE) { TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, - ma[reqpage], plinks.q); + ma[0], plinks.q); } + if (rbehind) + *rbehind = 0; + if (rahead) + *rahead = 0; } return (error); Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/vm/phys_pager.c Wed Dec 16 21:30:45 2015 (r292373) @@ -139,7 +139,8 @@ phys_pager_dealloc(vm_object_t object) * Fill as many pages as vm_fault has allocated for us. */ static int -phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) +phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, + int *rahead) { int i; @@ -154,14 +155,11 @@ phys_pager_getpages(vm_object_t object, ("phys_pager_getpages: partially valid page %p", m[i])); KASSERT(m[i]->dirty == 0, ("phys_pager_getpages: dirty page %p", m[i])); - /* The requested page must remain busy, the others not. */ - if (i == reqpage) { - vm_page_lock(m[i]); - vm_page_flash(m[i]); - vm_page_unlock(m[i]); - } else - vm_page_xunbusy(m[i]); } + if (rbehind) + *rbehind = 0; + if (rahead) + *rahead = 0; return (VM_PAGER_OK); } Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/vm/sg_pager.c Wed Dec 16 21:30:45 2015 (r292373) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *); static void sg_pager_dealloc(vm_object_t); -static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int); +static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void sg_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); static boolean_t sg_pager_haspage(vm_object_t, vm_pindex_t, int *, @@ -135,7 +135,8 @@ sg_pager_dealloc(vm_object_t object) } static int -sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) +sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, + int *rahead) { struct sglist *sg; vm_page_t m_paddr, page; @@ -145,11 +146,13 @@ sg_pager_getpages(vm_object_t object, vm size_t space; int i; + /* Since our haspage reports zero after/before, the count is 1. */ + KASSERT(count == 1, ("%s: count %d", __func__, count)); VM_OBJECT_ASSERT_WLOCKED(object); sg = object->handle; memattr = object->memattr; VM_OBJECT_WUNLOCK(object); - offset = m[reqpage]->pindex; + offset = m[0]->pindex; /* * Lookup the physical address of the requested page. An initial @@ -178,26 +181,23 @@ sg_pager_getpages(vm_object_t object, vm } /* Return a fake page for the requested page. */ - KASSERT(!(m[reqpage]->flags & PG_FICTITIOUS), + KASSERT(!(m[0]->flags & PG_FICTITIOUS), ("backing page for SG is fake")); /* Construct a new fake page. */ page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, plinks.q); - - /* Free the original pages and insert this fake page into the object. */ - for (i = 0; i < count; i++) { - if (i == reqpage && - vm_page_replace(page, object, offset) != m[i]) - panic("sg_pager_getpages: invalid place replacement"); - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - m[reqpage] = page; + if (vm_page_replace(page, object, offset) != m[0]) + panic("sg_pager_getpages: invalid place replacement"); + m[0] = page; page->valid = VM_PAGE_BITS_ALL; + if (rbehind) + *rbehind = 0; + if (rahead) + *rahead = 0; + return (VM_PAGER_OK); } Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Dec 16 21:15:12 2015 (r292372) +++ head/sys/vm/swap_pager.c Wed Dec 16 21:30:45 2015 (r292373) @@ -357,9 +357,10 @@ static vm_object_t swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t offset, struct ucred *); static void swap_pager_dealloc(vm_object_t object); -static int swap_pager_getpages(vm_object_t, vm_page_t *, int, int); -static int swap_pager_getpages_async(vm_object_t, vm_page_t *, int, int, - pgo_getpages_iodone_t, void *); +static int swap_pager_getpages(vm_object_t, vm_page_t *, int, int *, + int *); +static int swap_pager_getpages_async(vm_object_t, vm_page_t *, int, int *, + int *, pgo_getpages_iodone_t, void *); static void swap_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); static boolean_t swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after); @@ -413,16 +414,6 @@ static void swp_pager_meta_free(vm_objec static void swp_pager_meta_free_all(vm_object_t); static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int); -static void -swp_pager_free_nrpage(vm_page_t m) -{ - - vm_page_lock(m); - if (m->wire_count == 0) - vm_page_free(m); - vm_page_unlock(m); -} - /* * SWP_SIZECHECK() - update swap_pager_full indication * @@ -1103,16 +1094,12 @@ swap_pager_unswapped(vm_page_t m) * left busy, but the others adjusted. */ static int -swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) +swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, + int *rahead) { struct buf *bp; - vm_page_t mreq; - int i; - int j; daddr_t blk; - mreq = m[reqpage]; - /* * Calculate range to retrieve. The pages have already been assigned * their swapblks. We require a *contiguous* range but we know it to @@ -1122,45 +1109,18 @@ swap_pager_getpages(vm_object_t object, * * The swp_*() calls must be made with the object locked. */ - blk = swp_pager_meta_ctl(mreq->object, mreq->pindex, 0); + blk = swp_pager_meta_ctl(m[0]->object, m[0]->pindex, 0); - for (i = reqpage - 1; i >= 0; --i) { - daddr_t iblk; - - iblk = swp_pager_meta_ctl(m[i]->object, m[i]->pindex, 0); - if (blk != iblk + (reqpage - i)) - break; - } - ++i; - - for (j = reqpage + 1; j < count; ++j) { - daddr_t jblk; - - jblk = swp_pager_meta_ctl(m[j]->object, m[j]->pindex, 0); - if (blk != jblk - (j - reqpage)) - break; - } - - /* - * free pages outside our collection range. Note: we never free - * mreq, it must remain busy throughout. - */ - if (0 < i || j < count) { - int k; - - for (k = 0; k < i; ++k) - swp_pager_free_nrpage(m[k]); - for (k = j; k < count; ++k) - swp_pager_free_nrpage(m[k]); - } - - /* - * Return VM_PAGER_FAIL if we have nothing to do. Return mreq - * still busy, but the others unbusied. - */ if (blk == SWAPBLK_NONE) return (VM_PAGER_FAIL); +#ifdef INVARIANTS + for (int i = 0; i < count; i++) + KASSERT(blk + i == + swp_pager_meta_ctl(m[i]->object, m[i]->pindex, 0), + ("%s: range is not contiguous", __func__)); +#endif + /* * Getpbuf() can sleep. */ @@ -1175,21 +1135,16 @@ swap_pager_getpages(vm_object_t object, bp->b_iodone = swp_pager_async_iodone; bp->b_rcred = crhold(thread0.td_ucred); bp->b_wcred = crhold(thread0.td_ucred); - bp->b_blkno = blk - (reqpage - i); - bp->b_bcount = PAGE_SIZE * (j - i); - bp->b_bufsize = PAGE_SIZE * (j - i); - bp->b_pager.pg_reqpage = reqpage - i; + bp->b_blkno = blk; + bp->b_bcount = PAGE_SIZE * count; + bp->b_bufsize = PAGE_SIZE * count; + bp->b_npages = count; VM_OBJECT_WLOCK(object); - { - int k; - - for (k = i; k < j; ++k) { - bp->b_pages[k - i] = m[k]; - m[k]->oflags |= VPO_SWAPINPROG; - } + for (int i = 0; i < count; i++) { + bp->b_pages[i] = m[i]; + m[i]->oflags |= VPO_SWAPINPROG; } - bp->b_npages = j - i; PCPU_INC(cnt.v_swapin); PCPU_ADD(cnt.v_swappgsin, bp->b_npages); @@ -1221,8 +1176,8 @@ swap_pager_getpages(vm_object_t object, * is set in the meta-data. */ VM_OBJECT_WLOCK(object); - while ((mreq->oflags & VPO_SWAPINPROG) != 0) { - mreq->oflags |= VPO_SWAPSLEEP; + while ((m[0]->oflags & VPO_SWAPINPROG) != 0) { + m[0]->oflags |= VPO_SWAPSLEEP; PCPU_INC(cnt.v_intrans); if (VM_OBJECT_SLEEP(object, &object->paging_in_progress, PSWP, "swread", hz * 20)) { @@ -1233,15 +1188,18 @@ swap_pager_getpages(vm_object_t object, } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 16 22:26:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD394A4A848; Wed, 16 Dec 2015 22:26:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D7E911C2; Wed, 16 Dec 2015 22:26:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGMQSIY098890; Wed, 16 Dec 2015 22:26:28 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGMQSvs098886; Wed, 16 Dec 2015 22:26:28 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512162226.tBGMQSvs098886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 16 Dec 2015 22:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292379 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 22:26:29 -0000 Author: smh Date: Wed Dec 16 22:26:28 2015 New Revision: 292379 URL: https://svnweb.freebsd.org/changeset/base/292379 Log: Fix issues introduced by r292275 * Fix panic for etherswitches which don't have a LLADDR. * Disabled DELAY in unsolicited NDA, which needs further work. * Fixed missing DELAY in carp_send_na. * style(9) fix. Reported by: kp & melifaro X-MFC-With: r292275 MFC after: 1 month Sponsored by: Multiplay Modified: head/sys/netinet/if_ether.c head/sys/netinet/ip_carp.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Dec 16 22:01:26 2015 (r292378) +++ head/sys/netinet/if_ether.c Wed Dec 16 22:26:28 2015 (r292379) @@ -1217,7 +1217,8 @@ arp_announce(struct ifnet *ifp) struct ifaddr *ifa; struct in_addr *addr, *head; - if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP)) + if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP) || + ifp->if_addr == NULL) return; entries = 8; @@ -1254,9 +1255,11 @@ arp_announce(struct ifnet *ifp) } IF_ADDR_RUNLOCK(ifp); - lladdr = IF_LLADDR(ifp); - for (i = 0; i < cnt; i++) { - arp_announce_addr(ifp, head + i, lladdr); + if (cnt > 0) { + lladdr = IF_LLADDR(ifp); + for (i = 0; i < cnt; i++) { + arp_announce_addr(ifp, head + i, lladdr); + } } free(head, M_TEMP); } Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Dec 16 22:01:26 2015 (r292378) +++ head/sys/netinet/ip_carp.c Wed Dec 16 22:26:28 2015 (r292379) @@ -1045,7 +1045,7 @@ carp_send_na(struct carp_softc *sc) nd6_na_output_unsolicited_addr(sc->sc_carpdev, IFA_IN6(ifa), IFA_ND6_NA_BASE_FLAGS(sc->sc_carpdev, ifa)); - nd6_na_unsolicited_addr_delay(ifa); + DELAY(nd6_na_unsolicited_addr_delay(ifa)); } } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Dec 16 22:01:26 2015 (r292378) +++ head/sys/netinet6/nd6.c Wed Dec 16 22:26:28 2015 (r292379) @@ -209,6 +209,7 @@ nd6_ifnet_link_event(void *arg __unused, if (linkstate == LINK_STATE_UP && V_nd6_on_link) nd6_na_output_unsolicited(ifp); } + void nd6_init(void) { Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Wed Dec 16 22:01:26 2015 (r292378) +++ head/sys/netinet6/nd6_nbr.c Wed Dec 16 22:26:28 2015 (r292379) @@ -1646,7 +1646,8 @@ nd6_na_output_unsolicited(struct ifnet * i++; if (i == cnt) break; - DELAY(ann1->delay); + /* XXX DELAY needs to be done in taskqueue to avoid stalling. */ + //DELAY(ann1->delay); } free(head, M_TEMP); } From owner-svn-src-all@freebsd.org Wed Dec 16 22:58:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24A3BA48F86; Wed, 16 Dec 2015 22:58:11 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEFDC19F3; Wed, 16 Dec 2015 22:58:10 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=Ife04n5yRmrWh1CRquZsoHTi/MxcWShA+sic9Ugg2uY=; b=fXwYg6dhElGu8ZjtbMTG/NFDzvEb0cn48j2usvm8An/xDkMFu1kXuIlv+HLjxfMD371z1OAu6WBuhuX+vhAS1zCu3DpQsdMq87Mufx/H8vmQjdQaQVKtsuXKH2gUBFixdjzagBMb37R8zpzoOCqJ4Kt6Ui3tXAwxpnPWo/znj1c=; Received: from [46.185.1.75] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1a9L1L-0009Dt-Ag ; Thu, 17 Dec 2015 00:58:07 +0200 Date: Thu, 17 Dec 2015 00:58:06 +0200 From: Ivan Klymenko To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151217005806.5c6c962c@nonamehost.local> In-Reply-To: <201512162130.tBGLUjPj083575@repo.freebsd.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=46.185.1.75; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 22:58:11 -0000 On Wed, 16 Dec 2015 21:30:45 +0000 (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Wed Dec 16 21:30:45 2015 > New Revision: 292373 > URL: https://svnweb.freebsd.org/changeset/base/292373 > > Log: > A change to KPI of vm_pager_get_pages() and underlying > VOP_GETPAGES(). > o With new KPI consumers can request contiguous ranges of pages, and > unlike before, all pages will be kept busied on return, like it > was done before with the 'reqpage' only. Now the reqpage goes away. > With new interface it is easier to implement code protected from race > conditions. > > Such arrayed requests for now should be preceeded by a call to > vm_pager_haspage() to make sure that request is possible. This > could be improved later, making vm_pager_haspage() obsolete. > > Strenghtening the promises on the business of the array of pages > allows us to remove such hacks as swp_pager_free_nrpage() and > vm_pager_free_nonreq(). > > o New KPI accepts two integer pointers that may optionally point at > values for read ahead and read behind, that a pager may do, if it > can. These pages are completely owned by pager, and not controlled > by the caller. > > This shifts the UFS-specific readahead logic from vm_fault.c, > which should be file system agnostic, into vnode_pager.c. It also > removes one VOP_BMAP() request per hard fault. > > Discussed with: kib, alc, jeff, scottl > Sponsored by: Nginx, Inc. > Sponsored by: Netflix > Hello. I have panic: Dec 17 00:50:26 nonamehost kernel: ugen2.3: <6047B0021601A0114AGXA> at usbus2 Dec 17 00:50:26 nonamehost kernel: ugen2.4: at usbus2 Dec 17 00:50:26 nonamehost kernel: Dec 17 00:50:26 nonamehost kernel: Dec 17 00:50:26 nonamehost kernel: Fatal trap 12: page fault while in kernel mode Dec 17 00:50:26 nonamehost kernel: cpuid = 1; apic id = 01 Dec 17 00:50:26 nonamehost kernel: fault virtual address = 0x18 Dec 17 00:50:26 nonamehost kernel: fault code = supervisor write data, page not present Dec 17 00:50:26 nonamehost kernel: instruction pointer = 0x20:0xffffffff80a83c5f Dec 17 00:50:26 nonamehost kernel: stack pointer = 0x28:0xfffffe016ff683a0 Dec 17 00:50:26 nonamehost kernel: frame pointer = 0x28:0xfffffe016ff683b0 Dec 17 00:50:26 nonamehost kernel: code segment = base 0x0, limit 0xfffff, type 0x1b Dec 17 00:50:26 nonamehost kernel: = DPL 0, pres 1, long 1, def32 0, gran 1 Dec 17 00:50:26 nonamehost kernel: processor eflags = interrupt enabled, resume, IOPL = 0 Dec 17 00:50:26 nonamehost kernel: current process = 1 (kernel) Dec 17 00:50:26 nonamehost kernel: trap number = 12 Dec 17 00:50:26 nonamehost kernel: panic: page fault Dec 17 00:50:26 nonamehost kernel: cpuid = 1 Dec 17 00:50:26 nonamehost kernel: KDB: stack backtrace: Dec 17 00:50:26 nonamehost kernel: #0 0xffffffff80aca4a7 at kdb_backtrace+0x67 Dec 17 00:50:26 nonamehost kernel: #1 0xffffffff80a86692 at vpanic+0x182 Dec 17 00:50:26 nonamehost kernel: #2 0xffffffff80a86503 at panic+0x43 Dec 17 00:50:26 nonamehost kernel: #3 0xffffffff80f59051 at trap_fatal+0x351 Dec 17 00:50:26 nonamehost kernel: #4 0xffffffff80f59244 at trap_pfault+0x1e4 Dec 17 00:50:26 nonamehost kernel: #5 0xffffffff80f589fe at trap+0x46e Dec 17 00:50:26 nonamehost kernel: #6 0xffffffff80f3ced7 at calltrap+0x8 Dec 17 00:50:26 nonamehost kernel: #7 0xffffffff82277716 at zfs_freebsd_getpages+0x96 Dec 17 00:50:26 nonamehost kernel: #8 0xffffffff810a0256 at VOP_GETPAGES_APV+0xa6 Dec 17 00:50:26 nonamehost kernel: #9 0xffffffff80df26f0 at vnode_pager_getpages+0xc0 Dec 17 00:50:26 nonamehost kernel: #10 0xffffffff80debbcf at vm_pager_get_pages+0x1f Dec 17 00:50:26 nonamehost kernel: #11 0xffffffff80a3cb6f at exec_map_first_page+0x1bf Dec 17 00:50:26 nonamehost kernel: #12 0xffffffff80a3b5ac at kern_execve+0x41c Dec 17 00:50:26 nonamehost kernel: #13 0xffffffff80a3ae0c at sys_execve+0x4c Dec 17 00:50:26 nonamehost kernel: #14 0xffffffff80a1c52d at start_init+0x27d Dec 17 00:50:26 nonamehost kernel: #15 0xffffffff80a4576c at fork_exit+0x9c Dec 17 00:50:26 nonamehost kernel: #16 0xffffffff80f3d40e at fork_trampoline+0xe Dec 17 00:50:26 nonamehost kernel: Uptime: 6s Sorry, but the system is not left (does not save) the dump file just clipping from /var/log/messages From owner-svn-src-all@freebsd.org Wed Dec 16 23:02:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C49A49338; Wed, 16 Dec 2015 23:02:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 62EFC1014; Wed, 16 Dec 2015 23:02:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBGN2eSH043906 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 02:02:40 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBGN2eSC043905; Thu, 17 Dec 2015 02:02:40 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 02:02:40 +0300 From: Gleb Smirnoff To: Ivan Klymenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151216230240.GD42340@FreeBSD.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> <20151217005806.5c6c962c@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151217005806.5c6c962c@nonamehost.local> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:02:49 -0000 Ivan, can you please show? kgdb> list *zfs_freebsd_getpages+0x96 -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Dec 16 23:06:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 839EEA49504; Wed, 16 Dec 2015 23:06:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 EE55C1254; Wed, 16 Dec 2015 23:06:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBGN6Xbu043926 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 02:06:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBGN6XWR043925; Thu, 17 Dec 2015 02:06:33 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 02:06:33 +0300 From: Gleb Smirnoff To: Ivan Klymenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151216230633.GE42340@FreeBSD.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> <20151217005806.5c6c962c@nonamehost.local> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IiVenqGWf+H9Y6IX" Content-Disposition: inline In-Reply-To: <20151217005806.5c6c962c@nonamehost.local> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:06:36 -0000 --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ivan, can you please test this patch? -- Totus tuus, Glebius. --IiVenqGWf+H9Y6IX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="zfs_vnops.c.diff" Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 292382) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) @@ -5775,7 +5775,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int c off_t startoff, endoff; int i, error; vm_pindex_t reqstart, reqend; - int pcount, lsize, reqsize, size; + int lsize, reqsize, size; if (rbehind) *rbehind = 0; @@ -5785,10 +5785,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int c ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); - pcount = OFF_TO_IDX(round_page(count)); - zfs_vmobject_wlock(object); - if (m[pcount - 1]->valid != 0 && --pcount == 0) { + if (m[count - 1]->valid != 0 && --count == 0) { zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_ok); @@ -5795,7 +5793,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int c } object = m[0]->object; - mlast = m[pcount - 1]; + mlast = m[count - 1]; if (IDX_TO_OFF(mlast->pindex) >= object->un_pager.vnp.vnp_size) { @@ -5814,9 +5812,9 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int c zfs_vmobject_wunlock(object); error = 0; - for (i = 0; i < pcount; i++) { + for (i = 0; i < count; i++) { size = PAGE_SIZE; - if (i == pcount - 1) + if (i == count - 1) size = lsize; va = zfs_map_page(m[i], &sf); error = dmu_read(os, zp->z_id, IDX_TO_OFF(m[i]->pindex), @@ -5829,7 +5827,7 @@ zfs_getpages(struct vnode *vp, vm_page_t *m, int c } zfs_vmobject_wlock(object); - for (i = 0; i < pcount; i++) + for (i = 0; i < count; i++) m[i]->valid = VM_PAGE_BITS_ALL; zfs_vmobject_wunlock(object); --IiVenqGWf+H9Y6IX-- From owner-svn-src-all@freebsd.org Wed Dec 16 23:23:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DE3CA4A054; Wed, 16 Dec 2015 23:23:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A049C1E1B; Wed, 16 Dec 2015 23:23:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGNNCOO016508; Wed, 16 Dec 2015 23:23:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGNNChj016507; Wed, 16 Dec 2015 23:23:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512162323.tBGNNChj016507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 16 Dec 2015 23:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292383 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:23:16 -0000 Author: cem Date: Wed Dec 16 23:23:12 2015 New Revision: 292383 URL: https://svnweb.freebsd.org/changeset/base/292383 Log: vm_page.h: page busy macro fixups Minor changes to: - delete extraneous trailing semicolons from macro definitions, and - correct spelling of "busying" in panic messages Submitted by: Ryan Libby Reviewed by: alc, kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4577 Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Dec 16 22:59:32 2015 (r292382) +++ head/sys/vm/vm_page.h Wed Dec 16 23:23:12 2015 (r292383) @@ -514,37 +514,38 @@ void vm_page_lock_assert_KBI(vm_page_t m #define vm_page_assert_sbusied(m) \ KASSERT(vm_page_sbusied(m), \ ("vm_page_assert_sbusied: page %p not shared busy @ %s:%d", \ - (void *)m, __FILE__, __LINE__)); + (m), __FILE__, __LINE__)) #define vm_page_assert_unbusied(m) \ KASSERT(!vm_page_busied(m), \ ("vm_page_assert_unbusied: page %p busy @ %s:%d", \ - (void *)m, __FILE__, __LINE__)); + (m), __FILE__, __LINE__)) #define vm_page_assert_xbusied(m) \ KASSERT(vm_page_xbusied(m), \ ("vm_page_assert_xbusied: page %p not exclusive busy @ %s:%d", \ - (void *)m, __FILE__, __LINE__)); + (m), __FILE__, __LINE__)) #define vm_page_busied(m) \ ((m)->busy_lock != VPB_UNBUSIED) #define vm_page_sbusy(m) do { \ if (!vm_page_trysbusy(m)) \ - panic("%s: page %p failed shared busing", __func__, m); \ + panic("%s: page %p failed shared busying", __func__, \ + (m)); \ } while (0) #define vm_page_tryxbusy(m) \ - (atomic_cmpset_acq_int(&m->busy_lock, VPB_UNBUSIED, \ + (atomic_cmpset_acq_int(&(m)->busy_lock, VPB_UNBUSIED, \ VPB_SINGLE_EXCLUSIVER)) #define vm_page_xbusied(m) \ - ((m->busy_lock & VPB_SINGLE_EXCLUSIVER) != 0) + (((m)->busy_lock & VPB_SINGLE_EXCLUSIVER) != 0) #define vm_page_xbusy(m) do { \ if (!vm_page_tryxbusy(m)) \ - panic("%s: page %p failed exclusive busing", __func__, \ - m); \ + panic("%s: page %p failed exclusive busying", __func__, \ + (m)); \ } while (0) #define vm_page_xunbusy(m) do { \ From owner-svn-src-all@freebsd.org Wed Dec 16 23:32:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ECBFA4A58C; Wed, 16 Dec 2015 23:32:32 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5CF15D8; Wed, 16 Dec 2015 23:32:31 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=yHuY8eVlOpuB2iOqS8Y+re46rOhx+bhzDe26zjT9w0c=; b=ZxLEoYjBEqu1XQK51uwFEmIBpU19k9G9d4bQYOOaTD2LEFhgSS22g+OhV5dtlC7QnQdox1XnQNRfdjSC8nBtzcuTPiXeVwtfkUU/gIUp7ZCiTROejIXkSN/ydnNRw0FSmVEMua9opW7fYbcUqlOIctp5fAAQae9LiC/NxUjpcdM=; Received: from [46.185.1.75] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1a9LYc-0001Rf-91 ; Thu, 17 Dec 2015 01:32:30 +0200 Date: Thu, 17 Dec 2015 01:32:29 +0200 From: Ivan Klymenko To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151217013229.094d5b2d@nonamehost.local> In-Reply-To: <20151216230633.GE42340@FreeBSD.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> <20151217005806.5c6c962c@nonamehost.local> <20151216230633.GE42340@FreeBSD.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=46.185.1.75; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:32:32 -0000 On Thu, 17 Dec 2015 02:06:33 +0300 Gleb Smirnoff wrote: > Ivan, > > can you please test this patch? > > Not helps. Dec 17 01:28:46 nonamehost kernel: Fatal trap 12: page fault while in kernel mode Dec 17 01:28:46 nonamehost kernel: cpuid = 1; apic id = 01 Dec 17 01:28:46 nonamehost kernel: fault virtual address = 0x18 Dec 17 01:28:46 nonamehost kernel: fault code = supervisor write data, page not present Dec 17 01:28:46 nonamehost kernel: instruction pointer = 0x20:0xffffffff80a83c5f Dec 17 01:28:46 nonamehost kernel: stack pointer = 0x28:0xfffffe016ff683a0 Dec 17 01:28:46 nonamehost kernel: frame pointer = 0x28:0xfffffe016ff683b0 Dec 17 01:28:46 nonamehost kernel: code segment = base 0x0, limit 0xfffff, type 0x1b Dec 17 01:28:46 nonamehost kernel: = DPL 0, pres 1, long 1, def32 0, gran 1 Dec 17 01:28:46 nonamehost kernel: processor eflags = interrupt enabled, resume, IOPL = 0 Dec 17 01:28:46 nonamehost kernel: current process = 1 (kernel) Dec 17 01:28:46 nonamehost kernel: trap number = 12 Dec 17 01:28:46 nonamehost kernel: panic: page fault Dec 17 01:28:46 nonamehost kernel: cpuid = 1 Dec 17 01:28:46 nonamehost kernel: KDB: stack backtrace: Dec 17 01:28:46 nonamehost kernel: #0 0xffffffff80aca4a7 at kdb_backtrace+0x67 Dec 17 01:28:46 nonamehost kernel: #1 0xffffffff80a86692 at vpanic+0x182 Dec 17 01:28:46 nonamehost kernel: #2 0xffffffff80a86503 at panic+0x43 Dec 17 01:28:46 nonamehost kernel: #3 0xffffffff80f59051 at trap_fatal+0x351 Dec 17 01:28:46 nonamehost kernel: #4 0xffffffff80f59244 at trap_pfault+0x1e4 Dec 17 01:28:46 nonamehost kernel: #5 0xffffffff80f589fe at trap+0x46e Dec 17 01:28:46 nonamehost kernel: #6 0xffffffff80f3ced7 at calltrap+0x8 Dec 17 01:28:46 nonamehost kernel: #7 0xffffffff8227770b at zfs_freebsd_getpages+0x8b Dec 17 01:28:46 nonamehost kernel: #8 0xffffffff810a0256 at VOP_GETPAGES_APV+0xa6 Dec 17 01:28:46 nonamehost kernel: #9 0xffffffff80df26f0 at vnode_pager_getpages+0xc0 Dec 17 01:28:46 nonamehost kernel: #10 0xffffffff80debbcf at vm_pager_get_pages+0x1f Dec 17 01:28:46 nonamehost kernel: #11 0xffffffff80a3cb6f at exec_map_first_page+0x1bf Dec 17 01:28:46 nonamehost kernel: #12 0xffffffff80a3b5ac at kern_execve+0x41c Dec 17 01:28:46 nonamehost kernel: #13 0xffffffff80a3ae0c at sys_execve+0x4c Dec 17 01:28:46 nonamehost kernel: #14 0xffffffff80a1c52d at start_init+0x27d Dec 17 01:28:46 nonamehost kernel: #15 0xffffffff80a4576c at fork_exit+0x9c Dec 17 01:28:46 nonamehost kernel: #16 0xffffffff80f3d40e at fork_trampoline+0xe Dec 17 01:28:46 nonamehost kernel: Uptime: 6s From owner-svn-src-all@freebsd.org Wed Dec 16 23:33:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD9DA4A649; Wed, 16 Dec 2015 23:33:33 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7CF41887; Wed, 16 Dec 2015 23:33:32 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=OO5WVvU9AkilNIvldJAGacVNMQ/zrP+fb8Kyaj4RkxM=; b=hZQT8oz0QKJYBEPw1UlqJYk1sgp7EB4SdnnbPKcg2Mf83HIceK7BrBA7uWWQbDLrPJV4WgTTRFK3Z+Jp8ZvhSZgFSZoXQz8XEzOicSSLxsUJLRs7noHB7QgOkCuDOqDZ7xnCs95kfnrNCWiynKGa/qIO37mpsjbaBm7037OxpUw=; Received: from [46.185.1.75] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1a9LZb-0002Zl-8a ; Thu, 17 Dec 2015 01:33:31 +0200 Date: Thu, 17 Dec 2015 01:33:30 +0200 From: Ivan Klymenko To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151217013330.62287f4f@nonamehost.local> In-Reply-To: <20151216230633.GE42340@FreeBSD.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> <20151217005806.5c6c962c@nonamehost.local> <20151216230633.GE42340@FreeBSD.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=46.185.1.75; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:33:33 -0000 On Thu, 17 Dec 2015 02:06:33 +0300 Gleb Smirnoff wrote: > Ivan, > > can you please test this patch? > > About ZFS: I have not default options vfs.zfs.prefetch_disable=1 vfs.zfs.arc_max="2G" vfs.zfs.vdev.cache.max=65536 vfs.zfs.vdev.cache.size="16M" Perhaps it has something to clarify the situation. From owner-svn-src-all@freebsd.org Wed Dec 16 23:39:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E612A4A96B; Wed, 16 Dec 2015 23:39:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CED541BB2; Wed, 16 Dec 2015 23:39:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGNdTJk019766; Wed, 16 Dec 2015 23:39:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGNdSKM019751; Wed, 16 Dec 2015 23:39:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512162339.tBGNdSKM019751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 16 Dec 2015 23:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292384 - in head/sys: cam/ctl compat/linux kern netinet security/mac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:39:31 -0000 Author: markj Date: Wed Dec 16 23:39:27 2015 New Revision: 292384 URL: https://svnweb.freebsd.org/changeset/base/292384 Log: Fix style issues around existing SDT probes. - Use SDT_PROBE() instead of SDT_PROBE(). This has no functional effect at the moment, but will be needed for some future changes. - Don't hardcode the module component of the probe identifier. This is set automatically by the SDT framework. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c head/sys/compat/linux/linux_dtrace.h head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/kern_racct.c head/sys/kern/kern_sig.c head/sys/kern/kern_timeout.c head/sys/kern/vfs_cache.c head/sys/netinet/in_kdtrace.c head/sys/netinet/in_kdtrace.h head/sys/netinet/sctp_cc_functions.c head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_internal.h Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Dec 16 23:39:27 2015 (r292384) @@ -610,10 +610,10 @@ ctl_be_block_flush_file(struct ctl_be_bl ctl_complete_beio(beio); } -SDT_PROBE_DEFINE1(cbb, kernel, read, file_start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, file_start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, read, file_done,"uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, file_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , read, file_start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , write, file_start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , read, file_done,"uint64_t"); +SDT_PROBE_DEFINE1(cbb, , write, file_done, "uint64_t"); static void ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, @@ -638,10 +638,10 @@ ctl_be_block_dispatch_file(struct ctl_be bzero(&xuio, sizeof(xuio)); if (beio->bio_cmd == BIO_READ) { - SDT_PROBE(cbb, kernel, read, file_start, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , read, file_start); xuio.uio_rw = UIO_READ; } else { - SDT_PROBE(cbb, kernel, write, file_start, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , write, file_start); xuio.uio_rw = UIO_WRITE; } xuio.uio_offset = beio->io_offset; @@ -684,7 +684,7 @@ ctl_be_block_dispatch_file(struct ctl_be error = VOP_READ(be_lun->vn, &xuio, flags, file_data->cred); VOP_UNLOCK(be_lun->vn, 0); - SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , read, file_done); if (error == 0 && xuio.uio_resid > 0) { /* * If we red less then requested (EOF), then @@ -733,7 +733,7 @@ ctl_be_block_dispatch_file(struct ctl_be VOP_UNLOCK(be_lun->vn, 0); vn_finished_write(mountpoint); - SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , write, file_done); } mtx_lock(&be_lun->io_lock); @@ -869,10 +869,10 @@ ctl_be_block_dispatch_zvol(struct ctl_be bzero(&xuio, sizeof(xuio)); if (beio->bio_cmd == BIO_READ) { - SDT_PROBE(cbb, kernel, read, file_start, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , read, file_start); xuio.uio_rw = UIO_READ; } else { - SDT_PROBE(cbb, kernel, write, file_start, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , write, file_start); xuio.uio_rw = UIO_WRITE; } xuio.uio_offset = beio->io_offset; @@ -903,9 +903,9 @@ ctl_be_block_dispatch_zvol(struct ctl_be error = ENXIO; if (beio->bio_cmd == BIO_READ) - SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , read, file_done); else - SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , write, file_done); mtx_lock(&be_lun->io_lock); devstat_end_transaction(beio->lun->disk_stats, beio->io_len, @@ -1501,10 +1501,10 @@ ctl_be_block_cw_dispatch(struct ctl_be_b } } -SDT_PROBE_DEFINE1(cbb, kernel, read, start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, read, alloc_done, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , read, start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , write, start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , read, alloc_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, , write, alloc_done, "uint64_t"); static void ctl_be_block_next(struct ctl_be_block_io *beio) @@ -1549,9 +1549,9 @@ ctl_be_block_dispatch(struct ctl_be_bloc lbalen = ARGS(io); if (lbalen->flags & CTL_LLF_WRITE) { - SDT_PROBE(cbb, kernel, write, start, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , write, start); } else { - SDT_PROBE(cbb, kernel, read, start, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , read, start); } beio = ctl_alloc_beio(softc); @@ -1638,10 +1638,10 @@ ctl_be_block_dispatch(struct ctl_be_bloc * need to get the data from the user first. */ if (beio->bio_cmd == BIO_READ) { - SDT_PROBE(cbb, kernel, read, alloc_done, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , read, alloc_done); be_lun->dispatch(be_lun, beio); } else { - SDT_PROBE(cbb, kernel, write, alloc_done, 0, 0, 0, 0, 0); + SDT_PROBE0(cbb, , write, alloc_done); #ifdef CTL_TIME_IO getbinuptime(&io->io_hdr.dma_start_bt); #endif Modified: head/sys/compat/linux/linux_dtrace.h ============================================================================== --- head/sys/compat/linux/linux_dtrace.h Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/compat/linux/linux_dtrace.h Wed Dec 16 23:39:27 2015 (r292384) @@ -72,8 +72,8 @@ #define LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE_DEFINE5(\ LINUX_DTRACE, a, b, c, d, e, f, g, h) -#define LIN_SDT_PROBE0(a, b, c) SDT_PROBE1(LINUX_DTRACE, a, b, \ - c, 0) +#define LIN_SDT_PROBE0(a, b, c) SDT_PROBE0(LINUX_DTRACE, a, b, \ + c) #define LIN_SDT_PROBE1(a, b, c, d) SDT_PROBE1(LINUX_DTRACE, a, b, \ c, d) #define LIN_SDT_PROBE2(a, b, c, d, e) SDT_PROBE2(LINUX_DTRACE, a, b, \ Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_exec.c Wed Dec 16 23:39:27 2015 (r292384) @@ -94,9 +94,9 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE1(proc, kernel, , exec, "char *"); -SDT_PROBE_DEFINE1(proc, kernel, , exec__failure, "int"); -SDT_PROBE_DEFINE1(proc, kernel, , exec__success, "char *"); +SDT_PROBE_DEFINE1(proc, , , exec, "char *"); +SDT_PROBE_DEFINE1(proc, , , exec__failure, "int"); +SDT_PROBE_DEFINE1(proc, , , exec__success, "char *"); MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments"); @@ -423,7 +423,7 @@ do_execve(td, args, mac_p) | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); } - SDT_PROBE1(proc, kernel, , exec, args->fname); + SDT_PROBE1(proc, , , exec, args->fname); interpret: if (args->fname != NULL) { @@ -851,7 +851,7 @@ interpret: vfs_mark_atime(imgp->vp, td->td_ucred); - SDT_PROBE1(proc, kernel, , exec__success, args->fname); + SDT_PROBE1(proc, , , exec__success, args->fname); VOP_UNLOCK(imgp->vp, 0); done1: @@ -923,7 +923,7 @@ exec_fail: p->p_flag &= ~P_INEXEC; PROC_UNLOCK(p); - SDT_PROBE1(proc, kernel, , exec__failure, error); + SDT_PROBE1(proc, , , exec__failure, error); done2: #ifdef MAC Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_exit.c Wed Dec 16 23:39:27 2015 (r292384) @@ -94,7 +94,7 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE1(proc, kernel, , exit, "int"); +SDT_PROBE_DEFINE1(proc, , , exit, "int"); /* Hook for NFS teardown procedure. */ void (*nlminfo_release_p)(struct proc *p); @@ -569,7 +569,7 @@ exit1(struct thread *td, int rval, int s reason = CLD_DUMPED; else if (WIFSIGNALED(signo)) reason = CLD_KILLED; - SDT_PROBE1(proc, kernel, , exit, reason); + SDT_PROBE1(proc, , , exit, reason); #endif /* Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_fork.c Wed Dec 16 23:39:27 2015 (r292384) @@ -89,8 +89,7 @@ dtrace_fork_func_t dtrace_fasttrap_fork; #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE3(proc, kernel, , create, "struct proc *", - "struct proc *", "int"); +SDT_PROBE_DEFINE3(proc, , , create, "struct proc *", "struct proc *", "int"); #ifndef _SYS_SYSPROTO_H_ struct fork_args { @@ -748,7 +747,7 @@ do_fork(struct thread *td, int flags, st * Tell any interested parties about the new process. */ knote_fork(&p1->p_klist, p2->p_pid); - SDT_PROBE3(proc, kernel, , create, p2, p1, flags); + SDT_PROBE3(proc, , , create, p2, p1, flags); /* * Wait until debugger is attached to child. Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_proc.c Wed Dec 16 23:39:27 2015 (r292384) @@ -92,18 +92,15 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(proc); -SDT_PROBE_DEFINE4(proc, kernel, ctor, entry, "struct proc *", "int", - "void *", "int"); -SDT_PROBE_DEFINE4(proc, kernel, ctor, return, "struct proc *", "int", - "void *", "int"); -SDT_PROBE_DEFINE4(proc, kernel, dtor, entry, "struct proc *", "int", - "void *", "struct thread *"); -SDT_PROBE_DEFINE3(proc, kernel, dtor, return, "struct proc *", "int", - "void *"); -SDT_PROBE_DEFINE3(proc, kernel, init, entry, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, , ctor, entry, "struct proc *", "int", "void *", "int"); -SDT_PROBE_DEFINE3(proc, kernel, init, return, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, , ctor, return, "struct proc *", "int", "void *", "int"); +SDT_PROBE_DEFINE4(proc, , dtor, entry, "struct proc *", "int", "void *", + "struct thread *"); +SDT_PROBE_DEFINE3(proc, , dtor, return, "struct proc *", "int", "void *"); +SDT_PROBE_DEFINE3(proc, , init, entry, "struct proc *", "int", "int"); +SDT_PROBE_DEFINE3(proc, , init, return, "struct proc *", "int", "int"); MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); MALLOC_DEFINE(M_SESSION, "session", "session header"); @@ -196,9 +193,9 @@ proc_ctor(void *mem, int size, void *arg struct proc *p; p = (struct proc *)mem; - SDT_PROBE4(proc, kernel, ctor , entry, p, size, arg, flags); + SDT_PROBE4(proc, , ctor , entry, p, size, arg, flags); EVENTHANDLER_INVOKE(process_ctor, p); - SDT_PROBE4(proc, kernel, ctor , return, p, size, arg, flags); + SDT_PROBE4(proc, , ctor , return, p, size, arg, flags); return (0); } @@ -214,7 +211,7 @@ proc_dtor(void *mem, int size, void *arg /* INVARIANTS checks go here */ p = (struct proc *)mem; td = FIRST_THREAD_IN_PROC(p); - SDT_PROBE4(proc, kernel, dtor, entry, p, size, arg, td); + SDT_PROBE4(proc, , dtor, entry, p, size, arg, td); if (td != NULL) { #ifdef INVARIANTS KASSERT((p->p_numthreads == 1), @@ -227,7 +224,7 @@ proc_dtor(void *mem, int size, void *arg EVENTHANDLER_INVOKE(process_dtor, p); if (p->p_ksi != NULL) KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue")); - SDT_PROBE3(proc, kernel, dtor, return, p, size, arg); + SDT_PROBE3(proc, , dtor, return, p, size, arg); } /* @@ -239,7 +236,7 @@ proc_init(void *mem, int size, int flags struct proc *p; p = (struct proc *)mem; - SDT_PROBE3(proc, kernel, init, entry, p, size, flags); + SDT_PROBE3(proc, , init, entry, p, size, flags); p->p_sched = (struct p_sched *)&p[1]; mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW); mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_NEW); @@ -251,7 +248,7 @@ proc_init(void *mem, int size, int flags TAILQ_INIT(&p->p_threads); /* all threads in proc */ EVENTHANDLER_INVOKE(process_init, p); p->p_stats = pstats_alloc(); - SDT_PROBE3(proc, kernel, init, return, p, size, flags); + SDT_PROBE3(proc, , init, return, p, size, flags); return (0); } Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_racct.c Wed Dec 16 23:39:27 2015 (r292384) @@ -102,30 +102,32 @@ static void racct_add_cred_locked(struct uint64_t amount); SDT_PROVIDER_DEFINE(racct); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add, "struct proc *", "int", - "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add__failure, +SDT_PROBE_DEFINE3(racct, , rusage, add, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add__cred, "struct ucred *", - "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add__force, "struct proc *", - "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, set, "struct proc *", "int", - "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, set__failure, +SDT_PROBE_DEFINE3(racct, , rusage, add__failure, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, sub, "struct proc *", "int", - "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, sub__cred, "struct ucred *", - "int", "uint64_t"); -SDT_PROBE_DEFINE1(racct, kernel, racct, create, "struct racct *"); -SDT_PROBE_DEFINE1(racct, kernel, racct, destroy, "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, join, "struct racct *", +SDT_PROBE_DEFINE3(racct, , rusage, add__cred, + "struct ucred *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, add__force, + "struct proc *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, set, + "struct proc *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, set__failure, + "struct proc *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, sub, + "struct proc *", "int", "uint64_t"); +SDT_PROBE_DEFINE3(racct, , rusage, sub__cred, + "struct ucred *", "int", "uint64_t"); +SDT_PROBE_DEFINE1(racct, , racct, create, "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, join__failure, - "struct racct *", "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, leave, "struct racct *", +SDT_PROBE_DEFINE1(racct, , racct, destroy, "struct racct *"); +SDT_PROBE_DEFINE2(racct, , racct, join, + "struct racct *", "struct racct *"); +SDT_PROBE_DEFINE2(racct, , racct, join__failure, + "struct racct *", "struct racct *"); +SDT_PROBE_DEFINE2(racct, , racct, leave, + "struct racct *", "struct racct *"); int racct_types[] = { [RACCT_CPU] = @@ -445,7 +447,7 @@ racct_create(struct racct **racctp) if (!racct_enable) return; - SDT_PROBE1(racct, kernel, racct, create, racctp); + SDT_PROBE1(racct, , racct, create, racctp); KASSERT(*racctp == NULL, ("racct already allocated")); @@ -460,7 +462,7 @@ racct_destroy_locked(struct racct **racc ASSERT_RACCT_ENABLED(); - SDT_PROBE1(racct, kernel, racct, destroy, racctp); + SDT_PROBE1(racct, , racct, destroy, racctp); mtx_assert(&racct_lock, MA_OWNED); KASSERT(racctp != NULL, ("NULL racctp")); @@ -538,7 +540,7 @@ racct_add_locked(struct proc *p, int res ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, kernel, rusage, add, p, resource, amount); + SDT_PROBE3(racct, , rusage, add, p, resource, amount); /* * We need proc lock to dereference p->p_ucred. @@ -548,8 +550,7 @@ racct_add_locked(struct proc *p, int res #ifdef RCTL error = rctl_enforce(p, resource, amount); if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE3(racct, kernel, rusage, add__failure, p, resource, - amount); + SDT_PROBE3(racct, , rusage, add__failure, p, resource, amount); return (error); } #endif @@ -584,7 +585,7 @@ racct_add_cred_locked(struct ucred *cred ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, kernel, rusage, add__cred, cred, resource, amount); + SDT_PROBE3(racct, , rusage, add__cred, cred, resource, amount); racct_adjust_resource(cred->cr_ruidinfo->ui_racct, resource, amount); for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent) @@ -622,7 +623,7 @@ racct_add_force(struct proc *p, int reso if (!racct_enable) return; - SDT_PROBE3(racct, kernel, rusage, add__force, p, resource, amount); + SDT_PROBE3(racct, , rusage, add__force, p, resource, amount); /* * We need proc lock to dereference p->p_ucred. @@ -646,7 +647,7 @@ racct_set_locked(struct proc *p, int res ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, kernel, rusage, set, p, resource, amount); + SDT_PROBE3(racct, , rusage, set, p, resource, amount); /* * We need proc lock to dereference p->p_ucred. @@ -678,8 +679,8 @@ racct_set_locked(struct proc *p, int res if (diff_proc > 0) { error = rctl_enforce(p, resource, diff_proc); if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE3(racct, kernel, rusage, set__failure, p, - resource, amount); + SDT_PROBE3(racct, , rusage, set__failure, p, resource, + amount); return (error); } } @@ -722,7 +723,7 @@ racct_set_force_locked(struct proc *p, i ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, kernel, rusage, set, p, resource, amount); + SDT_PROBE3(racct, , rusage, set, p, resource, amount); /* * We need proc lock to dereference p->p_ucred. @@ -833,7 +834,7 @@ racct_sub(struct proc *p, int resource, if (!racct_enable) return; - SDT_PROBE3(racct, kernel, rusage, sub, p, resource, amount); + SDT_PROBE3(racct, , rusage, sub, p, resource, amount); /* * We need proc lock to dereference p->p_ucred. @@ -860,7 +861,7 @@ racct_sub_cred_locked(struct ucred *cred ASSERT_RACCT_ENABLED(); - SDT_PROBE3(racct, kernel, rusage, sub__cred, cred, resource, amount); + SDT_PROBE3(racct, , rusage, sub__cred, cred, resource, amount); #ifdef notyet KASSERT(RACCT_CAN_DROP(resource), Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_sig.c Wed Dec 16 23:39:27 2015 (r292384) @@ -94,11 +94,11 @@ __FBSDID("$FreeBSD$"); #define ONSIG 32 /* NSIG for osig* syscalls. XXX. */ SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE3(proc, kernel, , signal__send, "struct thread *", - "struct proc *", "int"); -SDT_PROBE_DEFINE2(proc, kernel, , signal__clear, "int", - "ksiginfo_t *"); -SDT_PROBE_DEFINE3(proc, kernel, , signal__discard, +SDT_PROBE_DEFINE3(proc, , , signal__send, + "struct thread *", "struct proc *", "int"); +SDT_PROBE_DEFINE2(proc, , , signal__clear, + "int", "ksiginfo_t *"); +SDT_PROBE_DEFINE3(proc, , , signal__discard, "struct thread *", "struct proc *", "int"); static int coredump(struct thread *); @@ -1308,7 +1308,7 @@ kern_sigtimedwait(struct thread *td, sig reschedule_signals(p, new_block, 0); if (error == 0) { - SDT_PROBE2(proc, kernel, , signal__clear, sig, ksi); + SDT_PROBE2(proc, , , signal__clear, sig, ksi); if (ksi->ksi_code == SI_TIMER) itimer_accept(p, ksi->ksi_timerid, ksi); @@ -2121,7 +2121,7 @@ tdsendsignal(struct proc *p, struct thre } else sigqueue = &td->td_sigqueue; - SDT_PROBE3(proc, kernel, , signal__send, td, p, sig); + SDT_PROBE3(proc, , , signal__send, td, p, sig); /* * If the signal is being ignored, @@ -2132,7 +2132,7 @@ tdsendsignal(struct proc *p, struct thre */ mtx_lock(&ps->ps_mtx); if (SIGISMEMBER(ps->ps_sigignore, sig)) { - SDT_PROBE3(proc, kernel, , signal__discard, td, p, sig); + SDT_PROBE3(proc, , , signal__discard, td, p, sig); mtx_unlock(&ps->ps_mtx); if (ksi && (ksi->ksi_flags & KSI_INS)) Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/kern_timeout.c Wed Dec 16 23:39:27 2015 (r292384) @@ -69,10 +69,8 @@ DPCPU_DECLARE(sbintime_t, hardclocktime) #endif SDT_PROVIDER_DEFINE(callout_execute); -SDT_PROBE_DEFINE1(callout_execute, kernel, , callout__start, - "struct callout *"); -SDT_PROBE_DEFINE1(callout_execute, kernel, , callout__end, - "struct callout *"); +SDT_PROBE_DEFINE1(callout_execute, , , callout__start, "struct callout *"); +SDT_PROBE_DEFINE1(callout_execute, , , callout__end, "struct callout *"); #ifdef CALLOUT_PROFILING static int avg_depth; @@ -721,9 +719,9 @@ softclock_call_cc(struct callout *c, str sbt1 = sbinuptime(); #endif THREAD_NO_SLEEPING(); - SDT_PROBE1(callout_execute, kernel, , callout__start, c); + SDT_PROBE1(callout_execute, , , callout__start, c); c_func(c_arg); - SDT_PROBE1(callout_execute, kernel, , callout__end, c); + SDT_PROBE1(callout_execute, , , callout__end, c); THREAD_SLEEPING_OK(); #if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) sbt2 = sbinuptime(); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/kern/vfs_cache.c Wed Dec 16 23:39:27 2015 (r292384) @@ -417,7 +417,6 @@ cache_zap(ncp) rw_assert(&cache_lock, RA_WLOCKED); CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); -#ifdef KDTRACE_HOOKS if (ncp->nc_vp != NULL) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, nc_get_name(ncp), ncp->nc_vp); @@ -425,7 +424,6 @@ cache_zap(ncp) SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, nc_get_name(ncp)); } -#endif vp = NULL; LIST_REMOVE(ncp, nc_hash); if (ncp->nc_flag & NCF_ISDOTDOT) { Modified: head/sys/netinet/in_kdtrace.c ============================================================================== --- head/sys/netinet/in_kdtrace.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/netinet/in_kdtrace.c Wed Dec 16 23:39:27 2015 (r292384) @@ -122,7 +122,7 @@ SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop, "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *", - "uint8_t *", "ipinfo_t *") + "uint8_t *", "ipinfo_t *"); SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change, "void *", "void *", Modified: head/sys/netinet/in_kdtrace.h ============================================================================== --- head/sys/netinet/in_kdtrace.h Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/netinet/in_kdtrace.h Wed Dec 16 23:39:27 2015 (r292384) @@ -32,13 +32,13 @@ SDT_PROBE6(ip, , , probe, arg0, arg1, arg2, arg3, arg4, arg5) #define UDP_PROBE(probe, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE5(udp, , , probe, arg0, arg1, arg2, arg3, arg4) -#define TCP_PROBE1(probe, arg0) \ +#define TCP_PROBE1(probe, arg0) \ SDT_PROBE1(tcp, , , probe, arg0) -#define TCP_PROBE2(probe, arg0, arg1) \ +#define TCP_PROBE2(probe, arg0, arg1) \ SDT_PROBE2(tcp, , , probe, arg0, arg1) -#define TCP_PROBE3(probe, arg0, arg1, arg2) \ +#define TCP_PROBE3(probe, arg0, arg1, arg2) \ SDT_PROBE3(tcp, , , probe, arg0, arg1, arg2) -#define TCP_PROBE4(probe, arg0, arg1, arg2, arg3) \ +#define TCP_PROBE4(probe, arg0, arg1, arg2, arg3) \ SDT_PROBE4(tcp, , , probe, arg0, arg1, arg2, arg3) #define TCP_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE5(tcp, , , probe, arg0, arg1, arg2, arg3, arg4) Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/netinet/sctp_cc_functions.c Wed Dec 16 23:39:27 2015 (r292384) @@ -95,7 +95,7 @@ sctp_set_initial_cc_param(struct sctp_tc } sctp_enforce_cwnd_limit(assoc, net); net->ssthresh = assoc->peers_rwnd; - SDT_PROBE(sctp, cwnd, net, init, + SDT_PROBE5(sctp, cwnd, net, init, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, 0, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & @@ -193,7 +193,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } net->cwnd = net->ssthresh; sctp_enforce_cwnd_limit(asoc, net); - SDT_PROBE(sctp, cwnd, net, fr, + SDT_PROBE5(sctp, cwnd, net, fr, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -261,7 +261,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct */ /* Probe point 5 */ probepoint |= ((5 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -282,7 +282,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct oth |= net->cc_mod.rtcc.step_cnt; oth <<= 16; oth |= net->cc_mod.rtcc.last_step_state; - SDT_PROBE(sctp, cwnd, net, rttstep, + SDT_PROBE5(sctp, cwnd, net, rttstep, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -306,7 +306,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct */ /* Probe point 6 */ probepoint |= ((6 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -318,7 +318,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct oth |= net->cc_mod.rtcc.step_cnt; oth <<= 16; oth |= net->cc_mod.rtcc.last_step_state; - SDT_PROBE(sctp, cwnd, net, rttstep, + SDT_PROBE5(sctp, cwnd, net, rttstep, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -349,7 +349,7 @@ cc_bw_same(struct sctp_tcb *stcb, struct */ /* Probe point 7 */ probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -398,7 +398,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st /* We caused it maybe.. back off? */ /* PROBE POINT 1 */ probepoint |= ((1 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -416,7 +416,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st } /* Probe point 2 */ probepoint |= ((2 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -429,7 +429,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st oth |= net->cc_mod.rtcc.step_cnt; oth <<= 16; oth |= net->cc_mod.rtcc.last_step_state; - SDT_PROBE(sctp, cwnd, net, rttstep, + SDT_PROBE5(sctp, cwnd, net, rttstep, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -453,7 +453,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st /* bw & rtt decreased */ /* Probe point 3 */ probepoint |= ((3 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -465,7 +465,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st oth |= net->cc_mod.rtcc.step_cnt; oth <<= 16; oth |= net->cc_mod.rtcc.last_step_state; - SDT_PROBE(sctp, cwnd, net, rttstep, + SDT_PROBE5(sctp, cwnd, net, rttstep, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -485,7 +485,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st /* The bw decreased but rtt stayed the same */ /* Probe point 4 */ probepoint |= ((4 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -497,7 +497,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st oth |= net->cc_mod.rtcc.step_cnt; oth <<= 16; oth |= net->cc_mod.rtcc.last_step_state; - SDT_PROBE(sctp, cwnd, net, rttstep, + SDT_PROBE5(sctp, cwnd, net, rttstep, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -535,7 +535,7 @@ cc_bw_increase(struct sctp_tcb *stcb, st */ /* PROBE POINT 0 */ probepoint = (((uint64_t) net->cwnd) << 32); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -547,7 +547,7 @@ cc_bw_increase(struct sctp_tcb *stcb, st oth |= net->cc_mod.rtcc.step_cnt; oth <<= 16; oth |= net->cc_mod.rtcc.last_step_state; - SDT_PROBE(sctp, cwnd, net, rttstep, + SDT_PROBE5(sctp, cwnd, net, rttstep, vtag, ((net->cc_mod.rtcc.lbw << 32) | nbw), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -647,7 +647,7 @@ cc_bw_limit(struct sctp_tcb *stcb, struc /* Can't determine do not change */ probepoint |= ((0xd << 16) | inst_ind); } - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((nbw << 32) | inst_bw), ((net->cc_mod.rtcc.lbw_rtt << 32) | rtt), @@ -807,7 +807,7 @@ sctp_cwnd_update_after_sack_common(struc (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, nbw, ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -906,7 +906,7 @@ sctp_cwnd_update_after_sack_common(struc sctp_log_cwnd(stcb, net, incr, SCTP_CWND_LOG_FROM_SS); } - SDT_PROBE(sctp, cwnd, net, ack, + SDT_PROBE5(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -969,7 +969,7 @@ sctp_cwnd_update_after_sack_common(struc } net->cwnd += incr; sctp_enforce_cwnd_limit(asoc, net); - SDT_PROBE(sctp, cwnd, net, ack, + SDT_PROBE5(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -1001,7 +1001,7 @@ sctp_cwnd_update_exit_pf_common(struct s old_cwnd = net->cwnd; net->cwnd = net->mtu; - SDT_PROBE(sctp, cwnd, net, ack, + SDT_PROBE5(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", @@ -1072,7 +1072,7 @@ sctp_cwnd_update_after_timeout(struct sc } net->cwnd = net->mtu; net->partial_bytes_acked = 0; - SDT_PROBE(sctp, cwnd, net, to, + SDT_PROBE5(sctp, cwnd, net, to, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -1132,7 +1132,7 @@ sctp_cwnd_update_after_ecn_echo_common(s net->RTO <<= 1; } net->cwnd = net->ssthresh; - SDT_PROBE(sctp, cwnd, net, ecn, + SDT_PROBE5(sctp, cwnd, net, ecn, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -1251,7 +1251,7 @@ sctp_cwnd_update_after_packet_dropped(st sctp_enforce_cwnd_limit(&stcb->asoc, net); if (net->cwnd - old_cwnd != 0) { /* log only changes */ - SDT_PROBE(sctp, cwnd, net, pd, + SDT_PROBE5(sctp, cwnd, net, pd, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -1274,7 +1274,7 @@ sctp_cwnd_update_after_output(struct sct if (burst_limit) { net->cwnd = (net->flight_size + (burst_limit * net->mtu)); sctp_enforce_cwnd_limit(&stcb->asoc, net); - SDT_PROBE(sctp, cwnd, net, bl, + SDT_PROBE5(sctp, cwnd, net, bl, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -1350,7 +1350,7 @@ sctp_cwnd_new_rtcc_transmission_begins(s probepoint = (((uint64_t) net->cwnd) << 32); /* Probe point 8 */ probepoint |= ((8 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | 0), ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), @@ -1413,7 +1413,7 @@ sctp_set_rtcc_initial_cc_param(struct sc vtag = (net->rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); - SDT_PROBE(sctp, cwnd, net, rttvar, + SDT_PROBE5(sctp, cwnd, net, rttvar, vtag, 0, 0, Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/security/mac/mac_framework.c Wed Dec 16 23:39:27 2015 (r292384) @@ -93,11 +93,11 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); -SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, "int", +SDT_PROBE_DEFINE2(mac, , policy, modevent, "int", "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, register, +SDT_PROBE_DEFINE1(mac, , policy, register, "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, +SDT_PROBE_DEFINE1(mac, , policy, unregister, "struct mac_policy_conf *"); /* @@ -444,7 +444,7 @@ mac_policy_register(struct mac_policy_co (*(mpc->mpc_ops->mpo_init))(mpc); mac_policy_update(); - SDT_PROBE(mac, kernel, policy, register, mpc, 0, 0, 0, 0); + SDT_PROBE1(mac, , policy, register, mpc); printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, mpc->mpc_name); @@ -491,7 +491,7 @@ mac_policy_unregister(struct mac_policy_ mac_policy_update(); mac_policy_xunlock(); - SDT_PROBE(mac, kernel, policy, unregister, mpc, 0, 0, 0, 0); + SDT_PROBE1(mac, , policy, unregister, mpc); printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname, mpc->mpc_name); @@ -517,7 +517,7 @@ mac_policy_modevent(module_t mod, int ty } #endif - SDT_PROBE(mac, kernel, policy, modevent, type, mpc, 0, 0, 0); + SDT_PROBE2(mac, , policy, modevent, type, mpc); switch (type) { case MOD_LOAD: if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE && Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Wed Dec 16 23:23:12 2015 (r292383) +++ head/sys/security/mac/mac_internal.h Wed Dec 16 23:39:27 2015 (r292384) @@ -74,35 +74,35 @@ SDT_PROVIDER_DECLARE(mac); /* MAC Frame SDT_PROVIDER_DECLARE(mac_framework); /* Entry points to MAC. */ #define MAC_CHECK_PROBE_DEFINE4(name, arg0, arg1, arg2, arg3) \ - SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac__check__err, \ + SDT_PROBE_DEFINE5(mac_framework, , name, mac__check__err, \ "int", arg0, arg1, arg2, arg3); \ - SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac__check__ok, \ + SDT_PROBE_DEFINE5(mac_framework, , name, mac__check__ok, \ "int", arg0, arg1, arg2, arg3); #define MAC_CHECK_PROBE_DEFINE3(name, arg0, arg1, arg2) \ - SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac__check__err, \ + SDT_PROBE_DEFINE4(mac_framework, , name, mac__check__err, \ "int", arg0, arg1, arg2); \ - SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac__check__ok, \ + SDT_PROBE_DEFINE4(mac_framework, , name, mac__check__ok, \ "int", arg0, arg1, arg2); #define MAC_CHECK_PROBE_DEFINE2(name, arg0, arg1) \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__check__err, \ + SDT_PROBE_DEFINE3(mac_framework, , name, mac__check__err, \ "int", arg0, arg1); \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__check__ok, \ + SDT_PROBE_DEFINE3(mac_framework, , name, mac__check__ok, \ "int", arg0, arg1); #define MAC_CHECK_PROBE_DEFINE1(name, arg0) \ - SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac__check__err, \ + SDT_PROBE_DEFINE2(mac_framework, , name, mac__check__err, \ "int", arg0); \ - SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac__check__ok, \ + SDT_PROBE_DEFINE2(mac_framework, , name, mac__check__ok, \ "int", arg0); #define MAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3) do { \ if (error) { \ - SDT_PROBE(mac_framework, kernel, name, mac__check__err, \ + SDT_PROBE5(mac_framework, , name, mac__check__err, \ error, arg0, arg1, arg2, arg3); \ } else { \ - SDT_PROBE(mac_framework, kernel, name, mac__check__ok, \ + SDT_PROBE5(mac_framework, , name, mac__check__ok, \ 0, arg0, arg1, arg2, arg3); \ } \ } while (0) @@ -116,18 +116,18 @@ SDT_PROVIDER_DECLARE(mac_framework); /* #endif #define MAC_GRANT_PROBE_DEFINE2(name, arg0, arg1) \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__grant__err, \ + SDT_PROBE_DEFINE3(mac_framework, , name, mac__grant__err, \ "int", arg0, arg1); \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__grant__ok, \ + SDT_PROBE_DEFINE3(mac_framework, , name, mac__grant__ok, \ "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ - SDT_PROBE(mac_framework, kernel, name, mac__grant__err, \ - error, arg0, arg1, 0, 0); \ + SDT_PROBE3(mac_framework, , name, mac__grant__err, \ + error, arg0, arg1); \ } else { \ - SDT_PROBE(mac_framework, kernel, name, mac__grant__ok, \ - error, arg0, arg1, 0, 0); \ + SDT_PROBE3(mac_framework, , name, mac__grant__ok, \ + error, arg0, arg1); \ } \ } while (0) From owner-svn-src-all@freebsd.org Wed Dec 16 23:46:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF4B3A4AEE6; Wed, 16 Dec 2015 23:46:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF8561242; Wed, 16 Dec 2015 23:46:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGNkSbO022512; Wed, 16 Dec 2015 23:46:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGNkSQP022511; Wed, 16 Dec 2015 23:46:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512162346.tBGNkSQP022511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 16 Dec 2015 23:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292385 - head/sys/cddl/dev/systrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:46:30 -0000 Author: markj Date: Wed Dec 16 23:46:27 2015 New Revision: 292385 URL: https://svnweb.freebsd.org/changeset/base/292385 Log: Remove the unused systrace device file and fix style bugs. MFC after: 1 week Modified: head/sys/cddl/dev/systrace/systrace.c Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Wed Dec 16 23:39:27 2015 (r292384) +++ head/sys/cddl/dev/systrace/systrace.c Wed Dec 16 23:46:27 2015 (r292385) @@ -19,9 +19,6 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org - * - * $FreeBSD$ - * */ /* @@ -30,6 +27,8 @@ */ #include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -50,8 +49,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -134,26 +133,17 @@ extern const char *freebsd32_syscallname #error 1 << SYSTRACE_SHIFT must exceed number of system calls #endif -static d_open_t systrace_open; -static int systrace_unload(void); -static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); +static void systrace_load(void *); +static void systrace_unload(void *); + +static void systrace_getargdesc(void *, dtrace_id_t, void *, + dtrace_argdesc_t *); static void systrace_provide(void *, dtrace_probedesc_t *); static void systrace_destroy(void *, dtrace_id_t, void *); static void systrace_enable(void *, dtrace_id_t, void *); static void systrace_disable(void *, dtrace_id_t, void *); -static void systrace_load(void *); - -static struct cdevsw systrace_cdevsw = { - .d_version = D_VERSION, - .d_open = systrace_open, -#ifndef NATIVE_ABI - .d_name = "systrace_" MODNAME, -#else - .d_name = "systrace", -#endif -}; -static union { +static union { const char **p_constnames; char **pp_syscallnames; } uglyhack = { SYSCALLNAMES }; @@ -179,7 +169,6 @@ static dtrace_pops_t systrace_pops = { systrace_destroy }; -static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, @@ -194,29 +183,31 @@ typedef void (*systrace_dtrace_probe_t)( * compat syscall from something like Linux. */ static void -systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, +systrace_probe(uint32_t id, int sysnum, struct sysent *sysent, void *params, int ret) { + uint64_t uargs[8]; systrace_dtrace_probe_t probe; - int n_args = 0; - u_int64_t uargs[8]; + int n_args = 0; memset(uargs, 0, sizeof(uargs)); + /* * Check if this syscall has an argument conversion function * registered. */ - if (params && sysent->sy_systrace_args_func != NULL) { + if (params != NULL && sysent->sy_systrace_args_func != NULL) { /* * Convert the syscall parameters using the registered * function. */ - (*sysent->sy_systrace_args_func)(sysnum, params, uargs, &n_args); - } else if (params) { + (*sysent->sy_systrace_args_func)(sysnum, params, uargs, + &n_args); + } else if (params != NULL) { /* * Use the built-in system call argument conversion * function to translate the syscall structure fields - * into the array of 64-bit values that DTrace + * into the array of 64-bit values that DTrace * expects. */ systrace_args(sysnum, params, uargs, &n_args); @@ -237,21 +228,20 @@ systrace_probe(u_int32_t id, int sysnum, #endif static void -systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) +systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, + dtrace_argdesc_t *desc) { int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); if (SYSTRACE_ISENTRY((uintptr_t)parg)) - systrace_entry_setargdesc(sysnum, desc->dtargd_ndx, + systrace_entry_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native, sizeof(desc->dtargd_native)); else - systrace_return_setargdesc(sysnum, desc->dtargd_ndx, + systrace_return_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native, sizeof(desc->dtargd_native)); if (desc->dtargd_native[0] == '\0') desc->dtargd_ndx = DTRACE_ARGNONE; - - return; } static void @@ -267,11 +257,13 @@ systrace_provide(void *arg, dtrace_probe uglyhack.pp_syscallnames[i], "entry") != 0) continue; - (void) dtrace_probe_create(systrace_id, MODNAME, uglyhack.pp_syscallnames[i], - "entry", SYSTRACE_ARTIFICIAL_FRAMES, + (void)dtrace_probe_create(systrace_id, MODNAME, + uglyhack.pp_syscallnames[i], "entry", + SYSTRACE_ARTIFICIAL_FRAMES, (void *)((uintptr_t)SYSTRACE_ENTRY(i))); - (void) dtrace_probe_create(systrace_id, MODNAME, uglyhack.pp_syscallnames[i], - "return", SYSTRACE_ARTIFICIAL_FRAMES, + (void)dtrace_probe_create(systrace_id, MODNAME, + uglyhack.pp_syscallnames[i], "return", + SYSTRACE_ARTIFICIAL_FRAMES, (void *)((uintptr_t)SYSTRACE_RETURN(i))); } } @@ -318,14 +310,11 @@ systrace_disable(void *arg, dtrace_id_t } static void -systrace_load(void *dummy) +systrace_load(void *dummy __unused) { - /* Create the /dev/dtrace/systrace entry. */ - systrace_cdev = make_dev(&systrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - DEVNAME); - if (dtrace_register(PROVNAME, &systrace_attr, DTRACE_PRIV_USER, - NULL, &systrace_pops, NULL, &systrace_id) != 0) + if (dtrace_register(PROVNAME, &systrace_attr, DTRACE_PRIV_USER, NULL, + &systrace_pops, NULL, &systrace_id) != 0) return; #ifdef NATIVE_ABI @@ -333,29 +322,24 @@ systrace_load(void *dummy) #endif } - -static int -systrace_unload() +static void +systrace_unload(void *dummy __unused) { - int error = 0; - - if ((error = dtrace_unregister(systrace_id)) != 0) - return (error); #ifdef NATIVE_ABI systrace_probe_func = NULL; #endif - destroy_dev(systrace_cdev); - - return (error); + if (dtrace_unregister(systrace_id) != 0) + return; } static int systrace_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; + int error; + error = 0; switch (type) { case MOD_LOAD: break; @@ -374,14 +358,10 @@ systrace_modevent(module_t mod __unused, return (error); } -static int -systrace_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused) -{ - return (0); -} - -SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_load, NULL); -SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL); +SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + systrace_load, NULL); +SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + systrace_unload, NULL); #ifdef LINUX_SYSTRACE DEV_MODULE(systrace_linux, systrace_modevent, NULL); From owner-svn-src-all@freebsd.org Wed Dec 16 23:48:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF89BA480BA; Wed, 16 Dec 2015 23:48:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7231525; Wed, 16 Dec 2015 23:48:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGNmo8l022732; Wed, 16 Dec 2015 23:48:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGNmo2r022728; Wed, 16 Dec 2015 23:48:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201512162348.tBGNmo2r022728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Dec 2015 23:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292386 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/fuse fs/nfsclient fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:48:52 -0000 Author: glebius Date: Wed Dec 16 23:48:50 2015 New Revision: 292386 URL: https://svnweb.freebsd.org/changeset/base/292386 Log: Fix breakage caused by r292373 in ZFS/FUSE/NFS/SMBFS. With the new VOP_GETPAGES() KPI the "count" argument counts pages already, and doesn't need to be translated from bytes to pages. While here make it consistent that *rbehind and *rahead are updated only if we doesn't return error. Pointy hat to: glebius Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/smbfs/smbfs_io.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Dec 16 23:46:27 2015 (r292385) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Dec 16 23:48:50 2015 (r292386) @@ -5775,27 +5775,21 @@ zfs_getpages(struct vnode *vp, vm_page_t off_t startoff, endoff; int i, error; vm_pindex_t reqstart, reqend; - int pcount, lsize, reqsize, size; + int lsize, reqsize, size; - if (rbehind) - *rbehind = 0; - if (rahead) - *rahead = 0; + object = m[0]->object; + error = 0; ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); - pcount = OFF_TO_IDX(round_page(count)); - zfs_vmobject_wlock(object); - if (m[pcount - 1]->valid != 0 && --pcount == 0) { + if (m[count - 1]->valid != 0 && --count == 0) { zfs_vmobject_wunlock(object); - ZFS_EXIT(zfsvfs); - return (zfs_vm_pagerret_ok); + goto out; } - object = m[0]->object; - mlast = m[pcount - 1]; + mlast = m[count - 1]; if (IDX_TO_OFF(mlast->pindex) >= object->un_pager.vnp.vnp_size) { @@ -5813,10 +5807,9 @@ zfs_getpages(struct vnode *vp, vm_page_t IDX_TO_OFF(mlast->pindex); zfs_vmobject_wunlock(object); - error = 0; - for (i = 0; i < pcount; i++) { + for (i = 0; i < count; i++) { size = PAGE_SIZE; - if (i == pcount - 1) + if (i == count - 1) size = lsize; va = zfs_map_page(m[i], &sf); error = dmu_read(os, zp->z_id, IDX_TO_OFF(m[i]->pindex), @@ -5829,14 +5822,21 @@ zfs_getpages(struct vnode *vp, vm_page_t } zfs_vmobject_wlock(object); - for (i = 0; i < pcount; i++) + for (i = 0; i < count; i++) m[i]->valid = VM_PAGE_BITS_ALL; zfs_vmobject_wunlock(object); out: ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - return (error ? zfs_vm_pagerret_error : zfs_vm_pagerret_ok); + if (error == 0) { + if (rbehind) + *rbehind = 0; + if (rahead) + *rahead = 0; + return (zfs_vm_pagerret_ok); + } else + return (zfs_vm_pagerret_error); } static int Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Dec 16 23:46:27 2015 (r292385) +++ head/sys/fs/fuse/fuse_vnops.c Wed Dec 16 23:48:50 2015 (r292386) @@ -1752,17 +1752,12 @@ fuse_vnop_getpages(struct vop_getpages_a td = curthread; /* XXX */ cred = curthread->td_ucred; /* XXX */ pages = ap->a_m; - count = ap->a_count; - if (ap->a_rbehind) - *ap->a_rbehind = 0; - if (ap->a_rahead) - *ap->a_rahead = 0; + npages = ap->a_count; if (!fsess_opt_mmap(vnode_mount(vp))) { FS_DEBUG("called on non-cacheable vnode??\n"); return (VM_PAGER_ERROR); } - npages = btoc(count); /* * If the last page is partially valid, just return it and allow @@ -1773,13 +1768,8 @@ fuse_vnop_getpages(struct vop_getpages_a * but still somewhat disconnected from the kernel? */ VM_OBJECT_WLOCK(vp->v_object); - if (pages[npages - 1]->valid != 0) { - if (--npages == 0) { - VM_OBJECT_WUNLOCK(vp->v_object); - return (VM_PAGER_OK); - } - count = npages << PAGE_SHIFT; - } + if (pages[npages - 1]->valid != 0 && --npages == 0) + goto out; VM_OBJECT_WUNLOCK(vp->v_object); /* @@ -1793,6 +1783,7 @@ fuse_vnop_getpages(struct vop_getpages_a PCPU_INC(cnt.v_vnodein); PCPU_ADD(cnt.v_vnodepgsin, npages); + count = npages << PAGE_SHIFT; iov.iov_base = (caddr_t)kva; iov.iov_len = count; uio.uio_iov = &iov; @@ -1852,8 +1843,13 @@ fuse_vnop_getpages(struct vop_getpages_a } } fuse_vm_page_unlock_queues(); +out: VM_OBJECT_WUNLOCK(vp->v_object); - return 0; + if (ap->a_rbehind) + *ap->a_rbehind = 0; + if (ap->a_rahead) + *ap->a_rahead = 0; + return (VM_PAGER_OK); } /* Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Wed Dec 16 23:46:27 2015 (r292385) +++ head/sys/fs/nfsclient/nfs_clbio.c Wed Dec 16 23:48:50 2015 (r292386) @@ -100,11 +100,7 @@ ncl_getpages(struct vop_getpages_args *a cred = curthread->td_ucred; /* XXX */ nmp = VFSTONFS(vp->v_mount); pages = ap->a_m; - count = ap->a_count; - if (ap->a_rbehind) - *ap->a_rbehind = 0; - if (ap->a_rahead) - *ap->a_rahead = 0; + npages = ap->a_count; if ((object = vp->v_object) == NULL) { ncl_printf("nfs_getpages: called with non-merged cache vnode??\n"); @@ -130,8 +126,6 @@ ncl_getpages(struct vop_getpages_args *a } else mtx_unlock(&nmp->nm_mtx); - npages = btoc(count); - /* * If the requested page is partially valid, just return it and * allow the pager to zero-out the blanks. Partially valid pages @@ -140,13 +134,8 @@ ncl_getpages(struct vop_getpages_args *a * XXXGL: is that true for NFS, where short read can occur??? */ VM_OBJECT_WLOCK(object); - if (pages[npages - 1]->valid != 0) { - if (--npages == 0) { - VM_OBJECT_WUNLOCK(object); - return (VM_PAGER_OK); - } - count = npages << PAGE_SHIFT; - } + if (pages[npages - 1]->valid != 0 && --npages == 0) + goto out; VM_OBJECT_WUNLOCK(object); /* @@ -160,6 +149,7 @@ ncl_getpages(struct vop_getpages_args *a PCPU_INC(cnt.v_vnodein); PCPU_ADD(cnt.v_vnodepgsin, npages); + count = npages << PAGE_SHIFT; iov.iov_base = (caddr_t) kva; iov.iov_len = count; uio.uio_iov = &iov; @@ -221,8 +211,13 @@ ncl_getpages(struct vop_getpages_args *a ; } } +out: VM_OBJECT_WUNLOCK(object); - return (0); + if (ap->a_rbehind) + *ap->a_rbehind = 0; + if (ap->a_rahead) + *ap->a_rahead = 0; + return (VM_PAGER_OK); } /* Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Wed Dec 16 23:46:27 2015 (r292385) +++ head/sys/fs/smbfs/smbfs_io.c Wed Dec 16 23:48:50 2015 (r292386) @@ -449,12 +449,7 @@ smbfs_getpages(ap) np = VTOSMB(vp); smp = VFSTOSMBFS(vp->v_mount); pages = ap->a_m; - count = ap->a_count; - npages = btoc(count); - if (ap->a_rbehind) - *ap->a_rbehind = 0; - if (ap->a_rahead) - *ap->a_rahead = 0; + npages = ap->a_count; /* * If the requested page is partially valid, just return it and @@ -464,13 +459,8 @@ smbfs_getpages(ap) * XXXGL: is that true for SMB filesystem? */ VM_OBJECT_WLOCK(object); - if (pages[npages - 1]->valid != 0) { - if (--npages == 0) { - VM_OBJECT_WUNLOCK(object); - return (VM_PAGER_OK); - } - count = npages << PAGE_SHIFT; - } + if (pages[npages - 1]->valid != 0 && --npages == 0) + goto out; VM_OBJECT_WUNLOCK(object); scred = smbfs_malloc_scred(); @@ -483,6 +473,7 @@ smbfs_getpages(ap) PCPU_INC(cnt.v_vnodein); PCPU_ADD(cnt.v_vnodepgsin, npages); + count = npages << PAGE_SHIFT; iov.iov_base = (caddr_t) kva; iov.iov_len = count; uio.uio_iov = &iov; @@ -536,8 +527,13 @@ smbfs_getpages(ap) ; } } +out: VM_OBJECT_WUNLOCK(object); - return 0; + if (ap->a_rbehind) + *ap->a_rbehind = 0; + if (ap->a_rahead) + *ap->a_rahead = 0; + return (VM_PAGER_OK); #endif /* SMBFS_RWGENERIC */ } From owner-svn-src-all@freebsd.org Wed Dec 16 23:49:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA552A4811E; Wed, 16 Dec 2015 23:49:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 781C0176D; Wed, 16 Dec 2015 23:49:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBGNnImU044195 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 02:49:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBGNnI3c044194; Thu, 17 Dec 2015 02:49:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 02:49:18 +0300 From: Gleb Smirnoff To: Ivan Klymenko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151216234918.GF42340@FreeBSD.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> <20151217005806.5c6c962c@nonamehost.local> <20151216230633.GE42340@FreeBSD.org> <20151217013229.094d5b2d@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151217013229.094d5b2d@nonamehost.local> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 16 Dec 2015 23:49:22 -0000 Ivan, can you please test r292386? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Dec 17 00:00:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CE7DA48B03; Thu, 17 Dec 2015 00:00:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFC5D1255; Thu, 17 Dec 2015 00:00:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBH00SAC026330; Thu, 17 Dec 2015 00:00:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBH00RRT026326; Thu, 17 Dec 2015 00:00:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512170000.tBH00RRT026326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Dec 2015 00:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292388 - in head/sys: cddl/dev/dtrace cddl/dev/systrace 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 00:00:30 -0000 Author: markj Date: Thu Dec 17 00:00:27 2015 New Revision: 292388 URL: https://svnweb.freebsd.org/changeset/base/292388 Log: Support an arbitrary number of arguments to DTrace syscall probes. Rather than pushing all eight possible arguments into dtrace_probe()'s stack frame, make the syscall_args struct for the current syscall available via the current thread. Using a custom getargval method for the systrace provider, this allows any syscall argument to be fetched, even in kernels that have modified the maximum number of system call arguments. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h head/sys/cddl/dev/systrace/systrace.c head/sys/kern/subr_syscall.c head/sys/sys/sysent.h Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_cddl.h Wed Dec 16 23:53:16 2015 (r292387) +++ head/sys/cddl/dev/dtrace/dtrace_cddl.h Thu Dec 17 00:00:27 2015 (r292388) @@ -83,8 +83,8 @@ typedef struct kdtrace_thread { uintptr_t td_dtrace_regv; #endif u_int64_t td_hrtime; /* Last time on cpu. */ - int td_errno; /* Syscall return value. */ void *td_dtrace_sscr; /* Saved scratch space location. */ + void *td_systrace_args; /* syscall probe arguments. */ } kdtrace_thread_t; /* @@ -110,6 +110,7 @@ typedef struct kdtrace_thread { #define t_dtrace_astpc td_dtrace->td_dtrace_astpc #define t_dtrace_regv td_dtrace->td_dtrace_regv #define t_dtrace_sscr td_dtrace->td_dtrace_sscr +#define t_dtrace_systrace_args td_dtrace->td_systrace_args #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Wed Dec 16 23:53:16 2015 (r292387) +++ head/sys/cddl/dev/systrace/systrace.c Thu Dec 17 00:00:27 2015 (r292388) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,9 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include +#include + +#include #ifdef LINUX_SYSTRACE #if defined(__amd64__) @@ -138,6 +140,7 @@ static void systrace_unload(void *); static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); +static uint64_t systrace_getargval(void *, dtrace_id_t, void *, int, int); static void systrace_provide(void *, dtrace_probedesc_t *); static void systrace_destroy(void *, dtrace_id_t, void *); static void systrace_enable(void *, dtrace_id_t, void *); @@ -164,16 +167,13 @@ static dtrace_pops_t systrace_pops = { NULL, NULL, systrace_getargdesc, - NULL, + systrace_getargval, NULL, systrace_destroy }; static dtrace_provider_id_t systrace_id; -typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, - uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - #ifdef NATIVE_ABI /* * Probe callback function. @@ -183,48 +183,48 @@ typedef void (*systrace_dtrace_probe_t)( * compat syscall from something like Linux. */ static void -systrace_probe(uint32_t id, int sysnum, struct sysent *sysent, void *params, - int ret) +systrace_probe(struct syscall_args *sa, enum systrace_probe_t type, int retval) { - uint64_t uargs[8]; - systrace_dtrace_probe_t probe; - int n_args = 0; + uint64_t uargs[nitems(sa->args)]; + dtrace_id_t id; + int n_args, sysnum; + sysnum = sa->code; memset(uargs, 0, sizeof(uargs)); - /* - * Check if this syscall has an argument conversion function - * registered. - */ - if (params != NULL && sysent->sy_systrace_args_func != NULL) { - /* - * Convert the syscall parameters using the registered - * function. - */ - (*sysent->sy_systrace_args_func)(sysnum, params, uargs, - &n_args); - } else if (params != NULL) { + if (type == SYSTRACE_ENTRY) { + id = sa->callp->sy_entry; + + if (sa->callp->sy_systrace_args_func != NULL) + /* + * Convert the syscall parameters using the registered + * function. + */ + (*sa->callp->sy_systrace_args_func)(sysnum, sa->args, + uargs, &n_args); + else + /* + * Use the built-in system call argument conversion + * function to translate the syscall structure fields + * into the array of 64-bit values that DTrace expects. + */ + systrace_args(sysnum, sa->args, uargs, &n_args); /* - * Use the built-in system call argument conversion - * function to translate the syscall structure fields - * into the array of 64-bit values that DTrace - * expects. + * Save probe arguments now so that we can retrieve them if + * the getargval method is called from further down the stack. */ - systrace_args(sysnum, params, uargs, &n_args); + curthread->t_dtrace_systrace_args = uargs; } else { - /* - * Since params is NULL, this is a 'return' probe. - * Set arg0 and arg1 as the return value of this syscall. - */ - uargs[0] = uargs[1] = ret; + id = sa->callp->sy_return; + + curthread->t_dtrace_systrace_args = NULL; + /* Set arg0 and arg1 as the return value of this syscall. */ + uargs[0] = uargs[1] = retval; } /* Process the probe using the converted argments. */ - probe = (systrace_dtrace_probe_t)dtrace_probe; - probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], uargs[5], - uargs[6], uargs[7]); + dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); } - #endif static void @@ -244,6 +244,21 @@ systrace_getargdesc(void *arg, dtrace_id desc->dtargd_ndx = DTRACE_ARGNONE; } +static uint64_t +systrace_getargval(void *arg __unused, dtrace_id_t id __unused, + void *parg __unused, int argno, int aframes __unused) +{ + uint64_t *uargs; + + uargs = curthread->t_dtrace_systrace_args; + if (uargs == NULL) + /* This is a return probe. */ + return (0); + if (argno >= nitems(((struct syscall_args *)NULL)->args)) + return (0); + return (uargs[argno]); +} + static void systrace_provide(void *arg, dtrace_probedesc_t *desc) { Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Wed Dec 16 23:53:16 2015 (r292387) +++ head/sys/kern/subr_syscall.c Thu Dec 17 00:00:27 2015 (r292388) @@ -126,14 +126,9 @@ syscallenter(struct thread *td, struct s goto retval; #ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'entry', process the probe. - */ + /* Give the syscall:::entry DTrace probe a chance to fire. */ if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) - (*systrace_probe_func)(sa->callp->sy_entry, sa->code, - sa->callp, sa->args, 0); + (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); #endif AUDIT_SYSCALL_ENTER(sa->code, td); @@ -145,14 +140,10 @@ syscallenter(struct thread *td, struct s td->td_errno = error; #ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'return', process the probe. - */ + /* Give the syscall:::return DTrace probe a chance to fire. */ if (systrace_probe_func != NULL && sa->callp->sy_return != 0) - (*systrace_probe_func)(sa->callp->sy_return, sa->code, - sa->callp, NULL, (error) ? -1 : td->td_retval[0]); + (*systrace_probe_func)(sa, SYSTRACE_RETURN, + error ? -1 : td->td_retval[0]); #endif syscall_thread_exit(td, sa->callp); } Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Wed Dec 16 23:53:16 2015 (r292387) +++ head/sys/sys/sysent.h Thu Dec 17 00:00:27 2015 (r292388) @@ -38,18 +38,18 @@ struct rlimit; struct sysent; struct thread; struct ksiginfo; +struct syscall_args; + +enum systrace_probe_t { + SYSTRACE_ENTRY, + SYSTRACE_RETURN, +}; typedef int sy_call_t(struct thread *, void *); -/* Used by the machine dependent syscall() code. */ -typedef void (*systrace_probe_func_t)(u_int32_t, int, struct sysent *, void *, - int); - -/* - * Used by loaded syscalls to convert arguments to a DTrace array - * of 64-bit arguments. - */ -typedef void (*systrace_args_func_t)(int, void *, u_int64_t *, int *); +typedef void (*systrace_probe_func_t)(struct syscall_args *, + enum systrace_probe_t, int); +typedef void (*systrace_args_func_t)(int, void *, uint64_t *, int *); extern systrace_probe_func_t systrace_probe_func; @@ -84,7 +84,6 @@ struct sysent { /* system call table * struct image_params; struct __sigset; -struct syscall_args; struct trapframe; struct vnode; From owner-svn-src-all@freebsd.org Thu Dec 17 00:02:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A89EA48E31; Thu, 17 Dec 2015 00:02:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 392881775; Thu, 17 Dec 2015 00:02:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBH02r2N028996; Thu, 17 Dec 2015 00:02:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBH02rsY028995; Thu, 17 Dec 2015 00:02:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512170002.tBH02rsY028995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Dec 2015 00:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292389 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 00:02:54 -0000 Author: markj Date: Thu Dec 17 00:02:53 2015 New Revision: 292389 URL: https://svnweb.freebsd.org/changeset/base/292389 Log: Consistently use ${AWK} instead of hard-coding the program name. MFC after: 3 days Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Dec 17 00:00:27 2015 (r292388) +++ head/sys/conf/kmod.mk Thu Dec 17 00:02:53 2015 (r292389) @@ -225,7 +225,7 @@ ${FULLPROG}: ${OBJS} .else grep -v '^#' < ${EXPORT_SYMS} > export_syms .endif - awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \ + ${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \ export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} .endif .endif From owner-svn-src-all@freebsd.org Thu Dec 17 00:38:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 142CAA4A44B; Thu, 17 Dec 2015 00:38:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 9A4691DA6; Thu, 17 Dec 2015 00:38:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBH0cOBH044851 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 03:38:24 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBH0cOr2044850; Thu, 17 Dec 2015 03:38:24 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 03:38:24 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 Message-ID: <20151217003824.GG42340@FreeBSD.org> References: <201512162226.tBGMQSvs098886@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512162226.tBGMQSvs098886@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 00:38:28 -0000 Steven, I'm sorry that wasn't able to review D4111 in time, but I have very strong concerns against r292275. And r292379 doesn't improve situation. I am asking you to back out both patches, and then we can get together back to the problem. The 156226 bug was sitting for 2 years in the bugzilla for a reason. It is a not "low hanging fruit" like koobs@ says. I'm sorry if I sound unforgiving, but you got a very bad commit record in this area. You committed r290403 to ip_carp.c which "added MTU support to carp interfaces", and that was after 4 YEARS of carp(4) being not an interface. So, I assume you doesn't have a good understanding of the current state of the stack, direction it is developed and things that can be done and can not (including DELAY() in callout(9). Note, that the MAINTAINERS file still lists me for ip_carp.c, and you didn't wait for my review. yet another reason to ask for backout. I understand that you got a product at work that needs to have problem fixed. I'm glad that you got a patch that works it around. But that doesn't mean the patch should immeditely be dumped in head with a threat of soon MFC. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Dec 17 01:24:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94227A49EC3; Thu, 17 Dec 2015 01:24:55 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5912D17D3; Thu, 17 Dec 2015 01:24:54 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=UQ6B0BBZOn8Umk4du/2gxOO4RtfBL4Riddl9xrNUahw=; b=wLJNS31LcRYXGoq/7zU9fnOlkUAquJh5exMCK3RDjW4JiVrISkFHLkZScEebdbU1nXc7g0GgoAiXbnnW9Jzu9LJw75ahcqI49phM6A1eywZluJg3ABC6L+331N50XXmKiPDcLsNv7Q9VTaQASiAqeJ2jTyB57mN+5fKGI92nMNM=; Received: from [46.185.1.75] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1a9NJL-0003hE-QY ; Thu, 17 Dec 2015 03:24:51 +0200 Date: Thu, 17 Dec 2015 03:24:51 +0200 From: Ivan Klymenko To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r292373 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs/nfsclient sys/fs/smbfs sys/fs/tmpfs sys... Message-ID: <20151217032451.073de12c@nonamehost.local> In-Reply-To: <20151216234918.GF42340@FreeBSD.org> References: <201512162130.tBGLUjPj083575@repo.freebsd.org> <20151217005806.5c6c962c@nonamehost.local> <20151216230633.GE42340@FreeBSD.org> <20151217013229.094d5b2d@nonamehost.local> <20151216234918.GF42340@FreeBSD.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=46.185.1.75; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 01:24:55 -0000 On Thu, 17 Dec 2015 02:49:18 +0300 Gleb Smirnoff wrote: > Ivan, > > can you please test r292386? > It works. The panic was gone. Thank you for your work. From owner-svn-src-all@freebsd.org Thu Dec 17 02:02:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207B3A4971F; Thu, 17 Dec 2015 02:02:11 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF9C1EED; Thu, 17 Dec 2015 02:02:10 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBH22AYh064322; Thu, 17 Dec 2015 02:02:10 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBH229qQ064320; Thu, 17 Dec 2015 02:02:09 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201512170202.tBH229qQ064320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 17 Dec 2015 02:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292394 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 02:02:11 -0000 Author: gnn Date: Thu Dec 17 02:02:09 2015 New Revision: 292394 URL: https://svnweb.freebsd.org/changeset/base/292394 Log: Switch the IPsec related statistics to using the built in sysctl variable set rather than reading from kernel memory. This also makes the -z (zero) flag work correctly MFC after: 1 week Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D4591 Modified: head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/main.c Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Thu Dec 17 01:33:45 2015 (r292393) +++ head/usr.bin/netstat/ipsec.c Thu Dec 17 02:02:09 2015 (r292394) @@ -216,10 +216,17 @@ ipsec_stats(u_long off, const char *name { struct ipsecstat ipsecstat; - if (off == 0) - return; + if (strcmp(name, "ipsec6") == 0) { + if (fetch_stats("net.inet6.ipsec6.ipsecstats", off,&ipsecstat, + sizeof(ipsecstat), kread_counters) != 0) + return; + } else { + if (fetch_stats("net.inet.ipsec.ipsecstats", off, &ipsecstat, + sizeof(ipsecstat), kread_counters) != 0) + return; + } + xo_emit("{T:/%s}:\n", name); - kread_counters(off, (char *)&ipsecstat, sizeof(ipsecstat)); print_ipsecstats(&ipsecstat); } @@ -318,10 +325,11 @@ ah_stats(u_long off, const char *name, i { struct ahstat ahstat; - if (off == 0) + if (fetch_stats("net.inet.ah.stats", off, &ahstat, + sizeof(ahstat), kread_counters) != 0) return; + xo_emit("{T:/%s}:\n", name); - kread_counters(off, (char *)&ahstat, sizeof(ahstat)); print_ahstats(&ahstat); } @@ -377,10 +385,11 @@ esp_stats(u_long off, const char *name, { struct espstat espstat; - if (off == 0) + if (fetch_stats("net.inet.esp.stats", off, &espstat, + sizeof(espstat), kread_counters) != 0) return; + xo_emit("{T:/%s}:\n", name); - kread_counters(off, (char *)&espstat, sizeof(espstat)); print_espstats(&espstat); } @@ -434,10 +443,11 @@ ipcomp_stats(u_long off, const char *nam { struct ipcompstat ipcompstat; - if (off == 0) + if (fetch_stats("net.inet.ipcomp.stats", off, &ipcompstat, + sizeof(ipcompstat), kread_counters) != 0) return; + xo_emit("{T:/%s}:\n", name); - kread_counters(off, (char *)&ipcompstat, sizeof(ipcompstat)); print_ipcompstats(&ipcompstat); } Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Thu Dec 17 01:33:45 2015 (r292393) +++ head/usr.bin/netstat/main.c Thu Dec 17 02:02:09 2015 (r292394) @@ -108,13 +108,13 @@ static struct protox { igmp_stats, NULL, "igmp", 1, IPPROTO_IGMP }, #ifdef IPSEC { -1, N_IPSEC4STAT, 1, NULL, /* keep as compat */ - ipsec_stats, NULL, "ipsec", 0, 0}, + ipsec_stats, NULL, "ipsec", 1, 0}, { -1, N_AHSTAT, 1, NULL, - ah_stats, NULL, "ah", 0, 0}, + ah_stats, NULL, "ah", 1, 0}, { -1, N_ESPSTAT, 1, NULL, - esp_stats, NULL, "esp", 0, 0}, + esp_stats, NULL, "esp", 1, 0}, { -1, N_IPCOMPSTAT, 1, NULL, - ipcomp_stats, NULL, "ipcomp", 0, 0}, + ipcomp_stats, NULL, "ipcomp", 1, 0}, #endif { N_RIPCBINFO, N_PIMSTAT, 1, protopr, pim_stats, NULL, "pim", 1, IPPROTO_PIM }, @@ -146,7 +146,7 @@ static struct protox ip6protox[] = { #endif #ifdef IPSEC { -1, N_IPSEC6STAT, 1, NULL, - ipsec_stats, NULL, "ipsec6", 0, 0 }, + ipsec_stats, NULL, "ipsec6", 1, 0 }, #endif #ifdef notyet { -1, N_PIM6STAT, 1, NULL, From owner-svn-src-all@freebsd.org Thu Dec 17 06:13:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D93AA49AD3; Thu, 17 Dec 2015 06:13:51 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53B6B12FD; Thu, 17 Dec 2015 06:13:51 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pa0-x233.google.com with SMTP id wq6so36640228pac.1; Wed, 16 Dec 2015 22:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=C6DidgWRS47fxY+b9tR2zAP4pcSHm0QadxePMGuTCeI=; b=HFFNBes5DEmSuxBF1vOoNG8Zo8dEMfTGkHgoZPyl+CCZzbqemlAphvpnHmne/PBe+m 2O064SpKPy/PL1OvXuIL//dAFRVO8HBmUgXNAF/Lu25y4csJDzrYTGaSoLUvN1VDdrUL lp8ohnLukL5vw46mv5uPKMzFcgPXGil+EKOv+J2WBNu8h4TYjesPryW8ciVHmRYq0+ZG EXhryror1aVTUx7WQHVCmTs/7lcNq6SRG+GMLP77guPeTjkPdHNwwb7rdfVayqZKbMUv aerqpM9l0MQ8GZasRFCH2eKW8CmLjxiX13Q4QX4nPKgKwrH0ylfrS8a0gFuC4fX1pCcx WFcw== X-Received: by 10.66.190.66 with SMTP id go2mr70745593pac.114.1450332830731; Wed, 16 Dec 2015 22:13:50 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:c825:be55:88ec:f9f1? (2001-44b8-31ae-7b01-c825-be55-88ec-f9f1.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:c825:be55:88ec:f9f1]) by smtp.gmail.com with ESMTPSA id mj1sm12960867pab.34.2015.12.16.22.13.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Dec 2015 22:13:50 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> To: Gleb Smirnoff , Steven Hartland Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Kubilay Kocak X-Enigmail-Draft-Status: N1110 Message-ID: <56725294.80803@FreeBSD.org> Date: Thu, 17 Dec 2015 17:13:40 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <20151217003824.GG42340@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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 06:13:51 -0000 On 17/12/2015 11:38 AM, Gleb Smirnoff wrote: > I'm sorry that wasn't able to review D4111 in time, but I have > very strong concerns against r292275. And r292379 doesn't > improve situation. I am asking you to back out both patches, > and then we can get together back to the problem. The 156226 > bug was sitting for 2 years in the bugzilla for a reason. It > is a not "low hanging fruit" like koobs@ says. To clarify my comment on the review, I intended to refer to the *value*, and concrete *definition* of the desired feature (ie the problem space), not the triviality of any solution or implementation. I do my best not to presume where I don't have knowledge :) ./koobs From owner-svn-src-all@freebsd.org Thu Dec 17 06:31:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E907A4A587; Thu, 17 Dec 2015 06:31:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2FF41AFB; Thu, 17 Dec 2015 06:31:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBH6VtmG041290; Thu, 17 Dec 2015 06:31:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBH6VtQS041289; Thu, 17 Dec 2015 06:31:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512170631.tBH6VtQS041289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 17 Dec 2015 06:31: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: r292395 - stable/10/sbin/geom/class/multipath 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 06:31:57 -0000 Author: ngie Date: Thu Dec 17 06:31:55 2015 New Revision: 292395 URL: https://svnweb.freebsd.org/changeset/base/292395 Log: MFC r292048: Don't leak rsector/sector in mp_label(..) Use calloc instead of malloc + memset(.., 0, ..) when allocating sector Differential Revision: https://reviews.freebsd.org/D4450 Reported by: cppcheck Reviewed by: mav Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sbin/geom/class/multipath/geom_multipath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- stable/10/sbin/geom/class/multipath/geom_multipath.c Thu Dec 17 02:02:09 2015 (r292394) +++ stable/10/sbin/geom/class/multipath/geom_multipath.c Thu Dec 17 06:31:55 2015 (r292395) @@ -221,17 +221,15 @@ mp_label(struct gctl_req *req) /* * Allocate a sector to write as metadata. */ - sector = malloc(secsize); + sector = calloc(1, secsize); if (sector == NULL) { gctl_error(req, "unable to allocate metadata buffer"); return; } - memset(sector, 0, secsize); rsector = malloc(secsize); if (rsector == NULL) { - free(sector); gctl_error(req, "unable to allocate metadata buffer"); - return; + goto done; } /* @@ -246,7 +244,7 @@ mp_label(struct gctl_req *req) error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); - return; + goto done; } /* @@ -274,6 +272,9 @@ mp_label(struct gctl_req *req) name2, name); } } +done: + free(rsector); + free(sector); } From owner-svn-src-all@freebsd.org Thu Dec 17 06:35:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39102A4A872; Thu, 17 Dec 2015 06:35:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09F461E22; Thu, 17 Dec 2015 06:35:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBH6ZWYc041675; Thu, 17 Dec 2015 06:35:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBH6ZWKW041674; Thu, 17 Dec 2015 06:35:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512170635.tBH6ZWKW041674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 17 Dec 2015 06:35:32 +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: r292396 - stable/9/sbin/geom/class/multipath 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 06:35:33 -0000 Author: ngie Date: Thu Dec 17 06:35:31 2015 New Revision: 292396 URL: https://svnweb.freebsd.org/changeset/base/292396 Log: MFstable/10 r292395: MFC r292048: Don't leak rsector/sector in mp_label(..) Use calloc instead of malloc + memset(.., 0, ..) when allocating sector Differential Revision: https://reviews.freebsd.org/D4450 Reported by: cppcheck Reviewed by: mav Sponsored by: EMC / Isilon Storage Division Modified: stable/9/sbin/geom/class/multipath/geom_multipath.c Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/geom/ (props changed) stable/9/sbin/geom/class/multipath/ (props changed) Modified: stable/9/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- stable/9/sbin/geom/class/multipath/geom_multipath.c Thu Dec 17 06:31:55 2015 (r292395) +++ stable/9/sbin/geom/class/multipath/geom_multipath.c Thu Dec 17 06:35:31 2015 (r292396) @@ -220,17 +220,15 @@ mp_label(struct gctl_req *req) /* * Allocate a sector to write as metadata. */ - sector = malloc(secsize); + sector = calloc(1, secsize); if (sector == NULL) { gctl_error(req, "unable to allocate metadata buffer"); return; } - memset(sector, 0, secsize); rsector = malloc(secsize); if (rsector == NULL) { - free(sector); gctl_error(req, "unable to allocate metadata buffer"); - return; + goto done; } /* @@ -245,7 +243,7 @@ mp_label(struct gctl_req *req) error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); - return; + goto done; } /* @@ -273,6 +271,9 @@ mp_label(struct gctl_req *req) name2, name); } } +done: + free(rsector); + free(sector); } From owner-svn-src-all@freebsd.org Thu Dec 17 10:37:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E8FA49005; Thu, 17 Dec 2015 10:37:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4F51DEE; Thu, 17 Dec 2015 10:37:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHAbBE7011159; Thu, 17 Dec 2015 10:37:11 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHAbBYm011158; Thu, 17 Dec 2015 10:37:11 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512171037.tBHAbBYm011158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 17 Dec 2015 10:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292399 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 10:37:12 -0000 Author: brueffer Date: Thu Dec 17 10:37:11 2015 New Revision: 292399 URL: https://svnweb.freebsd.org/changeset/base/292399 Log: RIP Juergen Lock (nox@FreeBSD.org), you and your contributions won't be forgotten. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Dec 17 07:01:45 2015 (r292398) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Dec 17 10:37:11 2015 (r292399) @@ -260,6 +260,7 @@ 08/06 Damjan Marion born in Rijeka, Croatia, 1978 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/08 Mikolaj Golub born in Kharkov, USSR, 1977 +08/08 Juergen Lock died in Bremen, Germany, 2015 08/09 Stefan Farfeleder died in Wien, Austria, 2015 08/10 Julio Merino born in Barcelona, Spain, 1984 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 From owner-svn-src-all@freebsd.org Thu Dec 17 14:29:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87FB7A49147 for ; Thu, 17 Dec 2015 14:29:06 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 282941622 for ; Thu, 17 Dec 2015 14:29:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x234.google.com with SMTP id l126so24170681wml.1 for ; Thu, 17 Dec 2015 06:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=llAIL4mBWhxWGeajEhCz/ulHXpQrR4ph802sZkO754o=; b=KAti9hR/oks49G7oevBRcNkcHkkrVcUQAp9tjIxzzHHQkx9EUxETCw1ClutMedkMy8 AWJhEQ8QQmaLnskqinerytkjt23sIfbyR8b5sRIcfL/4mfksWpkV+Pa78y3iuHd28zwi 3PWradN6P1JtWGiQ37Y+rBDX2Bd6aRbyF1QloyEJgTkS8rKoK4TRe1hkAWbpmwx/K7JX blTyjaV4t8MFdJCzIMNNZH67M+SdlHsn9Ooc+2agW0UMNid6GrCs/r69lpzKpBxRJGdi K6KW/V64vVFODdez1XA+2EkVe7adnS8zx4eiJfwrKUlbIHyw4p1c50n5co0IK4weA6dZ zxpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=llAIL4mBWhxWGeajEhCz/ulHXpQrR4ph802sZkO754o=; b=W7dBB2CwinuayfNiIH84/Ubyy3J601cvutbHN8Ew/S8a98FedIuGsPxvJzdrq4VIdV JI+hGMu1TyglIlurggCwJAoNl6bv7Bt2J6PYvD3jnrTTGAs0s13tGaJs6ddtr7VbK+03 XIHwWsMrM+BT3gDWeportLUh5DapBlTZ+/vNtrulwInr7DnLJOGghkUFJnQ5oTDffBIA aPbtTwaKedRYfI4NpMs4pss1zXwNFCWsc79i3x+erDW61CzP3Rfng81po3gwJyo4EIe4 A4TkSaUEh3gkxwPdbYmEk8KgS8MU3QftP8ZiEX8FGhLPkyApSQFalGx+z9gi4IcxnC10 0M7Q== X-Gm-Message-State: ALoCoQkEAXYKYbClxF7xgZK6AjuSC8Sf14Bsin6wtRtFL7PH0C98v7etaXDp3OvyRGim+Et3Tp88JCtnWT0QlRmFuPuFhux2aA== X-Received: by 10.194.2.193 with SMTP id 1mr58445553wjw.26.1450362544052; Thu, 17 Dec 2015 06:29:04 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id jt9sm10695033wjc.38.2015.12.17.06.29.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 06:29:02 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 To: Gleb Smirnoff References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <5672C6AE.7070407@freebsd.org> Date: Thu, 17 Dec 2015 14:29:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151217003824.GG42340@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 14:29:06 -0000 Hey Gleb, sorry I didn't wait for your review, but I did ask around on what the timeout for this would be and was informed 2 weeks and as it had been over a month, with quite a bit of feedback from others in the area, all of which had been addressed I thought that was reasonable. A simple reply of "I do intend to review but don't have time yet so please wait" I think would be useful in these types of situations, as I know everyone's busy but its impossible to know what others are thinking. Clearly the MTU think was just a silly mistake, which I backed out instantly so lets not be to harsh on that one ;-) With regards MAINTAINERS, is there any sort of automation which could alert on this (pre-commit) hook maybe as I'm sure that would be helpful as a reminder. I would definitely like to understand more about your concerns and learn from your knowledge in this area, so thanks for that offer, and while it does sound unforgiving I totally understand where you're coming from. Hopefully together we can bring this to a satisfactory conclusion as I would hate for both carp and lagg to stay as broken, 2 years is long enough :D Regards Steve On 17/12/2015 00:38, Gleb Smirnoff wrote: > Steven, > > I'm sorry that wasn't able to review D4111 in time, but I have > very strong concerns against r292275. And r292379 doesn't > improve situation. I am asking you to back out both patches, > and then we can get together back to the problem. The 156226 > bug was sitting for 2 years in the bugzilla for a reason. It > is a not "low hanging fruit" like koobs@ says. > > I'm sorry if I sound unforgiving, but you got a very bad commit > record in this area. You committed r290403 to ip_carp.c which > "added MTU support to carp interfaces", and that was after 4 YEARS > of carp(4) being not an interface. So, I assume you doesn't > have a good understanding of the current state of the stack, > direction it is developed and things that can be done and > can not (including DELAY() in callout(9). > > Note, that the MAINTAINERS file still lists me for ip_carp.c, > and you didn't wait for my review. yet another reason to ask > for backout. > > I understand that you got a product at work that needs to > have problem fixed. I'm glad that you got a patch that works > it around. But that doesn't mean the patch should immeditely > be dumped in head with a threat of soon MFC. > From owner-svn-src-all@freebsd.org Thu Dec 17 14:41:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1202A499D8; Thu, 17 Dec 2015 14:41:32 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4A41CB3; Thu, 17 Dec 2015 14:41:32 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHEfVZZ083443; Thu, 17 Dec 2015 14:41:31 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHEfUUE083429; Thu, 17 Dec 2015 14:41:30 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512171441.tBHEfUUE083429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 17 Dec 2015 14:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292402 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 14:41:33 -0000 Author: smh Date: Thu Dec 17 14:41:30 2015 New Revision: 292402 URL: https://svnweb.freebsd.org/changeset/base/292402 Log: Revert r292275 & r292379 glebius has concerns about these changes so reverting those can be discussed and addressed. Sponsored by: Multiplay Modified: head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_var.h head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/net/if.c Thu Dec 17 14:41:30 2015 (r292402) @@ -126,7 +126,7 @@ SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifn void (*bridge_linkstate_p)(struct ifnet *ifp); void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); -void (*lagg_linkstate_p)(struct ifnet *ifp); +void (*lagg_linkstate_p)(struct ifnet *ifp, int state); /* These are external hooks for CARP. */ void (*carp_linkstate_p)(struct ifnet *ifp); void (*carp_demote_adj_p)(int, char *); @@ -1984,8 +1984,6 @@ if_unroute(struct ifnet *ifp, int flag, if (ifp->if_carp) (*carp_linkstate_p)(ifp); - if (ifp->if_lagg) - (*lagg_linkstate_p)(ifp); rt_ifmsg(ifp); } @@ -2007,8 +2005,6 @@ if_route(struct ifnet *ifp, int flag, in pfctlinput(PRC_IFUP, ifa->ifa_addr); if (ifp->if_carp) (*carp_linkstate_p)(ifp); - if (ifp->if_lagg) - (*lagg_linkstate_p)(ifp); rt_ifmsg(ifp); #ifdef INET6 in6_if_up(ifp); @@ -2023,27 +2019,17 @@ int (*vlan_tag_p)(struct ifnet *, uint16 int (*vlan_setcookie_p)(struct ifnet *, void *); void *(*vlan_cookie_p)(struct ifnet *); -void -if_link_state_change(struct ifnet *ifp, int link_state) -{ - - return if_link_state_change_cond(ifp, link_state, 0); -} - /* * Handle a change in the interface link state. To avoid LORs * between driver lock and upper layer locks, as well as possible * recursions, we post event to taskqueue, and all job * is done in static do_link_state_change(). - * - * If the current link state matches link_state and force isn't - * specified no action is taken. */ void -if_link_state_change_cond(struct ifnet *ifp, int link_state, int force) +if_link_state_change(struct ifnet *ifp, int link_state) { - - if (ifp->if_link_state == link_state && !force) + /* Return if state hasn't changed. */ + if (ifp->if_link_state == link_state) return; ifp->if_link_state = link_state; @@ -2071,7 +2057,7 @@ do_link_state_change(void *arg, int pend if (ifp->if_bridge) (*bridge_linkstate_p)(ifp); if (ifp->if_lagg) - (*lagg_linkstate_p)(ifp); + (*lagg_linkstate_p)(ifp, link_state); if (IS_DEFAULT_VNET(curvnet)) devctl_notify("IFNET", ifp->if_xname, Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/net/if_lagg.c Thu Dec 17 14:41:30 2015 (r292402) @@ -106,7 +106,7 @@ static int lagg_port_create(struct lagg_ static int lagg_port_destroy(struct lagg_port *, int); static struct mbuf *lagg_input(struct ifnet *, struct mbuf *); static void lagg_linkstate(struct lagg_softc *); -static void lagg_port_state(struct ifnet *); +static void lagg_port_state(struct ifnet *, int); static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t); static int lagg_port_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); @@ -1774,12 +1774,7 @@ lagg_linkstate(struct lagg_softc *sc) break; } } - - /* - * Force state change to ensure ifnet_link_event is generated allowing - * protocols to notify other nodes of potential address move. - */ - if_link_state_change_cond(sc->sc_ifp, new_link, 1); + if_link_state_change(sc->sc_ifp, new_link); /* Update if_baudrate to reflect the max possible speed */ switch (sc->sc_proto) { @@ -1802,7 +1797,7 @@ lagg_linkstate(struct lagg_softc *sc) } static void -lagg_port_state(struct ifnet *ifp) +lagg_port_state(struct ifnet *ifp, int state) { struct lagg_port *lp = (struct lagg_port *)ifp->if_lagg; struct lagg_softc *sc = NULL; @@ -1818,7 +1813,7 @@ lagg_port_state(struct ifnet *ifp) LAGG_WUNLOCK(sc); } -static struct lagg_port * +struct lagg_port * lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) { struct lagg_port *lp_next, *rval = NULL; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/net/if_lagg.h Thu Dec 17 14:41:30 2015 (r292402) @@ -281,7 +281,7 @@ struct lagg_port { #define LAGG_UNLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_UNLOCKED) extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); -extern void (*lagg_linkstate_p)(struct ifnet *); +extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/net/if_var.h Thu Dec 17 14:41:30 2015 (r292402) @@ -500,7 +500,6 @@ struct ifmultiaddr * void if_free(struct ifnet *); void if_initname(struct ifnet *, const char *, int); void if_link_state_change(struct ifnet *, int); -void if_link_state_change_cond(struct ifnet *, int, int); int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); void if_ref(struct ifnet *); void if_rele(struct ifnet *); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet/if_ether.c Thu Dec 17 14:41:30 2015 (r292402) @@ -107,7 +107,6 @@ VNET_PCPUSTAT_SYSUNINIT(arpstat); #endif /* VIMAGE */ static VNET_DEFINE(int, arp_maxhold) = 1; -static VNET_DEFINE(int, arp_on_link) = 1; #define V_arpt_keep VNET(arpt_keep) #define V_arpt_down VNET(arpt_down) @@ -115,7 +114,6 @@ static VNET_DEFINE(int, arp_on_link) = 1 #define V_arp_maxtries VNET(arp_maxtries) #define V_arp_proxyall VNET(arp_proxyall) #define V_arp_maxhold VNET(arp_maxhold) -#define V_arp_on_link VNET(arp_on_link) SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arpt_keep), 0, @@ -138,9 +136,6 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT CTLFLAG_RW, &arp_maxpps, 0, "Maximum number of remotely triggered ARP messages that can be " "logged per second"); -SYSCTL_INT(_net_link_ether_inet, OID_AUTO, arp_on_link, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(arp_on_link), 0, - "Send gratuitous ARP's on interface link up events"); #define ARP_LOG(pri, ...) do { \ if (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ @@ -161,7 +156,6 @@ static void arp_mark_lle_reachable(struc static void arp_iflladdr(void *arg __unused, struct ifnet *ifp); static eventhandler_tag iflladdr_tag; -static eventhandler_tag ifnet_link_event_tag; static const struct netisr_handler arp_nh = { .nh_name = "arp", @@ -1190,99 +1184,43 @@ arp_ifinit(struct ifnet *ifp, struct ifa if (ntohl(dst_in->sin_addr.s_addr) == INADDR_ANY) return; - arp_announce_addr(ifp, &dst_in->sin_addr, IF_LLADDR(ifp)); + arp_announce_ifaddr(ifp, dst_in->sin_addr, IF_LLADDR(ifp)); arp_add_ifa_lle(ifp, dst); } -void __noinline -arp_announce_addr(struct ifnet *ifp, const struct in_addr *addr, u_char *enaddr) +void +arp_announce_ifaddr(struct ifnet *ifp, struct in_addr addr, u_char *enaddr) { - if (ntohl(addr->s_addr) != INADDR_ANY) - arprequest(ifp, addr, addr, enaddr); + if (ntohl(addr.s_addr) != INADDR_ANY) + arprequest(ifp, &addr, &addr, enaddr); } /* - * Send gratuitous ARPs for all interfaces addresses to notify other nodes of - * changes. - * - * This is a noop if the interface isn't up or has been flagged for no ARP. + * Sends gratuitous ARPs for each ifaddr to notify other + * nodes about the address change. */ -void __noinline -arp_announce(struct ifnet *ifp) +static __noinline void +arp_handle_ifllchange(struct ifnet *ifp) { - int i, cnt, entries; - u_char *lladdr; struct ifaddr *ifa; - struct in_addr *addr, *head; - if (!(ifp->if_flags & IFF_UP) || (ifp->if_flags & IFF_NOARP) || - ifp->if_addr == NULL) - return; - - entries = 8; - cnt = 0; - head = malloc(sizeof(*addr) * entries, M_TEMP, M_NOWAIT); - if (head == NULL) { - log(LOG_INFO, "arp_announce: malloc %d entries failed\n", - entries); - return; - } - - /* Take a copy then process to avoid locking issues. */ - IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != AF_INET) - continue; - - if (cnt == entries) { - addr = (struct in_addr *)realloc(head, sizeof(*addr) * - (entries + 8), M_TEMP, M_NOWAIT); - if (addr == NULL) { - log(LOG_INFO, "arp_announce: realloc to %d " - "entries failed\n", entries + 8); - /* Process what we have. */ - break; - } - entries += 8; - head = addr; - } - - addr = head + cnt; - bcopy(IFA_IN(ifa), addr, sizeof(*addr)); - cnt++; + if (ifa->ifa_addr->sa_family == AF_INET) + arp_ifinit(ifp, ifa); } - IF_ADDR_RUNLOCK(ifp); - - if (cnt > 0) { - lladdr = IF_LLADDR(ifp); - for (i = 0; i < cnt; i++) { - arp_announce_addr(ifp, head + i, lladdr); - } - } - free(head, M_TEMP); } /* - * A handler for interface linkstate change events. - */ -static void -arp_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate) -{ - - if (linkstate == LINK_STATE_UP && V_arp_on_link) - arp_announce(ifp); -} - -/* - * A handler for interface link layer address change events. + * A handler for interface link layer address change event. */ static __noinline void arp_iflladdr(void *arg __unused, struct ifnet *ifp) { - arp_announce(ifp); + if ((ifp->if_flags & IFF_UP) != 0) + arp_handle_ifllchange(ifp); } static void @@ -1290,12 +1228,8 @@ arp_init(void) { netisr_register(&arp_nh); - - if (IS_DEFAULT_VNET(curvnet)) { + if (IS_DEFAULT_VNET(curvnet)) iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event, arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY); - ifnet_link_event_tag = EVENTHANDLER_REGISTER(ifnet_link_event, - arp_ifnet_link_event, 0, EVENTHANDLER_PRI_ANY); - } } SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0); Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet/if_ether.h Thu Dec 17 14:41:30 2015 (r292402) @@ -119,8 +119,7 @@ int arpresolve(struct ifnet *ifp, int is void arprequest(struct ifnet *, const struct in_addr *, const struct in_addr *, u_char *); void arp_ifinit(struct ifnet *, struct ifaddr *); -void arp_announce(struct ifnet *); -void arp_announce_addr(struct ifnet *, const struct in_addr *addr, u_char *); +void arp_announce_ifaddr(struct ifnet *, struct in_addr addr, u_char *); #endif #endif Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet/in_var.h Thu Dec 17 14:41:30 2015 (r292402) @@ -129,9 +129,6 @@ extern struct rmlock in_ifaddr_lock; #define IN_IFADDR_WLOCK_ASSERT() rm_assert(&in_ifaddr_lock, RA_WLOCKED) #define IN_IFADDR_WUNLOCK() rm_wunlock(&in_ifaddr_lock) -#define IFA_IN(ifa) \ - (&((struct sockaddr_in *)ifa->ifa_addr)->sin_addr) - /* * Macro for finding the internet address structure (in_ifaddr) * corresponding to one of our IP addresses (in_addr). Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet/ip_carp.c Thu Dec 17 14:41:30 2015 (r292402) @@ -1009,12 +1009,13 @@ static void carp_send_arp(struct carp_softc *sc) { struct ifaddr *ifa; + struct in_addr addr; CARP_FOREACH_IFA(sc, ifa) { if (ifa->ifa_addr->sa_family != AF_INET) continue; - arp_announce_addr(sc->sc_carpdev, IFA_IN(ifa), - LLADDR(&sc->sc_addr)); + addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; + arp_announce_ifaddr(sc->sc_carpdev, addr, LLADDR(&sc->sc_addr)); } } @@ -1036,16 +1037,18 @@ carp_iamatch(struct ifaddr *ifa, uint8_t static void carp_send_na(struct carp_softc *sc) { + static struct in6_addr mcast = IN6ADDR_LINKLOCAL_ALLNODES_INIT; struct ifaddr *ifa; + struct in6_addr *in6; CARP_FOREACH_IFA(sc, ifa) { - if (ifa->ifa_addr->sa_family != AF_INET6 || - IFA_ND6_NA_UNSOLICITED_SKIP(ifa)) + if (ifa->ifa_addr->sa_family != AF_INET6) continue; - nd6_na_output_unsolicited_addr(sc->sc_carpdev, IFA_IN6(ifa), - IFA_ND6_NA_BASE_FLAGS(sc->sc_carpdev, ifa)); - DELAY(nd6_na_unsolicited_addr_delay(ifa)); + in6 = IFA_IN6(ifa); + nd6_na_output(sc->sc_carpdev, &mcast, in6, + ND_NA_FLAG_OVERRIDE, 1, NULL); + DELAY(1000); /* XXX */ } } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet6/in6.c Thu Dec 17 14:41:30 2015 (r292402) @@ -114,7 +114,7 @@ VNET_DECLARE(int, icmp6_nodeinfo_oldmcpr #define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix) /* - * Definitions of some constant IP6 addresses. + * Definitions of some costant IP6 addresses. */ const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet6/in6_var.h Thu Dec 17 14:41:30 2015 (r292402) @@ -399,16 +399,6 @@ struct in6_rrenumreq { #define IA6_SIN6(ia) (&((ia)->ia_addr)) #define IA6_DSTSIN6(ia) (&((ia)->ia_dstaddr)) #define IFA_IN6(x) (&((struct sockaddr_in6 *)((x)->ifa_addr))->sin6_addr) -#define IFA_IN6_FLAGS(ifa) ((struct in6_ifaddr *)ifa)->ia6_flags -#define IFA_ND6_NA_BASE_FLAGS(ifp, ifa) \ - (IFA_IN6_FLAGS(ifa) & IN6_IFF_ANYCAST ? 0 : ND_NA_FLAG_OVERRIDE) | \ - ((V_ip6_forwarding && !(ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && \ - V_ip6_norbit_raif)) ? ND_NA_FLAG_ROUTER : 0) -#define IFA_ND6_NA_UNSOLICITED_SKIP(ifa) \ - (IFA_IN6_FLAGS(ifa) & (IN6_IFF_DUPLICATED | IN6_IFF_DEPRECATED | \ - IN6_IFF_TENTATIVE)) != 0 -#define IN6_MAX_ANYCAST_DELAY_TIME_MS 1000000 -#define IN6_BROADCAST_DELAY_TIME_MS 1000 #define IFA_DSTIN6(x) (&((struct sockaddr_in6 *)((x)->ifa_dstaddr))->sin6_addr) #define IFPR_IN6(x) (&((struct sockaddr_in6 *)((x)->ifpr_prefix))->sin6_addr) Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet6/nd6.c Thu Dec 17 14:41:30 2015 (r292402) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -103,12 +102,8 @@ VNET_DEFINE(int, nd6_maxnudhint) = 0; /* * layer hints */ static VNET_DEFINE(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved * ND entries */ - -static VNET_DEFINE(int, nd6_on_link) = 1; /* Send unsolicited ND's on link up */ - #define V_nd6_maxndopt VNET(nd6_maxndopt) #define V_nd6_maxqueuelen VNET(nd6_maxqueuelen) -#define V_nd6_on_link VNET(nd6_on_link) #ifdef ND6_DEBUG VNET_DEFINE(int, nd6_debug) = 1; @@ -117,7 +112,6 @@ VNET_DEFINE(int, nd6_debug) = 0; #endif static eventhandler_tag lle_event_eh; -static eventhandler_tag ifnet_link_event_eh; /* for debugging? */ #if 0 @@ -202,14 +196,6 @@ nd6_lle_event(void *arg __unused, struct type == RTM_ADD ? RTF_UP: 0), 0, RT_DEFAULT_FIB); } -static void -nd6_ifnet_link_event(void *arg __unused, struct ifnet *ifp, int linkstate) -{ - - if (linkstate == LINK_STATE_UP && V_nd6_on_link) - nd6_na_output_unsolicited(ifp); -} - void nd6_init(void) { @@ -225,12 +211,9 @@ nd6_init(void) nd6_slowtimo, curvnet); nd6_dad_init(); - if (IS_DEFAULT_VNET(curvnet)) { + if (IS_DEFAULT_VNET(curvnet)) lle_event_eh = EVENTHANDLER_REGISTER(lle_event, nd6_lle_event, NULL, EVENTHANDLER_PRI_ANY); - ifnet_link_event_eh = EVENTHANDLER_REGISTER(ifnet_link_event, - nd6_ifnet_link_event, NULL, EVENTHANDLER_PRI_ANY); - } } #ifdef VIMAGE @@ -240,10 +223,8 @@ nd6_destroy() callout_drain(&V_nd6_slowtimo_ch); callout_drain(&V_nd6_timer_ch); - if (IS_DEFAULT_VNET(curvnet)) { + if (IS_DEFAULT_VNET(curvnet)) EVENTHANDLER_DEREGISTER(lle_event, lle_event_eh); - EVENTHANDLER_DEREGISTER(ifnet_link_event, ifnet_link_event_eh); - } } #endif @@ -2476,18 +2457,13 @@ static int nd6_sysctl_prlist(SYSCTL_HAND SYSCTL_DECL(_net_inet6_icmp6); #endif SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_DRLIST, nd6_drlist, - CTLFLAG_RD, nd6_sysctl_drlist, "List default routers"); + CTLFLAG_RD, nd6_sysctl_drlist, ""); SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_ND6_PRLIST, nd6_prlist, - CTLFLAG_RD, nd6_sysctl_prlist, "List prefixes"); + CTLFLAG_RD, nd6_sysctl_prlist, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXQLEN, nd6_maxqueuelen, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, - "Max packets cached in unresolved ND entries"); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, ""); SYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_gctimer, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), - "Interface in seconds between garbage collection passes"); -SYSCTL_INT(_net_inet6_icmp6, OID_AUTO, nd6_on_link, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(nd6_on_link), 0, - "Send unsolicited neighbor discovery on interface link up events"); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), ""); static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet6/nd6.h Thu Dec 17 14:41:30 2015 (r292402) @@ -398,10 +398,6 @@ void nd6_init(void); #ifdef VIMAGE void nd6_destroy(void); #endif -void nd6_na_output_unsolicited(struct ifnet *); -void nd6_na_output_unsolicited_addr(struct ifnet *, const struct in6_addr *, - u_long); -int nd6_na_unsolicited_addr_delay(struct ifaddr *); struct nd_ifinfo *nd6_ifattach(struct ifnet *); void nd6_ifdetach(struct nd_ifinfo *); int nd6_is_addr_neighbor(const struct sockaddr_in6 *, struct ifnet *); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Dec 17 12:35:40 2015 (r292401) +++ head/sys/netinet6/nd6_nbr.c Thu Dec 17 14:41:30 2015 (r292402) @@ -124,16 +124,20 @@ nd6_ns_input(struct mbuf *m, int off, in struct in6_addr saddr6 = ip6->ip6_src; struct in6_addr daddr6 = ip6->ip6_dst; struct in6_addr taddr6; + struct in6_addr myaddr6; char *lladdr = NULL; struct ifaddr *ifa = NULL; - u_long flags; int lladdrlen = 0; - int proxy = 0; + int anycast = 0, proxy = 0, tentative = 0; int tlladdr; + int rflag; union nd_opts ndopts; struct sockaddr_dl proxydl; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) + rflag = 0; #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off); @@ -225,7 +229,10 @@ nd6_ns_input(struct mbuf *m, int off, in * In implementation, we add target link-layer address by default. * We do not add one in MUST NOT cases. */ - tlladdr = !IN6_IS_ADDR_MULTICAST(&daddr6); + if (!IN6_IS_ADDR_MULTICAST(&daddr6)) + tlladdr = 0; + else + tlladdr = 1; /* * Target address (taddr6) must be either: @@ -282,6 +289,9 @@ nd6_ns_input(struct mbuf *m, int off, in */ goto freeit; } + myaddr6 = *IFA_IN6(ifa); + anycast = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST; + tentative = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE; if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DUPLICATED) goto freeit; @@ -293,7 +303,7 @@ nd6_ns_input(struct mbuf *m, int off, in goto bad; } - if (IN6_ARE_ADDR_EQUAL(IFA_IN6(ifa), &saddr6)) { + if (IN6_ARE_ADDR_EQUAL(&myaddr6, &saddr6)) { nd6log((LOG_INFO, "nd6_ns_input: duplicate IP6 address %s\n", ip6_sprintf(ip6bufs, &saddr6))); goto freeit; @@ -311,7 +321,7 @@ nd6_ns_input(struct mbuf *m, int off, in * * The processing is defined in RFC 2462. */ - if (IFA_IN6_FLAGS(ifa) & IN6_IFF_TENTATIVE) { + if (tentative) { /* * If source address is unspecified address, it is for * duplicate address detection. @@ -325,10 +335,6 @@ nd6_ns_input(struct mbuf *m, int off, in goto freeit; } - flags = IFA_ND6_NA_BASE_FLAGS(ifp, ifa); - if (proxy || !tlladdr) - flags &= ~ND_NA_FLAG_OVERRIDE; - /* * If the source address is unspecified address, entries must not * be created or updated. @@ -343,16 +349,20 @@ nd6_ns_input(struct mbuf *m, int off, in in6_all = in6addr_linklocal_allnodes; if (in6_setscope(&in6_all, ifp, NULL) != 0) goto bad; - nd6_na_output_fib(ifp, &in6_all, &taddr6, flags, tlladdr, - proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); + nd6_na_output_fib(ifp, &in6_all, &taddr6, + ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | + rflag, tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL, + M_GETFIB(m)); goto freeit; } nd6_cache_lladdr(ifp, &saddr6, lladdr, lladdrlen, ND_NEIGHBOR_SOLICIT, 0); - nd6_na_output_fib(ifp, &saddr6, &taddr6, flags | ND_NA_FLAG_SOLICITED, - tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); + nd6_na_output_fib(ifp, &saddr6, &taddr6, + ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | + rflag | ND_NA_FLAG_SOLICITED, tlladdr, + proxy ? (struct sockaddr *)&proxydl : NULL, M_GETFIB(m)); freeit: if (ifa != NULL) ifa_free(ifa); @@ -1587,111 +1597,3 @@ nd6_dad_na_input(struct ifaddr *ifa) nd6_dad_rele(dp); } } - -/* - * Send unsolicited neighbor advertisements for all interface addresses to - * notify other nodes of changes. - * - * This is a noop if the interface isn't up. - */ -void __noinline -nd6_na_output_unsolicited(struct ifnet *ifp) -{ - int i, cnt, entries; - struct ifaddr *ifa; - struct ann { - struct in6_addr addr; - u_long flags; - int delay; - } *ann1, *head; - - if (!(ifp->if_flags & IFF_UP)) - return; - - entries = 8; - cnt = 0; - head = malloc(sizeof(struct ann) * entries, M_TEMP, M_WAITOK); - - /* Take a copy then process to avoid locking issues. */ - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != AF_INET6 || - IFA_ND6_NA_UNSOLICITED_SKIP(ifa)) - continue; - - if (cnt == entries) { - ann1 = (struct ann*)realloc(head, sizeof(struct ann) * - (entries + 8), M_TEMP, M_NOWAIT); - if (ann1 == NULL) { - log(LOG_INFO, "nd6_announce: realloc to %d " - "entries failed\n", entries + 8); - /* Process what we have. */ - break; - } - entries += 8; - head = ann1; - } - - ann1 = head + cnt; - bcopy(IFA_IN6(ifa), &ann1->addr, sizeof(ann1->addr)); - ann1->flags = IFA_ND6_NA_BASE_FLAGS(ifp, ifa); - ann1->delay = nd6_na_unsolicited_addr_delay(ifa); - cnt++; - } - IF_ADDR_RUNLOCK(ifp); - - for (i = 0; i < cnt;) { - ann1 = head + i; - nd6_na_output_unsolicited_addr(ifp, &ann1->addr, ann1->flags); - i++; - if (i == cnt) - break; - /* XXX DELAY needs to be done in taskqueue to avoid stalling. */ - //DELAY(ann1->delay); - } - free(head, M_TEMP); -} - -/* - * Return the delay required for announcements of the address as per RFC 4861. - */ -int -nd6_na_unsolicited_addr_delay(struct ifaddr *ifa) -{ - - if (IFA_IN6_FLAGS(ifa) & IN6_IFF_ANYCAST) { - /* - * Random value between 0 and MAX_ANYCAST_DELAY_TIME - * as per section 7.2.7. - */ - return (random() % IN6_MAX_ANYCAST_DELAY_TIME_MS); - } - - /* Small delay as per section 7.2.6. */ - return (IN6_BROADCAST_DELAY_TIME_MS); -} - -/* - * Send an unsolicited neighbor advertisement for an address to notify other - * nodes of changes. - */ -void __noinline -nd6_na_output_unsolicited_addr(struct ifnet *ifp, const struct in6_addr *addr, - u_long flags) -{ - int error; - struct in6_addr mcast; - - mcast = in6addr_linklocal_allnodes; - if ((error = in6_setscope(&mcast, ifp, NULL)) != 0) { - /* - * This shouldn't by possible as the only error is for loopback - * address which we're not using. - */ - log(LOG_INFO, "in6_setscope: on mcast failed: %d\n", error); - return; - } - nd6_na_output(ifp, &mcast, addr, flags, 1, NULL); -} - - From owner-svn-src-all@freebsd.org Thu Dec 17 16:08:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91667A4945D; Thu, 17 Dec 2015 16:08:29 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FC8718CE; Thu, 17 Dec 2015 16:08:29 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHG8S76006672; Thu, 17 Dec 2015 16:08:28 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHG8Sbh006671; Thu, 17 Dec 2015 16:08:28 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512171608.tBHG8Sbh006671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 17 Dec 2015 16:08: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: r292403 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 16:08:29 -0000 Author: ume Date: Thu Dec 17 16:08:28 2015 New Revision: 292403 URL: https://svnweb.freebsd.org/changeset/base/292403 Log: MFC r292059: The calls to RES_SET_H_ERRNO() macro on error paths wind up dereferencing an uninitialized res. PR: 202142 Submitted by: Sean Boudreau Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Thu Dec 17 14:41:30 2015 (r292402) +++ stable/10/lib/libc/net/getaddrinfo.c Thu Dec 17 16:08:28 2015 (r292403) @@ -2207,6 +2207,8 @@ _dns_getaddrinfo(void *rv, void *cb_data memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + res = __res_state(); + buf = malloc(sizeof(*buf)); if (!buf) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); @@ -2253,7 +2255,6 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_UNAVAIL; } - res = __res_state(); if ((res->options & RES_INIT) == 0 && res_ninit(res) == -1) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); free(buf); From owner-svn-src-all@freebsd.org Thu Dec 17 16:09:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F1AA4957D; Thu, 17 Dec 2015 16:09:16 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 751C11BE6; Thu, 17 Dec 2015 16:09:16 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHG9F5P006754; Thu, 17 Dec 2015 16:09:15 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHG9Fih006753; Thu, 17 Dec 2015 16:09:15 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512171609.tBHG9Fih006753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 17 Dec 2015 16:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292404 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 16:09:16 -0000 Author: ume Date: Thu Dec 17 16:09:15 2015 New Revision: 292404 URL: https://svnweb.freebsd.org/changeset/base/292404 Log: MFC r292059: The calls to RES_SET_H_ERRNO() macro on error paths wind up dereferencing an uninitialized res. PR: 202142 Submitted by: Sean Boudreau Modified: stable/9/lib/libc/net/getaddrinfo.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Thu Dec 17 16:08:28 2015 (r292403) +++ stable/9/lib/libc/net/getaddrinfo.c Thu Dec 17 16:09:15 2015 (r292404) @@ -2202,6 +2202,8 @@ _dns_getaddrinfo(void *rv, void *cb_data memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + res = __res_state(); + buf = malloc(sizeof(*buf)); if (!buf) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); @@ -2248,7 +2250,6 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_UNAVAIL; } - res = __res_state(); if ((res->options & RES_INIT) == 0 && res_ninit(res) == -1) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); free(buf); From owner-svn-src-all@freebsd.org Thu Dec 17 17:00:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BABFA486E4; Thu, 17 Dec 2015 17:00:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DAD21756; Thu, 17 Dec 2015 17:00:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHH0536021611; Thu, 17 Dec 2015 17:00:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHH04QC021609; Thu, 17 Dec 2015 17:00:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512171700.tBHH04QC021609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 17 Dec 2015 17:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292405 - in head/sys: arm64/include dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 17:00:06 -0000 Author: andrew Date: Thu Dec 17 17:00:04 2015 New Revision: 292405 URL: https://svnweb.freebsd.org/changeset/base/292405 Log: Support the variant of the interrupt-map property where the parent bus has the #address-cells property set. For this we need to read more data before the parent interrupt description. this is only enabled on arm64 for now as it's not quite compliant with the ePAPR spec. We should use a default of 2 where the #address-cells property is missing, however this will need further testing across architectures. Obtained from: ABT Systems Ltd Sponsored by: SoftIron Inc Differential Revision: https://reviews.freebsd.org/D4518 Modified: head/sys/arm64/include/ofw_machdep.h head/sys/dev/ofw/ofw_bus_subr.c Modified: head/sys/arm64/include/ofw_machdep.h ============================================================================== --- head/sys/arm64/include/ofw_machdep.h Thu Dec 17 16:09:15 2015 (r292404) +++ head/sys/arm64/include/ofw_machdep.h Thu Dec 17 17:00:04 2015 (r292405) @@ -41,4 +41,7 @@ struct mem_region { vm_size_t mr_size; }; +/* FDT follows ePAPR */ +#define OFW_EPAPR + #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Thu Dec 17 16:09:15 2015 (r292404) +++ head/sys/dev/ofw/ofw_bus_subr.c Thu Dec 17 17:00:04 2015 (r292405) @@ -341,6 +341,7 @@ ofw_bus_search_intrmap(void *intr, int i uint8_t *uiregs = regs; uint8_t *uiimapmsk = imapmsk; uint8_t *mptr; + pcell_t paddrsz; pcell_t pintrsz; int i, rsz, tsz; @@ -357,19 +358,31 @@ ofw_bus_search_intrmap(void *intr, int i mptr = imap; i = imapsz; + paddrsz = 0; while (i > 0) { bcopy(mptr + physsz + intrsz, &parent, sizeof(parent)); +#ifdef OFW_EPAPR + /* + * Find if we need to read the parent address data. Sparc64 + * uses a different encoding that doesn't include this data. + */ + if (OF_getencprop(OF_node_from_xref(parent), + "#address-cells", &paddrsz, sizeof(paddrsz)) == -1) + paddrsz = 0; /* default */ + paddrsz *= sizeof(pcell_t); +#endif + if (OF_searchencprop(OF_node_from_xref(parent), "#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1) pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); /* Compute the map stride size. */ - tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz; + tsz = physsz + intrsz + sizeof(phandle_t) + paddrsz + pintrsz; KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map")); if (bcmp(ref, mptr, physsz + intrsz) == 0) { - bcopy(mptr + physsz + intrsz + sizeof(parent), + bcopy(mptr + physsz + intrsz + sizeof(parent) + paddrsz, result, MIN(rintrsz, pintrsz)); if (iparent != NULL) From owner-svn-src-all@freebsd.org Thu Dec 17 17:22:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8815A49624; Thu, 17 Dec 2015 17:22:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B76F17B0; Thu, 17 Dec 2015 17:22:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([32.210.31.157]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id tBHHBt07008109 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 17 Dec 2015 09:11:56 -0800 Subject: Re: svn commit: r292405 - in head/sys: arm64/include dev/ofw To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512171700.tBHH04QC021609@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <5672ECDA.80101@freebsd.org> Date: Thu, 17 Dec 2015 09:11:54 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512171700.tBHH04QC021609@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbH24y7siwTj00xzbJDRIcL1evfCIT9d/mnqEciavwzHsWwsY/M74T0CUNO8OtRQlguksOSnNrxA4GwwjBC49hvOscOjLFy9e4= X-Sonic-ID: C;AEbPReGk5RGXocgxU3XIUw== M;wp1kRuGk5RGXocgxU3XIUw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 17:22:24 -0000 I don't really like the #ifdef here. If it contradicts ePAPR, switching on the behavior through a #define OFW_EPAPR is at best misleading. And, aside from the default value of 2, this *is* compliant with the ePAPR spec, as well as with CHRP and PAPR (which is where ePAPR got it from). Do we have any in-the-wild CHRP-ish device trees for which #address-cells is unspecified to even worry about the default anyway? In any event, I'd much prefer that it be explicitly disabled on SPARC, which is the odd man out on our platforms, rather than opt-in on all other platforms, which use CHRP-heritage bindings, and that the #define be something more descriptive/correct like #define OFW_IMAP_NO_INTERRUPT_PARENT. -Nathan On 12/17/15 09:00, Andrew Turner wrote: > Author: andrew > Date: Thu Dec 17 17:00:04 2015 > New Revision: 292405 > URL: https://svnweb.freebsd.org/changeset/base/292405 > > Log: > Support the variant of the interrupt-map property where the parent bus has > the #address-cells property set. For this we need to read more data before > the parent interrupt description. > > this is only enabled on arm64 for now as it's not quite compliant with the > ePAPR spec. We should use a default of 2 where the #address-cells property > is missing, however this will need further testing across architectures. > > Obtained from: ABT Systems Ltd > Sponsored by: SoftIron Inc > Differential Revision: https://reviews.freebsd.org/D4518 > > Modified: > head/sys/arm64/include/ofw_machdep.h > head/sys/dev/ofw/ofw_bus_subr.c > > Modified: head/sys/arm64/include/ofw_machdep.h > ============================================================================== > --- head/sys/arm64/include/ofw_machdep.h Thu Dec 17 16:09:15 2015 (r292404) > +++ head/sys/arm64/include/ofw_machdep.h Thu Dec 17 17:00:04 2015 (r292405) > @@ -41,4 +41,7 @@ struct mem_region { > vm_size_t mr_size; > }; > > +/* FDT follows ePAPR */ > +#define OFW_EPAPR > + > #endif /* _MACHINE_OFW_MACHDEP_H_ */ > > Modified: head/sys/dev/ofw/ofw_bus_subr.c > ============================================================================== > --- head/sys/dev/ofw/ofw_bus_subr.c Thu Dec 17 16:09:15 2015 (r292404) > +++ head/sys/dev/ofw/ofw_bus_subr.c Thu Dec 17 17:00:04 2015 (r292405) > @@ -341,6 +341,7 @@ ofw_bus_search_intrmap(void *intr, int i > uint8_t *uiregs = regs; > uint8_t *uiimapmsk = imapmsk; > uint8_t *mptr; > + pcell_t paddrsz; > pcell_t pintrsz; > int i, rsz, tsz; > > @@ -357,19 +358,31 @@ ofw_bus_search_intrmap(void *intr, int i > > mptr = imap; > i = imapsz; > + paddrsz = 0; > while (i > 0) { > bcopy(mptr + physsz + intrsz, &parent, sizeof(parent)); > +#ifdef OFW_EPAPR > + /* > + * Find if we need to read the parent address data. Sparc64 > + * uses a different encoding that doesn't include this data. > + */ > + if (OF_getencprop(OF_node_from_xref(parent), > + "#address-cells", &paddrsz, sizeof(paddrsz)) == -1) > + paddrsz = 0; /* default */ > + paddrsz *= sizeof(pcell_t); > +#endif > + > if (OF_searchencprop(OF_node_from_xref(parent), > "#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1) > pintrsz = 1; /* default */ > pintrsz *= sizeof(pcell_t); > > /* Compute the map stride size. */ > - tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz; > + tsz = physsz + intrsz + sizeof(phandle_t) + paddrsz + pintrsz; > KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map")); > > if (bcmp(ref, mptr, physsz + intrsz) == 0) { > - bcopy(mptr + physsz + intrsz + sizeof(parent), > + bcopy(mptr + physsz + intrsz + sizeof(parent) + paddrsz, > result, MIN(rintrsz, pintrsz)); > > if (iparent != NULL) > From owner-svn-src-all@freebsd.org Thu Dec 17 17:48:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E944A4A897; Thu, 17 Dec 2015 17:48:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2398918E1; Thu, 17 Dec 2015 17:48:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHHmwxD037352; Thu, 17 Dec 2015 17:48:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHHmvAC037349; Thu, 17 Dec 2015 17:48:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512171748.tBHHmvAC037349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 17 Dec 2015 17:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292406 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 17:48:59 -0000 Author: cem Date: Thu Dec 17 17:48:57 2015 New Revision: 292406 URL: https://svnweb.freebsd.org/changeset/base/292406 Log: vm_page_replace: add wrapper to KASSERT about old page It turns out the callers of vm_page_replace know exactly which page they are replacing and would like to assert about it. Change those from hard panics to KASSERTs, and provide them with a wrapper so they don't have to deal with warnings from an INVARIANTS-dependent dead store of the return value of vm_page_replace. Submitted by: Ryan Libby Reviewed by: alc, kib (earlier version) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4497 Modified: head/sys/vm/device_pager.c head/sys/vm/sg_pager.c head/sys/vm/vm_page.h Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Thu Dec 17 17:00:04 2015 (r292405) +++ head/sys/vm/device_pager.c Thu Dec 17 17:48:57 2015 (r292406) @@ -347,8 +347,7 @@ old_dev_pager_fault(vm_object_t object, */ page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); - if (vm_page_replace(page, object, (*mres)->pindex) != *mres) - panic("old_dev_pager_fault: invalid page replacement"); + vm_page_replace_checked(page, object, (*mres)->pindex, *mres); vm_page_lock(*mres); vm_page_free(*mres); vm_page_unlock(*mres); Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Thu Dec 17 17:00:04 2015 (r292405) +++ head/sys/vm/sg_pager.c Thu Dec 17 17:48:57 2015 (r292406) @@ -188,8 +188,7 @@ sg_pager_getpages(vm_object_t object, vm page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, plinks.q); - if (vm_page_replace(page, object, offset) != m[0]) - panic("sg_pager_getpages: invalid place replacement"); + vm_page_replace_checked(page, object, offset, m[0]); m[0] = page; page->valid = VM_PAGE_BITS_ALL; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Dec 17 17:00:04 2015 (r292405) +++ head/sys/vm/vm_page.h Thu Dec 17 17:48:57 2015 (r292406) @@ -678,5 +678,20 @@ vm_page_undirty(vm_page_t m) m->dirty = 0; } +static inline void +vm_page_replace_checked(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex, + vm_page_t mold) +{ + vm_page_t mret; + + mret = vm_page_replace(mnew, object, pindex); + KASSERT(mret == mold, + ("invalid page replacement, mold=%p, mret=%p", mold, mret)); + + /* Unused if !INVARIANTS. */ + (void)mold; + (void)mret; +} + #endif /* _KERNEL */ #endif /* !_VM_PAGE_ */ From owner-svn-src-all@freebsd.org Thu Dec 17 18:44:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD0F0A4AF36; Thu, 17 Dec 2015 18:44:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E02F1FBD; Thu, 17 Dec 2015 18:44:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHIiVGS055588; Thu, 17 Dec 2015 18:44:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHIiUq8055579; Thu, 17 Dec 2015 18:44:30 GMT (envelope-from br@FreeBSD.org) Message-Id: <201512171844.tBHIiUq8055579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 17 Dec 2015 18:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292407 - in head/sys/riscv: . include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 18:44:32 -0000 Author: br Date: Thu Dec 17 18:44:30 2015 New Revision: 292407 URL: https://svnweb.freebsd.org/changeset/base/292407 Log: Import RISC-V machine headers. This is a minimal set required to compile kernel and userland. Reviewed by: andrew, imp, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4554 Added: head/sys/riscv/ head/sys/riscv/include/ head/sys/riscv/include/_align.h (contents, props changed) head/sys/riscv/include/_bus.h (contents, props changed) head/sys/riscv/include/_inttypes.h (contents, props changed) head/sys/riscv/include/_limits.h (contents, props changed) head/sys/riscv/include/_stdint.h (contents, props changed) head/sys/riscv/include/_types.h (contents, props changed) head/sys/riscv/include/asm.h (contents, props changed) head/sys/riscv/include/atomic.h (contents, props changed) head/sys/riscv/include/bus.h (contents, props changed) head/sys/riscv/include/bus_dma.h (contents, props changed) head/sys/riscv/include/clock.h (contents, props changed) head/sys/riscv/include/counter.h (contents, props changed) head/sys/riscv/include/cpu.h (contents, props changed) head/sys/riscv/include/cpufunc.h (contents, props changed) head/sys/riscv/include/db_machdep.h (contents, props changed) head/sys/riscv/include/dump.h (contents, props changed) head/sys/riscv/include/elf.h (contents, props changed) head/sys/riscv/include/endian.h (contents, props changed) head/sys/riscv/include/exec.h (contents, props changed) head/sys/riscv/include/float.h (contents, props changed) head/sys/riscv/include/floatingpoint.h (contents, props changed) head/sys/riscv/include/frame.h (contents, props changed) head/sys/riscv/include/ieeefp.h (contents, props changed) head/sys/riscv/include/in_cksum.h (contents, props changed) head/sys/riscv/include/intr.h (contents, props changed) head/sys/riscv/include/kdb.h (contents, props changed) head/sys/riscv/include/machdep.h (contents, props changed) head/sys/riscv/include/md_var.h (contents, props changed) head/sys/riscv/include/memdev.h (contents, props changed) head/sys/riscv/include/minidump.h (contents, props changed) head/sys/riscv/include/ofw_machdep.h (contents, props changed) head/sys/riscv/include/param.h (contents, props changed) head/sys/riscv/include/pcb.h (contents, props changed) head/sys/riscv/include/pcpu.h (contents, props changed) head/sys/riscv/include/pmap.h (contents, props changed) head/sys/riscv/include/pmc_mdep.h (contents, props changed) head/sys/riscv/include/proc.h (contents, props changed) head/sys/riscv/include/profile.h (contents, props changed) head/sys/riscv/include/psl.h (contents, props changed) head/sys/riscv/include/pte.h (contents, props changed) head/sys/riscv/include/ptrace.h (contents, props changed) head/sys/riscv/include/reg.h (contents, props changed) head/sys/riscv/include/reloc.h (contents, props changed) head/sys/riscv/include/resource.h (contents, props changed) head/sys/riscv/include/riscvreg.h (contents, props changed) head/sys/riscv/include/runq.h (contents, props changed) head/sys/riscv/include/setjmp.h (contents, props changed) head/sys/riscv/include/sf_buf.h (contents, props changed) head/sys/riscv/include/signal.h (contents, props changed) head/sys/riscv/include/smp.h (contents, props changed) head/sys/riscv/include/stdarg.h (contents, props changed) head/sys/riscv/include/sysarch.h (contents, props changed) head/sys/riscv/include/trap.h (contents, props changed) head/sys/riscv/include/ucontext.h (contents, props changed) head/sys/riscv/include/vdso.h (contents, props changed) head/sys/riscv/include/vm.h (contents, props changed) head/sys/riscv/include/vmparam.h (contents, props changed) Added: head/sys/riscv/include/_align.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/_align.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz. + * + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _MACHINE__ALIGN_H_ +#define _MACHINE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(long long) - 1) +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_MACHINE__ALIGN_H_ */ Added: head/sys/riscv/include/_bus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/_bus.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2005 M. Warner Losh. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 _MACHINE__BUS_H_ +#define _MACHINE__BUS_H_ + +/* + * Addresses (in bus space). + */ +typedef u_long bus_addr_t; +typedef u_long bus_size_t; + +/* + * Access methods for bus space. + */ +typedef u_long bus_space_handle_t; +typedef struct bus_space *bus_space_tag_t; + +#endif /* !_MACHINE__BUS_H_ */ Added: head/sys/riscv/include/_inttypes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/_inttypes.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,213 @@ +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * From: $NetBSD: int_fmtio.h,v 1.4 2008/04/28 20:23:36 martin Exp $ + * $FreeBSD$ + */ + +#ifndef _MACHINE__INTTYPES_H_ +#define _MACHINE__INTTYPES_H_ + +/* + * Macros for format specifiers. + */ + +/* fprintf(3) macros for signed integers. */ + +#define PRId8 "d" /* int8_t */ +#define PRId16 "d" /* int16_t */ +#define PRId32 "d" /* int32_t */ +#define PRId64 "ld" /* int64_t */ +#define PRIdLEAST8 "d" /* int_least8_t */ +#define PRIdLEAST16 "d" /* int_least16_t */ +#define PRIdLEAST32 "d" /* int_least32_t */ +#define PRIdLEAST64 "ld" /* int_least64_t */ +#define PRIdFAST8 "d" /* int_fast8_t */ +#define PRIdFAST16 "d" /* int_fast16_t */ +#define PRIdFAST32 "d" /* int_fast32_t */ +#define PRIdFAST64 "ld" /* int_fast64_t */ +#define PRIdMAX "jd" /* intmax_t */ +#define PRIdPTR "ld" /* intptr_t */ + +#define PRIi8 "i" /* int8_t */ +#define PRIi16 "i" /* int16_t */ +#define PRIi32 "i" /* int32_t */ +#define PRIi64 "li" /* int64_t */ +#define PRIiLEAST8 "i" /* int_least8_t */ +#define PRIiLEAST16 "i" /* int_least16_t */ +#define PRIiLEAST32 "i" /* int_least32_t */ +#define PRIiLEAST64 "li" /* int_least64_t */ +#define PRIiFAST8 "i" /* int_fast8_t */ +#define PRIiFAST16 "i" /* int_fast16_t */ +#define PRIiFAST32 "i" /* int_fast32_t */ +#define PRIiFAST64 "li" /* int_fast64_t */ +#define PRIiMAX "ji" /* intmax_t */ +#define PRIiPTR "li" /* intptr_t */ + +/* fprintf(3) macros for unsigned integers. */ + +#define PRIo8 "o" /* uint8_t */ +#define PRIo16 "o" /* uint16_t */ +#define PRIo32 "o" /* uint32_t */ +#define PRIo64 "lo" /* uint64_t */ +#define PRIoLEAST8 "o" /* uint_least8_t */ +#define PRIoLEAST16 "o" /* uint_least16_t */ +#define PRIoLEAST32 "o" /* uint_least32_t */ +#define PRIoLEAST64 "lo" /* uint_least64_t */ +#define PRIoFAST8 "o" /* uint_fast8_t */ +#define PRIoFAST16 "o" /* uint_fast16_t */ +#define PRIoFAST32 "o" /* uint_fast32_t */ +#define PRIoFAST64 "lo" /* uint_fast64_t */ +#define PRIoMAX "jo" /* uintmax_t */ +#define PRIoPTR "lo" /* uintptr_t */ + +#define PRIu8 "u" /* uint8_t */ +#define PRIu16 "u" /* uint16_t */ +#define PRIu32 "u" /* uint32_t */ +#define PRIu64 "lu" /* uint64_t */ +#define PRIuLEAST8 "u" /* uint_least8_t */ +#define PRIuLEAST16 "u" /* uint_least16_t */ +#define PRIuLEAST32 "u" /* uint_least32_t */ +#define PRIuLEAST64 "lu" /* uint_least64_t */ +#define PRIuFAST8 "u" /* uint_fast8_t */ +#define PRIuFAST16 "u" /* uint_fast16_t */ +#define PRIuFAST32 "u" /* uint_fast32_t */ +#define PRIuFAST64 "lu" /* uint_fast64_t */ +#define PRIuMAX "ju" /* uintmax_t */ +#define PRIuPTR "lu" /* uintptr_t */ + +#define PRIx8 "x" /* uint8_t */ +#define PRIx16 "x" /* uint16_t */ +#define PRIx32 "x" /* uint32_t */ +#define PRIx64 "lx" /* uint64_t */ +#define PRIxLEAST8 "x" /* uint_least8_t */ +#define PRIxLEAST16 "x" /* uint_least16_t */ +#define PRIxLEAST32 "x" /* uint_least32_t */ +#define PRIxLEAST64 "lx" /* uint_least64_t */ +#define PRIxFAST8 "x" /* uint_fast8_t */ +#define PRIxFAST16 "x" /* uint_fast16_t */ +#define PRIxFAST32 "x" /* uint_fast32_t */ +#define PRIxFAST64 "lx" /* uint_fast64_t */ +#define PRIxMAX "jx" /* uintmax_t */ +#define PRIxPTR "lx" /* uintptr_t */ + +#define PRIX8 "X" /* uint8_t */ +#define PRIX16 "X" /* uint16_t */ +#define PRIX32 "X" /* uint32_t */ +#define PRIX64 "lX" /* uint64_t */ +#define PRIXLEAST8 "X" /* uint_least8_t */ +#define PRIXLEAST16 "X" /* uint_least16_t */ +#define PRIXLEAST32 "X" /* uint_least32_t */ +#define PRIXLEAST64 "lX" /* uint_least64_t */ +#define PRIXFAST8 "X" /* uint_fast8_t */ +#define PRIXFAST16 "X" /* uint_fast16_t */ +#define PRIXFAST32 "X" /* uint_fast32_t */ +#define PRIXFAST64 "lX" /* uint_fast64_t */ +#define PRIXMAX "jX" /* uintmax_t */ +#define PRIXPTR "lX" /* uintptr_t */ + +/* fscanf(3) macros for signed integers. */ + +#define SCNd8 "hhd" /* int8_t */ +#define SCNd16 "hd" /* int16_t */ +#define SCNd32 "d" /* int32_t */ +#define SCNd64 "ld" /* int64_t */ +#define SCNdLEAST8 "hhd" /* int_least8_t */ +#define SCNdLEAST16 "hd" /* int_least16_t */ +#define SCNdLEAST32 "d" /* int_least32_t */ +#define SCNdLEAST64 "ld" /* int_least64_t */ +#define SCNdFAST8 "d" /* int_fast8_t */ +#define SCNdFAST16 "d" /* int_fast16_t */ +#define SCNdFAST32 "d" /* int_fast32_t */ +#define SCNdFAST64 "ld" /* int_fast64_t */ +#define SCNdMAX "jd" /* intmax_t */ +#define SCNdPTR "ld" /* intptr_t */ + +#define SCNi8 "hhi" /* int8_t */ +#define SCNi16 "hi" /* int16_t */ +#define SCNi32 "i" /* int32_t */ +#define SCNi64 "li" /* int64_t */ +#define SCNiLEAST8 "hhi" /* int_least8_t */ +#define SCNiLEAST16 "hi" /* int_least16_t */ +#define SCNiLEAST32 "i" /* int_least32_t */ +#define SCNiLEAST64 "li" /* int_least64_t */ +#define SCNiFAST8 "i" /* int_fast8_t */ +#define SCNiFAST16 "i" /* int_fast16_t */ +#define SCNiFAST32 "i" /* int_fast32_t */ +#define SCNiFAST64 "li" /* int_fast64_t */ +#define SCNiMAX "ji" /* intmax_t */ +#define SCNiPTR "li" /* intptr_t */ + +/* fscanf(3) macros for unsigned integers. */ + +#define SCNo8 "hho" /* uint8_t */ +#define SCNo16 "ho" /* uint16_t */ +#define SCNo32 "o" /* uint32_t */ +#define SCNo64 "lo" /* uint64_t */ +#define SCNoLEAST8 "hho" /* uint_least8_t */ +#define SCNoLEAST16 "ho" /* uint_least16_t */ +#define SCNoLEAST32 "o" /* uint_least32_t */ +#define SCNoLEAST64 "lo" /* uint_least64_t */ +#define SCNoFAST8 "o" /* uint_fast8_t */ +#define SCNoFAST16 "o" /* uint_fast16_t */ +#define SCNoFAST32 "o" /* uint_fast32_t */ +#define SCNoFAST64 "lo" /* uint_fast64_t */ +#define SCNoMAX "jo" /* uintmax_t */ +#define SCNoPTR "lo" /* uintptr_t */ + +#define SCNu8 "hhu" /* uint8_t */ +#define SCNu16 "hu" /* uint16_t */ +#define SCNu32 "u" /* uint32_t */ +#define SCNu64 "lu" /* uint64_t */ +#define SCNuLEAST8 "hhu" /* uint_least8_t */ +#define SCNuLEAST16 "hu" /* uint_least16_t */ +#define SCNuLEAST32 "u" /* uint_least32_t */ +#define SCNuLEAST64 "lu" /* uint_least64_t */ +#define SCNuFAST8 "u" /* uint_fast8_t */ +#define SCNuFAST16 "u" /* uint_fast16_t */ +#define SCNuFAST32 "u" /* uint_fast32_t */ +#define SCNuFAST64 "lu" /* uint_fast64_t */ +#define SCNuMAX "ju" /* uintmax_t */ +#define SCNuPTR "lu" /* uintptr_t */ + +#define SCNx8 "hhx" /* uint8_t */ +#define SCNx16 "hx" /* uint16_t */ +#define SCNx32 "x" /* uint32_t */ +#define SCNx64 "lx" /* uint64_t */ +#define SCNxLEAST8 "hhx" /* uint_least8_t */ +#define SCNxLEAST16 "hx" /* uint_least16_t */ +#define SCNxLEAST32 "x" /* uint_least32_t */ +#define SCNxLEAST64 "lx" /* uint_least64_t */ +#define SCNxFAST8 "x" /* uint_fast8_t */ +#define SCNxFAST16 "x" /* uint_fast16_t */ +#define SCNxFAST32 "x" /* uint_fast32_t */ +#define SCNxFAST64 "lx" /* uint_fast64_t */ +#define SCNxMAX "jx" /* uintmax_t */ +#define SCNxPTR "lx" /* uintptr_t */ + +#endif /* !_MACHINE__INTTYPES_H_ */ Added: head/sys/riscv/include/_limits.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/_limits.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.3 (Berkeley) 1/4/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__LIMITS_H_ +#define _MACHINE__LIMITS_H_ + +/* + * According to ANSI (section 2.2.4.2), the values below must be usable by + * #if preprocessing directives. Additionally, the expression must have the + * same type as would an expression that is an object of the corresponding + * type converted according to the integral promotions. The subtraction for + * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an + * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + */ + +#define __CHAR_BIT 8 /* number of bits in a char */ + +#define __SCHAR_MAX 0x7f /* max value for a signed char */ +#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ + +#define __UCHAR_MAX 0xff /* max value for an unsigned char */ + +#define __USHRT_MAX 0xffff /* max value for an unsigned short */ +#define __SHRT_MAX 0x7fff /* max value for a short */ +#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */ + +#define __UINT_MAX 0xffffffff /* max value for an unsigned int */ +#define __INT_MAX 0x7fffffff /* max value for an int */ +#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ + +#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ +#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */ +#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */ + +/* Long longs have the same size but not the same type as longs. */ + /* max for an unsigned long long */ +#define __ULLONG_MAX 0xffffffffffffffffULL +#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ +#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ + +#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ + +#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ + +#define __OFF_MAX __LONG_MAX /* max value for an off_t */ +#define __OFF_MIN __LONG_MIN /* min value for an off_t */ + +/* Quads and longs are the same size. Ensure they stay in sync. */ +#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */ +#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */ +#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */ + +#define __LONG_BIT 64 +#define __WORD_BIT 32 + +/* Minimum signal stack size. */ +#define __MINSIGSTKSZ (1024 * 4) + +#endif /* !_MACHINE__LIMITS_H_ */ Added: head/sys/riscv/include/_stdint.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/_stdint.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2001, 2002 Mike Barcroft + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE__STDINT_H_ +#define _MACHINE__STDINT_H_ + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) + +#define INT8_C(c) (c) +#define INT16_C(c) (c) +#define INT32_C(c) (c) +#define INT64_C(c) (c ## L) + +#define UINT8_C(c) (c) +#define UINT16_C(c) (c) +#define UINT32_C(c) (c ## U) +#define UINT64_C(c) (c ## UL) + +#define INTMAX_C(c) INT64_C(c) +#define UINTMAX_C(c) UINT64_C(c) + +#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) + +/* + * ISO/IEC 9899:1999 + * 7.18.2.1 Limits of exact-width integer types + */ +/* Minimum values of exact-width signed integer types. */ +#define INT8_MIN (-0x7f-1) +#define INT16_MIN (-0x7fff-1) +#define INT32_MIN (-0x7fffffff-1) +#define INT64_MIN (-0x7fffffffffffffffL-1) + +/* Maximum values of exact-width signed integer types. */ +#define INT8_MAX 0x7f +#define INT16_MAX 0x7fff +#define INT32_MAX 0x7fffffff +#define INT64_MAX 0x7fffffffffffffffL + +/* Maximum values of exact-width unsigned integer types. */ +#define UINT8_MAX 0xff +#define UINT16_MAX 0xffff +#define UINT32_MAX 0xffffffffU +#define UINT64_MAX 0xffffffffffffffffUL + +/* + * ISO/IEC 9899:1999 + * 7.18.2.2 Limits of minimum-width integer types + */ +/* Minimum values of minimum-width signed integer types. */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +/* Maximum values of minimum-width signed integer types. */ +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +/* Maximum values of minimum-width unsigned integer types. */ +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.3 Limits of fastest minimum-width integer types + */ +/* Minimum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MIN INT32_MIN +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +/* Maximum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MAX INT32_MAX +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +/* Maximum values of fastest minimum-width unsigned integer types. */ +#define UINT_FAST8_MAX UINT32_MAX +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.4 Limits of integer types capable of holding object pointers + */ +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.5 Limits of greatest-width integer types + */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.3 Limits of other integer types + */ +/* Limits of ptrdiff_t. */ +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX + +/* Limits of sig_atomic_t. */ +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +/* Limit of size_t. */ +#define SIZE_MAX UINT64_MAX + +/* Limits of wint_t. */ +#define WINT_MIN INT32_MIN +#define WINT_MAX INT32_MAX + +#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ + +#endif /* !_MACHINE__STDINT_H_ */ Added: head/sys/riscv/include/_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/_types.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 2002 Mike Barcroft + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +#ifndef _SYS_CDEFS_H_ +#error this file needs sys/cdefs.h as a prerequisite +#endif + +/* + * Basic types upon which most other types are built. + */ +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long __int64_t; +typedef unsigned long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __int32_t __clock_t; /* clock()... */ +typedef __int64_t __critical_t; +typedef double __double_t; +typedef float __float_t; +typedef __int64_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int64_t __intptr_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int64_t __register_t; +typedef __int64_t __segsz_t; /* segment size (in pages) */ +typedef __uint64_t __size_t; /* sizeof() */ +typedef __int64_t __ssize_t; /* byte count or error */ +typedef __int64_t __time_t; /* time()... */ +typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint64_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __u_register_t; +typedef __uint64_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_paddr_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint64_t __vm_size_t; +typedef int ___wchar_t; + +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ + +/* + * Unusual type definitions. + */ +#ifdef __GNUCLIKE_BUILTIN_VARARGS +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef char * __va_list; +#endif /* __GNUCLIKE_BUILTIN_VARARGS */ +#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \ + && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ Added: head/sys/riscv/include/asm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/asm.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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 _MACHINE_ASM_H_ +#define _MACHINE_ASM_H_ + +#undef __FBSDID +#if !defined(lint) && !defined(STRIP_FBSDID) +#define __FBSDID(s) .ident s +#else +#define __FBSDID(s) /* nothing */ +#endif /* not lint and not STRIP_FBSDID */ + +#define _C_LABEL(x) x + +#define ENTRY(sym) \ + .text; .globl sym; .type sym,@function; .align 2; sym: +#define END(sym) .size sym, . - sym + +#define EENTRY(sym) \ + .globl sym; sym: +#define EEND(sym) + +#define WEAK_REFERENCE(sym, alias) \ + .weak alias; \ + .set alias,sym + +#define SET_FAULT_HANDLER(handler, tmp) \ + la tmp, pcpup; \ + ld tmp, 0(tmp); \ + ld tmp, PC_CURTHREAD(tmp); \ + ld tmp, TD_PCB(tmp); /* Load the pcb */ \ + sd handler, PCB_ONFAULT(tmp) /* Set the handler */ + +#endif /* _MACHINE_ASM_H_ */ Added: head/sys/riscv/include/atomic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/atomic.h Thu Dec 17 18:44:30 2015 (r292407) @@ -0,0 +1,452 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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 _MACHINE_ATOMIC_H_ +#define _MACHINE_ATOMIC_H_ + +#define fence() __asm __volatile("fence" ::: "memory"); +#define mb() fence() +#define rmb() fence() +#define wmb() fence() + +#define ATOMIC_ACQ_REL(NAME, WIDTH) \ +static __inline void \ +atomic_##NAME##_acq_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\ +{ \ + atomic_##NAME##_##WIDTH(p, v); \ + fence(); \ +} \ + \ +static __inline void \ +atomic_##NAME##_rel_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\ +{ \ + fence(); \ + atomic_##NAME##_##WIDTH(p, v); \ +} + +static __inline void +atomic_add_32(volatile uint32_t *p, uint32_t val) +{ + + __asm __volatile("amoadd.w zero, %1, %0" + : "+A" (*p) + : "r" (val) + : "memory"); +} + +static __inline void +atomic_subtract_32(volatile uint32_t *p, uint32_t val) +{ + + __asm __volatile("amoadd.w zero, %1, %0" + : "+A" (*p) + : "r" (-val) + : "memory"); +} + +static __inline void +atomic_set_32(volatile uint32_t *p, uint32_t val) +{ + + __asm __volatile("amoor.w zero, %1, %0" + : "+A" (*p) + : "r" (val) + : "memory"); +} + +static __inline void +atomic_clear_32(volatile uint32_t *p, uint32_t val) +{ + + __asm __volatile("amoand.w zero, %1, %0" + : "+A" (*p) + : "r" (~val) + : "memory"); +} + +static __inline int +atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +{ + uint32_t tmp; + int res; + + res = 0; + + __asm __volatile( + "0:" + "li %1, 1\n" /* Preset to fail */ + "lr.w %0, %2\n" + "bne %0, %z3, 1f\n" + "sc.w %1, %z4, %2\n" + "bnez %1, 0b\n" + "1:" + : "=&r" (tmp), "=&r" (res), "+A" (*p) + : "rJ" (cmpval), "rJ" (newval) + : "memory"); + + return (!res); +} + +static __inline uint32_t +atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) +{ + uint32_t ret; + + __asm __volatile("amoadd.w %0, %2, %1" + : "=&r" (ret), "+A" (*p) + : "r" (val) + : "memory"); + + return (ret); +} + +static __inline uint32_t +atomic_readandclear_32(volatile uint32_t *p) +{ + uint32_t ret; + uint32_t val; + + val = 0; + + __asm __volatile("amoswap.w %0, %2, %1" + : "=&r"(ret), "+A" (*p) + : "r" (val) + : "memory"); + + return (ret); +} + +#define atomic_add_int atomic_add_32 +#define atomic_clear_int atomic_clear_32 +#define atomic_cmpset_int atomic_cmpset_32 +#define atomic_fetchadd_int atomic_fetchadd_32 +#define atomic_readandclear_int atomic_readandclear_32 +#define atomic_set_int atomic_set_32 +#define atomic_subtract_int atomic_subtract_32 + +ATOMIC_ACQ_REL(set, 32) +ATOMIC_ACQ_REL(clear, 32) +ATOMIC_ACQ_REL(add, 32) +ATOMIC_ACQ_REL(subtract, 32) + +static __inline int +atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +{ + int res; + + res = atomic_cmpset_32(p, cmpval, newval); + + fence(); + + return (res); +} + +static __inline int +atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) +{ + + fence(); + + return (atomic_cmpset_32(p, cmpval, newval)); +} + +static __inline uint32_t +atomic_load_acq_32(volatile uint32_t *p) +{ + uint32_t ret; + + ret = *p; + + fence(); + + return (ret); +} + +static __inline void +atomic_store_rel_32(volatile uint32_t *p, uint32_t val) +{ + + fence(); + + *p = val; +} + +#define atomic_add_acq_int atomic_add_acq_32 +#define atomic_clear_acq_int atomic_clear_acq_32 +#define atomic_cmpset_acq_int atomic_cmpset_acq_32 +#define atomic_load_acq_int atomic_load_acq_32 +#define atomic_set_acq_int atomic_set_acq_32 +#define atomic_subtract_acq_int atomic_subtract_acq_32 + +#define atomic_add_rel_int atomic_add_rel_32 +#define atomic_clear_rel_int atomic_add_rel_32 +#define atomic_cmpset_rel_int atomic_cmpset_rel_32 +#define atomic_set_rel_int atomic_set_rel_32 +#define atomic_subtract_rel_int atomic_subtract_rel_32 +#define atomic_store_rel_int atomic_store_rel_32 + +static __inline void +atomic_add_64(volatile uint64_t *p, uint64_t val) +{ + + __asm __volatile("amoadd.d zero, %1, %0" + : "+A" (*p) + : "r" (val) + : "memory"); +} + +static __inline void +atomic_subtract_64(volatile uint64_t *p, uint64_t val) +{ + + __asm __volatile("amoadd.d zero, %1, %0" + : "+A" (*p) + : "r" (-val) + : "memory"); +} + +static __inline void +atomic_set_64(volatile uint64_t *p, uint64_t val) +{ + + __asm __volatile("amoor.d zero, %1, %0" + : "+A" (*p) + : "r" (val) + : "memory"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 17 18:57:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EA6A499CB; Thu, 17 Dec 2015 18:57:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 485C81DAE; Thu, 17 Dec 2015 18:57:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBHIvViC050286 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 21:57:31 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBHIvVxO050285; Thu, 17 Dec 2015 21:57:31 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 21:57:31 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 Message-ID: <20151217185731.GK42340@FreeBSD.org> References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5672C6AE.7070407@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 18:57:36 -0000 Steven, On Thu, Dec 17, 2015 at 02:29:02PM +0000, Steven Hartland wrote: S> Hey Gleb, sorry I didn't wait for your review, but I did ask around on what S> the timeout for this would be and was informed 2 weeks and as it had been S> over a month, with quite a bit of feedback from others in the area, all S> of which S> had been addressed I thought that was reasonable. S> S> A simple reply of "I do intend to review but don't have time yet so S> please wait" S> I think would be useful in these types of situations, as I know S> everyone's busy S> but its impossible to know what others are thinking. Of course it is my fault that I don't review everything phabricator sends to me, which is a lot. Because it is so easy to add a bunch of subscribers to a revision. However, in the good old pre-phabricator times, people used to send email directly to each other. Those email arrive to my regular mailbox, which I check as often as I can. You could ping me via email. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Dec 17 19:16:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 090F8A4A7A4; Thu, 17 Dec 2015 19:16:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 7DF761F4E; Thu, 17 Dec 2015 19:16:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBHJGUJF050395 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 22:16:30 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBHJGU5T050394; Thu, 17 Dec 2015 22:16:30 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 22:16:30 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 Message-ID: <20151217191630.GL42340@FreeBSD.org> References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5672C6AE.7070407@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 19:16:34 -0000 Steven, On Thu, Dec 17, 2015 at 02:29:02PM +0000, Steven Hartland wrote: S> I would definitely like to understand more about your concerns and learn S> from S> your knowledge in this area, so thanks for that offer, and while it does S> sound S> unforgiving I totally understand where you're coming from. S> S> Hopefully together we can bring this to a satisfactory conclusion as I S> would hate S> for both carp and lagg to stay as broken, 2 years is long enough :D Ok, let's get technical. CARP and LAGG were not broken for 2 years. They were working very well in the way they were designed to work. The setup in the bug 156226 was broken initially. The "link aggregation" itself refers to an aggregation of links between two logical devices. If you build lagg(4) interface on top of two ports that are plugged into different switches, you are calling for trouble. All comments in the 156226 from Eugene Grosbein are valid. I would not repeat them, but ask you to reread them in bugzilla. There was a good reason why for 2 years committers stayed away from this "bug" and related patch. Nevertheless, someone wants to give a kick to this initially broken network design and run it somehow. And this "somehow" implies Layer2 upcalling into upper layers to do something, since there is no established standard layer2 heartbeat packet. I have chatted with networking gurus at my job, and they said, that they don't know any decent network equipment that supports such setup. However, they noticed that Windows is capable for such failover. I haven't yet learned on how Windows solves the problem. Actually, those who pushed committing 156226 should have done these investigations. Probably Windows does exactly the same, sends gratutious ARP or its IPv6 analog. Or may be does something better like sending useless L2 datagram, but with a proper source hardware address. Okay, what if we want same in FreeBSD as in Windows? Should we do the following list of evil things: - put DELAY in context of callout(or in context of any network processing) - introduce new notions of a link state, or new KPI for link handling Note that link handling KPI was stable for iver 10 years and satisfied all the different types of interfaces we support - create new interface methods - call into address families supplying an ifnet that doesn't have this AF instantiated, and then to fix immediate panic putting there a kludge of "if (foo == NULL) return;" - etc... Sorry, I'm putting "etc" here, because tires on details. You would agree that the whole process of fixing the "bug" was overcoming the problems that the network stack is not designed for the things that you are willing to do. Won't you agree? Or should we just write a tiny program, that would observe state of networking ports, and if a port changes state then send a tiny packet as a bpf(4) write? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Dec 17 19:20:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82778A4AA2F; Thu, 17 Dec 2015 19:20:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 0EFBE1316; Thu, 17 Dec 2015 19:20:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBHJKp5x050439 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Dec 2015 22:20:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBHJKp4O050438; Thu, 17 Dec 2015 22:20:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Dec 2015 22:20:51 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 Message-ID: <20151217192051.GM42340@FreeBSD.org> References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5672C6AE.7070407@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 19:20:54 -0000 Steven, another feasible solution for the design described in the 156226 would be to run STP on the switches, and if_bridge(4) instead of if_lagg(4) on FreeBSD, also with STP enabled. Would work perfectly. Of course, if switches are dumb and cheap, and can't do STP, then a tiny bpf-writer is the right solution. P.S. When I was running network in my university dormitory, we used a lot of cheap solutions, and a lot of dirty workarounds, but none of the latter made its way to FreeBSD kernel. You can also ask Eugene Grosbein, he also has huge experience of living on not so pleasant workarounds, but not pushing them agrressively into the kernel. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Thu Dec 17 19:36:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C260A4B5DB; Thu, 17 Dec 2015 19:36:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCEBC1FF1; Thu, 17 Dec 2015 19:36:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHJaPiV073782; Thu, 17 Dec 2015 19:36:25 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHJaPnl073781; Thu, 17 Dec 2015 19:36:25 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512171936.tBHJaPnl073781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 17 Dec 2015 19:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292408 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 19:36:27 -0000 Author: des Date: Thu Dec 17 19:36:25 2015 New Revision: 292408 URL: https://svnweb.freebsd.org/changeset/base/292408 Log: Incorrect length in calloc() call, already fixed upstream. PR: 204769 Submitted by: David Binderman MFC after: 1 week Modified: head/crypto/openssh/digest-libc.c Modified: head/crypto/openssh/digest-libc.c ============================================================================== --- head/crypto/openssh/digest-libc.c Thu Dec 17 18:44:30 2015 (r292407) +++ head/crypto/openssh/digest-libc.c Thu Dec 17 19:36:25 2015 (r292408) @@ -147,7 +147,7 @@ ssh_digest_start(int alg) const struct ssh_digest *digest = ssh_digest_by_alg(alg); struct ssh_digest_ctx *ret; - if (digest == NULL || (ret = calloc(1, sizeof(ret))) == NULL) + if (digest == NULL || (ret = calloc(1, sizeof(*ret))) == NULL) return NULL; if ((ret->mdctx = calloc(1, digest->ctx_len)) == NULL) { free(ret); From owner-svn-src-all@freebsd.org Thu Dec 17 20:33:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3469DA4B1EC; Thu, 17 Dec 2015 20:33:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEC5515BC; Thu, 17 Dec 2015 20:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHKXL0O090999; Thu, 17 Dec 2015 20:33:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHKXLGm090998; Thu, 17 Dec 2015 20:33:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512172033.tBHKXLGm090998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 17 Dec 2015 20:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292409 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 20:33:22 -0000 Author: jhb Date: Thu Dec 17 20:33:20 2015 New Revision: 292409 URL: https://svnweb.freebsd.org/changeset/base/292409 Log: t seems certain Intel GPUs use GPIO bitbanging over a child device instead of GMBUS access for I2C transfers. The GMBUS driver falls back to this mode when a transfer times out. However, the first transfer to timeout was sending the request back to itself resulting in an panic due to recursing on a lock. Fix it to forward the request on to the proper device. This appears to have been accidentally changed in r277487. Reported by: Joe Maloney Reviewed by: adrian, dumbbell, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4599 Modified: head/sys/dev/drm2/i915/intel_iic.c Modified: head/sys/dev/drm2/i915/intel_iic.c ============================================================================== --- head/sys/dev/drm2/i915/intel_iic.c Thu Dec 17 19:36:25 2015 (r292408) +++ head/sys/dev/drm2/i915/intel_iic.c Thu Dec 17 20:33:20 2015 (r292409) @@ -456,7 +456,7 @@ timeout: /* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */ sc->force_bit_dev = true; - error = -IICBUS_TRANSFER(adapter, msgs, num); + error = -IICBUS_TRANSFER(dev_priv->bbbus[unit], msgs, num); out: sx_xunlock(&dev_priv->gmbus_sx); From owner-svn-src-all@freebsd.org Thu Dec 17 20:42:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DF5EA4B61A; Thu, 17 Dec 2015 20:42:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28A441C7D; Thu, 17 Dec 2015 20:42:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHKg5Hd091932; Thu, 17 Dec 2015 20:42:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHKg5bM091931; Thu, 17 Dec 2015 20:42:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512172042.tBHKg5bM091931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 17 Dec 2015 20:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292410 - head/usr.sbin/boot0cfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 20:42:07 -0000 Author: jhb Date: Thu Dec 17 20:42:05 2015 New Revision: 292410 URL: https://svnweb.freebsd.org/changeset/base/292410 Log: Exit cleanly if malloc() fails to allocate a buffer for a copy of the current MBR. PR: 205322 Submitted by: Alexander Kuleshov MFC after: 1 week Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:33:20 2015 (r292409) +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:42:05 2015 (r292410) @@ -337,6 +337,8 @@ read_mbr(const char *disk, u_int8_t **mb return (mbr_size); } *mbr = malloc(sizeof(buf)); + if (mbr == NULL) + errx(1, "%s: unable to allocate MBR buffer", disk); memcpy(*mbr, buf, sizeof(buf)); close(fd); From owner-svn-src-all@freebsd.org Thu Dec 17 21:01:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81453A4BE75; Thu, 17 Dec 2015 21:01:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 500E41CA5; Thu, 17 Dec 2015 21:01:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHL1Jqu098953; Thu, 17 Dec 2015 21:01:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHL1JxS098952; Thu, 17 Dec 2015 21:01:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201512172101.tBHL1JxS098952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 17 Dec 2015 21:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292411 - head/sys/dev/if_ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 21:01:20 -0000 Author: glebius Date: Thu Dec 17 21:01:19 2015 New Revision: 292411 URL: https://svnweb.freebsd.org/changeset/base/292411 Log: Fix regression in if_ndis in r280347. Submitted by: avos Reported by: Ev Bogdanov Tested by: Ivan Kormachev MFC after: 3 days Modified: head/sys/dev/if_ndis/if_ndis_pci.c Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Thu Dec 17 20:42:05 2015 (r292410) +++ head/sys/dev/if_ndis/if_ndis_pci.c Thu Dec 17 21:01:19 2015 (r292411) @@ -298,8 +298,7 @@ ndis_attach_pci(dev) BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - NDIS_NSEG_NEW, /* nsegments */ + DFLTPHYS, NDIS_NSEG_NEW,/* maxsize, nsegments */ BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, NULL, /* lockfunc, lockarg */ From owner-svn-src-all@freebsd.org Thu Dec 17 21:34:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B8BA4B1F3; Thu, 17 Dec 2015 21:34:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 133F61D2F; Thu, 17 Dec 2015 21:34:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 294BAB95B; Thu, 17 Dec 2015 16:34:58 -0500 (EST) From: John Baldwin To: Steven Hartland Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 Date: Thu, 17 Dec 2015 09:48:20 -0800 Message-ID: <2008694.dX1fJ1pz2a@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <5672C6AE.7070407@freebsd.org> References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@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); Thu, 17 Dec 2015 16:34:58 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 21:34:59 -0000 On Thursday, December 17, 2015 02:29:02 PM Steven Hartland wrote: > With regards MAINTAINERS, is there any sort of automation which could alert > on this (pre-commit) hook maybe as I'm sure that would be helpful as a > reminder. To this point (and this point only): I would encourage anyone who with a MAINTAINERS entry to setup a herald rule in phabricator to auto-subscribe to changes that affect files you care about. Uploading diffs to phab will then work as a sort of pre-commit hook. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Dec 17 22:55:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2B1A4BDDD for ; Thu, 17 Dec 2015 22:55:08 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9D311AA3 for ; Thu, 17 Dec 2015 22:55:07 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id l126so43462874wml.1 for ; Thu, 17 Dec 2015 14:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=bd5ovfB7A0ETpQOsrsBQtUUcpDL7ActZK0mZ/UYf9lg=; b=GmqToek2Jp8eAbSsX9tII4bKiDS3VDhuhBZvHpIETWuLwkPimreOseX9cRaNc77wGr Pew9ARBWsbjoVgIs6Mg8Z+U8EuNwAaLYlWmrWPiHL2wX4sAwe8sQCBJvHOndi6/mOQUI xc4RZ427mZSgCXm+8ezfEQWnenGril3LGnJi7eG8x7a26ZKj/ufzx+j5fKqC8Utnw6JL OVelIFVYyK+V0FPFpOHmDC5T0QBTXmZnUu0xNahLdzRYrucIIlOeio2k7IPTb7D84sH7 fG8CjanyIjIhiq39R+zLBpXLfNh3rJdbvqCkDBBQmOSxUlkWu6cndue9T93/tP9O4f51 Eang== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=bd5ovfB7A0ETpQOsrsBQtUUcpDL7ActZK0mZ/UYf9lg=; b=XEUYPro8XxO8bcLxyaSGJcGaoeS6Shk4I1U3MTWPz04NHpA9MCSUh1nQzEXdS8cWoq ek+rF6++0ccTff3atspaqymLWGV0KvSZK2Z8QvYZ2St1pm2v1lkallDqor6QOUGVYl2E moYPwfIxPvqHA7SekHwKaFdxMbAASZ1VMFjsymNR3JHXZPxBMKXWkEt4qL4uXWsytxpl hSxLZYYjcIQihN61GW0qCLHc0AzMadMvBIf9Qr6qNeSDpod98t2vbeaJ95TSMJt3fwrV 81eYfFeganZJ1Ifm8nytbTTYTB58XEurOIJ38oSGhLgZ+rabeupW8yn89dswIuM+6hvD LFrQ== X-Gm-Message-State: ALoCoQkxZp+ZScQzkqoe6GvhoeMU5i+MxpoCQG3ImMFEmrAIlDd3PET5yExWXKH/2PEq+JHymSbNEoTu0x30uNzZ01b7pF+r/A== X-Received: by 10.28.134.199 with SMTP id i190mr877219wmd.33.1450392906299; Thu, 17 Dec 2015 14:55:06 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id m16sm4212900wmb.13.2015.12.17.14.55.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 14:55:05 -0800 (PST) Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 To: Gleb Smirnoff References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> <20151217192051.GM42340@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Steven Hartland Message-ID: <56733D49.8040103@multiplay.co.uk> Date: Thu, 17 Dec 2015 22:55:05 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151217192051.GM42340@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 22:55:08 -0000 On 17/12/2015 19:20, Gleb Smirnoff wrote: > Steven, > > another feasible solution for the design described in the 156226 > would be to run STP on the switches, and if_bridge(4) instead of > if_lagg(4) on FreeBSD, also with STP enabled. Would work perfectly. > > Of course, if switches are dumb and cheap, and can't do STP, > then a tiny bpf-writer is the right solution. > > P.S. When I was running network in my university dormitory, we > used a lot of cheap solutions, and a lot of dirty workarounds, > but none of the latter made its way to FreeBSD kernel. You can > also ask Eugene Grosbein, he also has huge experience of living > on not so pleasant workarounds, but not pushing them agrressively > into the kernel. > Last time I heard STP is a bad word in networking, so I'm sure they network team would have me crucified for even suggesting it and start shouting MLAG for the rest of the day ;-) Regards Steve From owner-svn-src-all@freebsd.org Thu Dec 17 23:21:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C231A49EB3; Thu, 17 Dec 2015 23:21:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F63B1BCE; Thu, 17 Dec 2015 23:21:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHNLc3J040528; Thu, 17 Dec 2015 23:21:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHNLcbd040524; Thu, 17 Dec 2015 23:21:38 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512172321.tBHNLcbd040524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 17 Dec 2015 23:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292413 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 23:21:39 -0000 Author: cem Date: Thu Dec 17 23:21:37 2015 New Revision: 292413 URL: https://svnweb.freebsd.org/changeset/base/292413 Log: ioat(4): Add an API to get HW revision Different revisions support different operations. Refer to Intel External Design Specifications to figure out what your hardware supports. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_hw.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Thu Dec 17 23:13:04 2015 (r292412) +++ head/share/man/man4/ioat.4 Thu Dec 17 23:21:37 2015 (r292413) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd December 17, 2015 .Dt IOAT 4 .Os .Sh NAME @@ -64,6 +64,8 @@ In .Ft void .Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine" .Ft int +.Fn ioat_get_hwversion "bus_dmaengine_t dmaengine" +.Ft int .Fn ioat_set_interrupt_coalesce "bus_dmaengine_t dmaengine" "uint16_t delay" .Ft uint16_t .Fn ioat_get_max_coalesce_period "bus_dmaengine_t dmaengine" Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Thu Dec 17 23:13:04 2015 (r292412) +++ head/sys/dev/ioat/ioat.c Thu Dec 17 23:21:37 2015 (r292413) @@ -736,6 +736,15 @@ ioat_put_dmaengine(bus_dmaengine_t dmaen } int +ioat_get_hwversion(bus_dmaengine_t dmaengine) +{ + struct ioat_softc *ioat; + + ioat = to_ioat_softc(dmaengine); + return (ioat->version); +} + +int ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay) { struct ioat_softc *ioat; Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Thu Dec 17 23:13:04 2015 (r292412) +++ head/sys/dev/ioat/ioat.h Thu Dec 17 23:21:37 2015 (r292413) @@ -48,6 +48,14 @@ __FBSDID("$FreeBSD$"); #define DMA_NO_WAIT 0x2 #define DMA_ALL_FLAGS (DMA_INT_EN | DMA_NO_WAIT) +/* + * Hardware revision number. Different hardware revisions support different + * features. For example, 3.2 cannot read from MMIO space, while 3.3 can. + */ +#define IOAT_VER_3_0 0x30 +#define IOAT_VER_3_2 0x32 +#define IOAT_VER_3_3 0x33 + typedef void *bus_dmaengine_t; struct bus_dmadesc; typedef void (*bus_dmaengine_callback_t)(void *arg, int error); @@ -60,6 +68,9 @@ bus_dmaengine_t ioat_get_dmaengine(uint3 /* Release the DMA channel */ void ioat_put_dmaengine(bus_dmaengine_t dmaengine); +/* Check the DMA engine's HW version */ +int ioat_get_hwversion(bus_dmaengine_t dmaengine); + /* * Set interrupt coalescing on a DMA channel. * Modified: head/sys/dev/ioat/ioat_hw.h ============================================================================== --- head/sys/dev/ioat/ioat_hw.h Thu Dec 17 23:13:04 2015 (r292412) +++ head/sys/dev/ioat/ioat_hw.h Thu Dec 17 23:21:37 2015 (r292413) @@ -46,9 +46,6 @@ __FBSDID("$FreeBSD$"); #define IOAT_CBVER_OFFSET 0x08 -#define IOAT_VER_3_0 0x30 -#define IOAT_VER_3_3 0x33 - #define IOAT_INTRDELAY_OFFSET 0x0C #define IOAT_INTRDELAY_SUPPORTED (1 << 15) /* Reserved. (1 << 14) */ From owner-svn-src-all@freebsd.org Thu Dec 17 23:26:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CAB2A4A245 for ; Thu, 17 Dec 2015 23:26:56 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F31D51F1F for ; Thu, 17 Dec 2015 23:26:55 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22a.google.com with SMTP id l126so43128977wml.1 for ; Thu, 17 Dec 2015 15:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=nwbocApcSM4zBDiyxwoGdlw8qNodSF+H6U9HCaXQUOg=; b=v43ThWbK5BmjNAkjhLt1ZeMKpHdtR02Cr7pmXpJYpFkqpbnmrul9CD2XDjAUDMaEpY 4q3YkAaZqJyKu52FlkIJuV8LMO/dD0Czqgrr0VyZOVJQ0rmvRaXd9ng/UmRc3mB50mHx U1gpvU+CpyB3B6++dGKBtzwJtqYyrcwisLIlLu+XgJSsjHjN+oCqFxacwe8rjnTrDPqU uGn1oXn4OBBUG926inWEihaFZt3a2BR1zMmfeBhOFYgAe8h26yp4W2XmiDkpUYBWRnre Ta2BxaunVWbhwSVUsNUQOfu24mODbStTo6hpwYkl2Ad25sQwDn+2ydBcacXj9RZMPZjY KfLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=nwbocApcSM4zBDiyxwoGdlw8qNodSF+H6U9HCaXQUOg=; b=B4vmsGXpI/Lma3tWYNT82+hAIKl5CIaAt9IIV8CO0/EYY9ezSKGJ+IrA1RUNvETKVm n0vA1EIWTq4FP2aJ3nndJgKSDSILusAT7lNL9r9rEqN41UTjoPxhXzpiAetHqCsPUi30 ul5gQLbCCXC0YqsOodxNtWoFMB+mS9epEqmuZLctzdFKahQuOEigAG5fzZ46jh+0HXM6 YS2cJXgEyoQAqcPJ1DIr2KshqXMBIpSDQAKZIIAyorBUa8mNVLwozgUQrKR60PGkGDnI OjCHDSxwqtM4nVdU36uZYgIs79SEKp0zsRmVTllS5MWQgeWMYx3AQg9eVcnD3A4F/J24 nBuQ== X-Gm-Message-State: ALoCoQm3SyRJ/SXvQF4VmZ1zN4WLsiIfH7YG0wNn9jQsADPIhjEOAZ2bXtBUZfyx65wgwVVYMzRoIG5CIQixUe0y5EDv9tgMcQ== X-Received: by 10.194.117.228 with SMTP id kh4mr345610wjb.171.1450394813663; Thu, 17 Dec 2015 15:26:53 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id u205sm4293769wmb.12.2015.12.17.15.26.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 15:26:52 -0800 (PST) Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 To: Gleb Smirnoff References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> <20151217191630.GL42340@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Steven Hartland Message-ID: <567344BC.20501@multiplay.co.uk> Date: Thu, 17 Dec 2015 23:26:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151217191630.GL42340@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 23:26:56 -0000 On 17/12/2015 19:16, Gleb Smirnoff wrote: > Steven, > > On Thu, Dec 17, 2015 at 02:29:02PM +0000, Steven Hartland wrote: > S> I would definitely like to understand more about your concerns and learn > S> from > S> your knowledge in this area, so thanks for that offer, and while it does > S> sound > S> unforgiving I totally understand where you're coming from. > S> > S> Hopefully together we can bring this to a satisfactory conclusion as I > S> would hate > S> for both carp and lagg to stay as broken, 2 years is long enough :D > > Ok, let's get technical. CARP and LAGG were not broken for 2 years. They > were working very well in the way they were designed to work. The setup > in the bug 156226 was broken initially. You may have not read all the detail in the review so you might not have noticed that I identified that carp IPv6 NA was broken by r251584 which was committed 2 1/2 years ago. I'm guessing not may people use it for IPv6. > The "link aggregation" itself refers to an aggregation of links between > two logical devices. If you build lagg(4) interface on top of two ports > that are plugged into different switches, you are calling for trouble. While multiple switches complicates the matter its not the only issue as you can reproduce this with a single switch and two nics in LAGG failover mode with a simple ifconfig down. At this point any traffic entering the switch for LAGG member will back-whole instead of being received by the other nic. It is much more common in networking now to have multiple physical switches configured as part of bigger logical devices using protocols such as MLAG, which is what we're using with Cisco's and Arista's, so not some cheepo network ;-) > All comments in the 156226 from Eugene Grosbein are valid. I would not > repeat them, but ask you to reread them in bugzilla. There was a good > reason why for 2 years committers stayed away from this "bug" and related > patch. Yes but not confuse the different types, we're talking specifically about failover mode here which has no special configuration hence its reliant on the OS implementation only. > Nevertheless, someone wants to give a kick to this initially broken > network design and run it somehow. And this "somehow" implies Layer2 > upcalling into upper layers to do something, since there is no > established standard layer2 heartbeat packet. I have chatted with > networking gurus at my job, and they said, that they don't know > any decent network equipment that supports such setup. However, they > noticed that Windows is capable for such failover. I haven't yet > learned on how Windows solves the problem. Actually, those who > pushed committing 156226 should have done these investigations. > Probably Windows does exactly the same, sends gratutious ARP or > its IPv6 analog. Or may be does something better like sending > useless L2 datagram, but with a proper source hardware address. Actually our testing here showed both Windows and Linux worked as expected and from my reading doing the GARP / UNA is actually expected in this situation, for this very reason. > Okay, what if we want same in FreeBSD as in Windows? Should we do the > following list of evil things: > > - put DELAY in context of callout(or in context of any network processing) > - introduce new notions of a link state, or new KPI for link handling > Note that link handling KPI was stable for iver 10 years and satisfied > all the different types of interfaces we support > - create new interface methods > - call into address families supplying an ifnet that doesn't have this AF > instantiated, and then to fix immediate panic putting there a kludge > of "if (foo == NULL) return;" > - etc... > > Sorry, I'm putting "etc" here, because tires on details. You would agree > that the whole process of fixing the "bug" was overcoming the problems > that the network stack is not designed for the things that you are > willing to do. Won't you agree? I am indeed trying to produce feature parity, to prevent the powers that be throwing FreeBSD out as the only OS which fails to work as expected in failover mode, even in the simple case as described above. Yes we could apply user land work around but then everyone has to be aware its need and to set it up which doesn't sound like the best solution. > Or should we just write a tiny program, that would observe state of > networking ports, and if a port changes state then send a tiny packet > as a bpf(4) write? This could be done but still means our lagg failover doesn't do what people would expect. I'd like to step back for a second and get you feedback on the changes that where reverted, which didn't have the DELAY in the callout. What where the issues as you saw them? So we don't spam people any more I've reopened the review so we can take this there: https://reviews.freebsd.org/D4111 Apologies if these are very obvious to others but clearly those involved with this didn't spot them so it would be really nice to learn from this. Regards Steve From owner-svn-src-all@freebsd.org Thu Dec 17 23:46:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E59A4AE82; Thu, 17 Dec 2015 23:46:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 D15711A50; Thu, 17 Dec 2015 23:46:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBHNkVp1052613 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 18 Dec 2015 02:46:31 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBHNkUJU052612; Fri, 18 Dec 2015 02:46:30 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 18 Dec 2015 02:46:30 +0300 From: Gleb Smirnoff To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 Message-ID: <20151217234630.GX42340@FreeBSD.org> References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> <20151217191630.GL42340@FreeBSD.org> <567344BC.20501@multiplay.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <567344BC.20501@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 23:46:40 -0000 On Thu, Dec 17, 2015 at 11:26:52PM +0000, Steven Hartland wrote: S> You may have not read all the detail in the review so you might not have S> noticed that I S> identified that carp IPv6 NA was broken by r251584 which was committed 2 1/2 S> years ago. I'm guessing not may people use it for IPv6. My suggestion is to look at this regression separated from the lagg failover and fix it separately. S> > The "link aggregation" itself refers to an aggregation of links between S> > two logical devices. If you build lagg(4) interface on top of two ports S> > that are plugged into different switches, you are calling for trouble. S> S> While multiple switches complicates the matter its not the only issue as S> you can S> reproduce this with a single switch and two nics in LAGG failover mode S> with a simple S> ifconfig down. At this point any traffic entering the switch for S> LAGG member S> will back-whole instead of being received by the other nic. S> S> It is much more common in networking now to have multiple physical switches S> configured as part of bigger logical devices using protocols such as S> MLAG, which is S> what we're using with Cisco's and Arista's, so not some cheepo network ;-) Right, you are confirming what I said above. Multiple physical devices, but still one logical on each side of lagg. S> > Nevertheless, someone wants to give a kick to this initially broken S> > network design and run it somehow. And this "somehow" implies Layer2 S> > upcalling into upper layers to do something, since there is no S> > established standard layer2 heartbeat packet. I have chatted with S> > networking gurus at my job, and they said, that they don't know S> > any decent network equipment that supports such setup. However, they S> > noticed that Windows is capable for such failover. I haven't yet S> > learned on how Windows solves the problem. Actually, those who S> > pushed committing 156226 should have done these investigations. S> > Probably Windows does exactly the same, sends gratutious ARP or S> > its IPv6 analog. Or may be does something better like sending S> > useless L2 datagram, but with a proper source hardware address. S> Actually our testing here showed both Windows and Linux worked as S> expected and S> from my reading doing the GARP / UNA is actually expected in this S> situation, for this very reason. Is it possible for you to sniff the traffic and see what actually happens in there? My expectations are the same, but want to be sure. S> I'd like to step back for a second and get you feedback on the changes S> that where S> reverted, which didn't have the DELAY in the callout. What where the S> issues as you S> saw them? So we don't spam people any more I've reopened the review so S> we can S> take this there: https://reviews.freebsd.org/D4111 Before going into implementation, can we first settle on the protocol? Could be that GARP/NA is the only solution there, but let's be sure first. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Dec 18 00:33:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56DB4A4A87A; Fri, 18 Dec 2015 00:33:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 271A81279; Fri, 18 Dec 2015 00:33:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI0X3It061459; Fri, 18 Dec 2015 00:33:03 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI0X3GE061458; Fri, 18 Dec 2015 00:33:03 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201512180033.tBI0X3GE061458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 18 Dec 2015 00:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292415 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 00:33:04 -0000 Author: jamie Date: Fri Dec 18 00:33:03 2015 New Revision: 292415 URL: https://svnweb.freebsd.org/changeset/base/292415 Log: MFC r292277: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 Modified: stable/9/sys/kern/kern_jail.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_jail.c ============================================================================== --- stable/9/sys/kern/kern_jail.c Thu Dec 17 23:41:58 2015 (r292414) +++ stable/9/sys/kern/kern_jail.c Fri Dec 18 00:33:03 2015 (r292415) @@ -1526,11 +1526,14 @@ kern_jail_set(struct thread *td, struct #endif onamelen = namelen = 0; if (name != NULL) { - /* Give a default name of the jid. */ + /* Give a default name of the jid. Also allow the name to be + * explicitly the jid - but not any other number, and only in + * normal form (no leading zero/etc). + */ if (name[0] == '\0') snprintf(name = numbuf, sizeof(numbuf), "%d", jid); - else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid && - *p == '\0')) { + else if ((strtoul(namelc, &p, 10) != jid || + namelc[0] < '1' || namelc[0] > '9') && *p == '\0') { error = EINVAL; vfs_opterror(opts, "name cannot be numeric (unless it is the jid)"); From owner-svn-src-all@freebsd.org Fri Dec 18 00:33:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5FE2A4A88B; Fri, 18 Dec 2015 00:33:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6855127E; Fri, 18 Dec 2015 00:33:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI0X40f061519; Fri, 18 Dec 2015 00:33:04 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI0X4NM061518; Fri, 18 Dec 2015 00:33:04 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201512180033.tBI0X4NM061518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 18 Dec 2015 00:33: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: r292416 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 00:33:06 -0000 Author: jamie Date: Fri Dec 18 00:33:04 2015 New Revision: 292416 URL: https://svnweb.freebsd.org/changeset/base/292416 Log: MFC r292277: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 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 Fri Dec 18 00:33:03 2015 (r292415) +++ stable/10/sys/kern/kern_jail.c Fri Dec 18 00:33:04 2015 (r292416) @@ -1585,11 +1585,14 @@ kern_jail_set(struct thread *td, struct #endif onamelen = namelen = 0; if (name != NULL) { - /* Give a default name of the jid. */ + /* Give a default name of the jid. Also allow the name to be + * explicitly the jid - but not any other number, and only in + * normal form (no leading zero/etc). + */ if (name[0] == '\0') snprintf(name = numbuf, sizeof(numbuf), "%d", jid); - else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid && - *p == '\0')) { + else if ((strtoul(namelc, &p, 10) != jid || + namelc[0] < '1' || namelc[0] > '9') && *p == '\0') { error = EINVAL; vfs_opterror(opts, "name cannot be numeric (unless it is the jid)"); From owner-svn-src-all@freebsd.org Fri Dec 18 00:40:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59743A4AD24; Fri, 18 Dec 2015 00:40:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6A71782; Fri, 18 Dec 2015 00:40:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI0eK86061820; Fri, 18 Dec 2015 00:40:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI0eJ1r061818; Fri, 18 Dec 2015 00:40:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512180040.tBI0eJ1r061818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 00:40: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: r292417 - in stable: 10/share/man/man4 10/sys/kern 9/share/man/man4 9/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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 00:40:21 -0000 Author: jhb Date: Fri Dec 18 00:40:19 2015 New Revision: 292417 URL: https://svnweb.freebsd.org/changeset/base/292417 Log: MFC 290429: When dumping an rman in DDB, include the RID of each resource. Modified: stable/10/share/man/man4/ddb.4 stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man4/ddb.4 stable/9/sys/kern/subr_rman.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/share/man/man4/ddb.4 ============================================================================== --- stable/10/share/man/man4/ddb.4 Fri Dec 18 00:33:04 2015 (r292416) +++ stable/10/share/man/man4/ddb.4 Fri Dec 18 00:40:19 2015 (r292417) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd November 5, 2015 .Dt DDB 4 .Os .Sh NAME @@ -572,8 +572,8 @@ The same as "show pcpu", but for every C .Pp .It Ic show Cm allrman Show information related with resource management, including -interrupt request lines, DMA request lines, I/O ports and I/O memory -addresses. +interrupt request lines, DMA request lines, I/O ports, I/O memory +addresses, and Resource IDs. .\" .Pp .It Ic show Cm apic Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Fri Dec 18 00:33:04 2015 (r292416) +++ stable/10/sys/kern/subr_rman.c Fri Dec 18 00:40:19 2015 (r292417) @@ -1052,7 +1052,8 @@ dump_rman(struct rman *rm) devname = "nomatch"; } else devname = NULL; - db_printf(" 0x%lx-0x%lx ", r->r_start, r->r_end); + db_printf(" 0x%lx-0x%lx (RID=%d) ", + r->r_start, r->r_end, r->r_rid); if (devname != NULL) db_printf("(%s)\n", devname); else From owner-svn-src-all@freebsd.org Fri Dec 18 00:40:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0B4DA4AD28; Fri, 18 Dec 2015 00:40:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6346B1783; Fri, 18 Dec 2015 00:40:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI0eK12061827; Fri, 18 Dec 2015 00:40:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI0eKqi061825; Fri, 18 Dec 2015 00:40:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512180040.tBI0eKqi061825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 00:40:20 +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: r292417 - in stable: 10/share/man/man4 10/sys/kern 9/share/man/man4 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 00:40:21 -0000 Author: jhb Date: Fri Dec 18 00:40:19 2015 New Revision: 292417 URL: https://svnweb.freebsd.org/changeset/base/292417 Log: MFC 290429: When dumping an rman in DDB, include the RID of each resource. Modified: stable/9/share/man/man4/ddb.4 stable/9/sys/kern/subr_rman.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man4/ddb.4 stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man4/ddb.4 ============================================================================== --- stable/9/share/man/man4/ddb.4 Fri Dec 18 00:33:04 2015 (r292416) +++ stable/9/share/man/man4/ddb.4 Fri Dec 18 00:40:19 2015 (r292417) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2011 +.Dd November 5, 2015 .Dt DDB 4 .Os .Sh NAME @@ -570,8 +570,8 @@ The same as "show pcpu", but for every C .Pp .It Ic show Cm allrman Show information related with resource management, including -interrupt request lines, DMA request lines, I/O ports and I/O memory -addresses. +interrupt request lines, DMA request lines, I/O ports, I/O memory +addresses, and Resource IDs. .\" .Pp .It Ic show Cm apic Modified: stable/9/sys/kern/subr_rman.c ============================================================================== --- stable/9/sys/kern/subr_rman.c Fri Dec 18 00:33:04 2015 (r292416) +++ stable/9/sys/kern/subr_rman.c Fri Dec 18 00:40:19 2015 (r292417) @@ -1047,7 +1047,8 @@ dump_rman(struct rman *rm) devname = "nomatch"; } else devname = NULL; - db_printf(" 0x%lx-0x%lx ", r->r_start, r->r_end); + db_printf(" 0x%lx-0x%lx (RID=%d) ", + r->r_start, r->r_end, r->r_rid); if (devname != NULL) db_printf("(%s)\n", devname); else From owner-svn-src-all@freebsd.org Fri Dec 18 01:03:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E322EA4BA50; Fri, 18 Dec 2015 01:03:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5787156E; Fri, 18 Dec 2015 01:03:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI13YlH070414; Fri, 18 Dec 2015 01:03:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI13YjH070413; Fri, 18 Dec 2015 01:03:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512180103.tBI13YjH070413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 01:03: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: r292418 - in stable: 10/share/man/man9 9/share/man/man9 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 01:03:36 -0000 Author: jhb Date: Fri Dec 18 01:03:34 2015 New Revision: 292418 URL: https://svnweb.freebsd.org/changeset/base/292418 Log: MFC 292038: Fix a copy and paste bug when this page was first written by copying from BUS_BIND_INTR.9. Modified: stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 ============================================================================== --- stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Fri Dec 18 00:40:19 2015 (r292417) +++ stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Fri Dec 18 01:03:34 2015 (r292418) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd December 9, 2015 .Dt BUS_DESCRIBE_INTR 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .In sys/param.h .In sys/bus.h .Ft int -.Fo BUS_BIND_INTR +.Fo BUS_DESCRIBE_INTR .Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie" .Fa "const char *descr" .Fc From owner-svn-src-all@freebsd.org Fri Dec 18 01:03:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A3F7A4BA54; Fri, 18 Dec 2015 01:03:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 166EF1572; Fri, 18 Dec 2015 01:03:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI13Zmn070420; Fri, 18 Dec 2015 01:03:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI13Z9a070419; Fri, 18 Dec 2015 01:03:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512180103.tBI13Z9a070419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 01:03:35 +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: r292418 - in stable: 10/share/man/man9 9/share/man/man9 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 01:03:36 -0000 Author: jhb Date: Fri Dec 18 01:03:34 2015 New Revision: 292418 URL: https://svnweb.freebsd.org/changeset/base/292418 Log: MFC 292038: Fix a copy and paste bug when this page was first written by copying from BUS_BIND_INTR.9. Modified: stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/9/share/man/man9/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 ============================================================================== --- stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 Fri Dec 18 00:40:19 2015 (r292417) +++ stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 Fri Dec 18 01:03:34 2015 (r292418) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd December 9, 2015 .Dt BUS_DESCRIBE_INTR 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .In sys/param.h .In sys/bus.h .Ft int -.Fo BUS_BIND_INTR +.Fo BUS_DESCRIBE_INTR .Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie" .Fa "const char *descr" .Fc From owner-svn-src-all@freebsd.org Fri Dec 18 01:25:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7629FA4A679; Fri, 18 Dec 2015 01:25:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45ABE133D; Fri, 18 Dec 2015 01:25:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI1PUuZ076696; Fri, 18 Dec 2015 01:25:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI1PUnZ076695; Fri, 18 Dec 2015 01:25:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512180125.tBI1PUnZ076695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 18 Dec 2015 01:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292419 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 01:25:31 -0000 Author: ian Date: Fri Dec 18 01:25:30 2015 New Revision: 292419 URL: https://svnweb.freebsd.org/changeset/base/292419 Log: Fix the clock divisor calc for imx6 sdcard bus speed. I don't know what alternate universe I was inhabiting when I wrote it originally, but apparently the basic workings of mathematics were different than in this universe. I also can't explain how it ever worked, except "by accident", because completely bogus values were being written into the divisor register. Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Fri Dec 18 01:03:34 2015 (r292418) +++ head/sys/arm/freescale/imx/imx_sdhci.c Fri Dec 18 01:25:30 2015 (r292419) @@ -522,12 +522,19 @@ imx_sdhc_set_clock(struct imx_sdhci_soft else freq = sc->baseclk_hz / (2 * divisor); - for (prescale = 2; prescale < freq / prescale / 16;) + for (prescale = 2; freq < sc->baseclk_hz / (prescale * 16);) prescale <<= 1; - for (divisor = 1; freq < freq / prescale / divisor;) + for (divisor = 1; freq < sc->baseclk_hz / (prescale * divisor);) ++divisor; +#ifdef DEBUG + device_printf(sc->dev, + "desired SD freq: %d, actual: %d; base %d prescale %d divisor %d\n", + freq, sc->baseclk_hz / (prescale * divisor), sc->baseclk_hz, + prescale, divisor); +#endif + prescale >>= 1; divisor -= 1; From owner-svn-src-all@freebsd.org Fri Dec 18 01:32:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA703A4ABDA; Fri, 18 Dec 2015 01:32:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B655B1A4F; Fri, 18 Dec 2015 01:32:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI1WhiA079406; Fri, 18 Dec 2015 01:32:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI1WhIk079405; Fri, 18 Dec 2015 01:32:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512180132.tBI1WhIk079405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 18 Dec 2015 01:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292420 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 01:32:45 -0000 Author: ian Date: Fri Dec 18 01:32:43 2015 New Revision: 292420 URL: https://svnweb.freebsd.org/changeset/base/292420 Log: Flag sysctl hw.mmc.debug as a tunable, since often you want to debug the bus probing during system startup. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Fri Dec 18 01:25:30 2015 (r292419) +++ head/sys/dev/mmc/mmc.c Fri Dec 18 01:32:43 2015 (r292420) @@ -118,7 +118,7 @@ struct mmc_ivars { static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); static int mmc_debug; -SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level"); +SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, &mmc_debug, 0, "Debug level"); /* bus entry points */ static int mmc_acquire_bus(device_t busdev, device_t dev); From owner-svn-src-all@freebsd.org Fri Dec 18 01:44:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3484CA4B2AE; Fri, 18 Dec 2015 01:44:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE7081380; Fri, 18 Dec 2015 01:44:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI1i33w082397; Fri, 18 Dec 2015 01:44:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI1i3ev082396; Fri, 18 Dec 2015 01:44:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180144.tBI1i3ev082396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 01:44: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: r292421 - stable/10/usr.sbin/crunch/crunchide 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 01:44:05 -0000 Author: emaste Date: Fri Dec 18 01:44:03 2015 New Revision: 292421 URL: https://svnweb.freebsd.org/changeset/base/292421 Log: Sync crunchide(1) arch support with HEAD MFC r276764, r281781, r282291, r292106 Add support to crunchide for handling AArch64 (arm64) ELF files. Remove local EM_* ELF definitions provided by system ELF headers Restore local EM_AARCH64 constant for bootstrapping Add RISC-V to supported machine types Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 01:32:43 2015 (r292420) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 01:44:03 2015 (r292421) @@ -175,37 +175,20 @@ ELFNAMEEND(check)(int fd, const char *fn switch (xe16toh(eh.e_machine)) { case EM_386: break; case EM_ALPHA: break; -#ifndef EM_ARM -#define EM_ARM 40 +#ifndef EM_AARCH64 +#define EM_AARCH64 183 #endif + case EM_AARCH64: break; case EM_ARM: break; -#ifndef EM_MIPS -#define EM_MIPS 8 -#endif -#ifndef EM_MIPS_RS4_BE /* same as EM_MIPS_RS3_LE */ -#define EM_MIPS_RS4_BE 10 -#endif case EM_MIPS: break; case /* EM_MIPS_RS3_LE */ EM_MIPS_RS4_BE: break; -#ifndef EM_IA_64 -#define EM_IA_64 50 -#endif - case EM_IA_64: break; -#ifndef EM_PPC -#define EM_PPC 20 -#endif case EM_PPC: break; -#ifndef EM_PPC64 -#define EM_PPC64 21 -#endif case EM_PPC64: break; -#ifndef EM_SPARCV9 -#define EM_SPARCV9 43 +#ifndef EM_RISCV +#define EM_RISCV 243 #endif + case EM_RISCV: break; case EM_SPARCV9: break; -#ifndef EM_X86_64 -#define EM_X86_64 62 -#endif case EM_X86_64: break; /* ELFDEFNNAME(MACHDEP_ID_CASES) */ From owner-svn-src-all@freebsd.org Fri Dec 18 02:34:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58BACA4AE62; Fri, 18 Dec 2015 02:34:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7001300; Fri, 18 Dec 2015 02:34:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI2Y2FQ097166; Fri, 18 Dec 2015 02:34:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI2Y1Bl097163; Fri, 18 Dec 2015 02:34:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180234.tBI2Y1Bl097163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 02:34: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: r292422 - stable/10/usr.sbin/crunch/crunchide 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 02:34:03 -0000 Author: emaste Date: Fri Dec 18 02:34:01 2015 New Revision: 292422 URL: https://svnweb.freebsd.org/changeset/base/292422 Log: MFC r281655: crunchide: remove unused a.out and non-functional ECOFF support Sponsored by: The FreeBSD Foundation Deleted: stable/10/usr.sbin/crunch/crunchide/exec_aout.c Modified: stable/10/usr.sbin/crunch/crunchide/Makefile stable/10/usr.sbin/crunch/crunchide/crunchide.c stable/10/usr.sbin/crunch/crunchide/extern.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 01:44:03 2015 (r292421) +++ stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 02:34:01 2015 (r292422) @@ -5,11 +5,6 @@ SRCS= crunchide.c TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == i386 && ${MACHINE_ARCH} == i386 -CFLAGS+=-DNLIST_AOUT -SRCS+= exec_aout.c -.endif - .if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 || \ ${TARGET_ARCH:Mmips64*} Modified: stable/10/usr.sbin/crunch/crunchide/crunchide.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/crunchide.c Fri Dec 18 01:44:03 2015 (r292421) +++ stable/10/usr.sbin/crunch/crunchide/crunchide.c Fri Dec 18 02:34:01 2015 (r292422) @@ -212,12 +212,6 @@ struct { int (*check)(int, const char *); /* 1 if match, zero if not */ int (*hide)(int, const char *); /* non-zero if error */ } exec_formats[] = { -#ifdef NLIST_AOUT - { "a.out", check_aout, hide_aout, }, -#endif -#ifdef NLIST_ECOFF - { "ECOFF", check_elf64, hide_elf64, }, -#endif #ifdef NLIST_ELF32 { "ELF32", check_elf32, hide_elf32, }, #endif Modified: stable/10/usr.sbin/crunch/crunchide/extern.h ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/extern.h Fri Dec 18 01:44:03 2015 (r292421) +++ stable/10/usr.sbin/crunch/crunchide/extern.h Fri Dec 18 02:34:01 2015 (r292422) @@ -31,14 +31,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef NLIST_AOUT -int check_aout(int, const char *); -int hide_aout(int, const char *); -#endif -#ifdef NLIST_ECOFF -int check_ecoff(int, const char *); -int hide_ecoff(int, const char *); -#endif #ifdef NLIST_ELF32 int check_elf32(int, const char *); int hide_elf32(int, const char *); From owner-svn-src-all@freebsd.org Fri Dec 18 03:06:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1E5A4BEF1; Fri, 18 Dec 2015 03:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD531950; Fri, 18 Dec 2015 03:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI36dvh006699; Fri, 18 Dec 2015 03:06:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI36d84006697; Fri, 18 Dec 2015 03:06:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180306.tBI36d84006697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 03:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292423 - stable/10/usr.sbin/crunch/crunchide 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 03:06:40 -0000 Author: emaste Date: Fri Dec 18 03:06:39 2015 New Revision: 292423 URL: https://svnweb.freebsd.org/changeset/base/292423 Log: MFC r281674: crunchide: always include both 32- and 64-bit ELF support This avoids the need to build a target-specific crunchide for cross- builds. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/crunch/crunchide/Makefile stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 02:34:01 2015 (r292422) +++ stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 03:06:39 2015 (r292423) @@ -1,19 +1,9 @@ # $FreeBSD$ PROG= crunchide -SRCS= crunchide.c +SRCS= crunchide.c exec_elf32.c exec_elf64.c -TARGET_ARCH?= ${MACHINE_ARCH} - -.if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ - ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 || \ - ${TARGET_ARCH:Mmips64*} -CFLAGS+=-DNLIST_ELF64 -SRCS+= exec_elf64.c +CFLAGS+=-DNLIST_ELF32 -DNLIST_ELF64 exec_elf64.o: exec_elf32.c -.else -CFLAGS+=-DNLIST_ELF32 -SRCS+= exec_elf32.c -.endif .include Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 02:34:01 2015 (r292422) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 03:06:39 2015 (r292423) @@ -79,6 +79,9 @@ __FBSDID("$FreeBSD$"); #define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) #define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#ifndef ELFCLASS +#define ELFCLASS CONCAT(ELFCLASS,ELFSIZE) +#endif #define xe16toh(x) ((data == ELFDATA2MSB) ? be16toh(x) : le16toh(x)) #define xe32toh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) @@ -167,7 +170,7 @@ ELFNAMEEND(check)(int fd, const char *fn if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; - if (IS_ELF(eh) == 0) + if (IS_ELF(eh) == 0 || eh.e_ident[EI_CLASS] != ELFCLASS) return 0; data = eh.e_ident[EI_DATA]; From owner-svn-src-all@freebsd.org Fri Dec 18 05:29:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9893DA4A801; Fri, 18 Dec 2015 05:29:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A65218E8; Fri, 18 Dec 2015 05:29:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI5TMo4048520; Fri, 18 Dec 2015 05:29:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI5TM8c048518; Fri, 18 Dec 2015 05:29:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512180529.tBI5TM8c048518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 Dec 2015 05:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292424 - in head/sys: arm/ti dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:29:23 -0000 Author: imp Date: Fri Dec 18 05:29:22 2015 New Revision: 292424 URL: https://svnweb.freebsd.org/changeset/base/292424 Log: Create a simplebus PNP info wrapper. Differential Review: https://reviews.freebsd.org/D4517 Modified: head/sys/arm/ti/aintc.c head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/arm/ti/aintc.c ============================================================================== --- head/sys/arm/ti/aintc.c Fri Dec 18 03:06:39 2015 (r292423) +++ head/sys/arm/ti/aintc.c Fri Dec 18 05:29:22 2015 (r292424) @@ -158,6 +158,7 @@ static devclass_t ti_aintc_devclass; EARLY_DRIVER_MODULE(aintc, simplebus, ti_aintc_driver, ti_aintc_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +SIMPLEBUS_PNP_INFO(compat_data); int arm_get_next_irq(int last_irq) Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Fri Dec 18 03:06:39 2015 (r292423) +++ head/sys/dev/ofw/ofw_bus_subr.h Fri Dec 18 05:29:22 2015 (r292424) @@ -52,6 +52,10 @@ struct ofw_compat_data { uintptr_t ocd_data; }; +#define SIMPLEBUS_PNP_DESCR "Z:compat;P:private;" +#define SIMPLEBUS_PNP_INFO(t) \ + MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); + /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); void ofw_bus_gen_destroy_devinfo(struct ofw_bus_devinfo *); From owner-svn-src-all@freebsd.org Fri Dec 18 05:37:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A34EA4AD38; Fri, 18 Dec 2015 05:37:18 +0000 (UTC) (envelope-from luke.tw@gmail.com) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 412531D26; Fri, 18 Dec 2015 05:37:18 +0000 (UTC) (envelope-from luke.tw@gmail.com) Received: by mail-yk0-x230.google.com with SMTP id x184so46722052yka.3; Thu, 17 Dec 2015 21:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=zxD2aSsakVAkKCaEIRCG1WKc2Lv71ZQqQroybEO5hZw=; b=fdgcpnvuyPRSxhjPHsIWjZ7kryICMJ/8H143NQZbTdvPEHNhAwtfs/n9KmgOZ0pxF5 nNsnbSMlxmTYO+4H1oIHDJFhpGOl4hUpt/ZL1q6f5HS8eNffrsnhijZQw8r0qWv/GUFr pGx46lzw6ztR5oCu7kbZfVAQnj6BPyPLZ2Yjqa+EiZr7wIW+zHdG+xloaT6okijLzsoz T5Vfsfom4gvny6OaFLesIwcPtjOpA7tHOv46JnUfczEY9E0M+crUs4v6b7kOGsNa+0Hg qgcxApXMmNiV+SljMLM97wjt/BmFu/G2O5wiVmcnUGhGhbQ/kQDQP+4F9ytiV6JM5gso GT5w== X-Received: by 10.13.198.199 with SMTP id i190mr1281946ywd.255.1450417036827; Thu, 17 Dec 2015 21:37:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.16.6 with HTTP; Thu, 17 Dec 2015 21:36:47 -0800 (PST) In-Reply-To: <201512172042.tBHKg5bM091931@repo.freebsd.org> References: <201512172042.tBHKg5bM091931@repo.freebsd.org> From: luke Date: Fri, 18 Dec 2015 13:36:47 +0800 Message-ID: Subject: Re: svn commit: r292410 - head/usr.sbin/boot0cfg To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:37:18 -0000 On Fri, Dec 18, 2015 at 4:42 AM, John Baldwin wrote: > Author: jhb > Date: Thu Dec 17 20:42:05 2015 > New Revision: 292410 > URL: https://svnweb.freebsd.org/changeset/base/292410 > > Log: > Exit cleanly if malloc() fails to allocate a buffer for a copy of the > current MBR. > > PR: 205322 > Submitted by: Alexander Kuleshov > MFC after: 1 week > > Modified: > head/usr.sbin/boot0cfg/boot0cfg.c > > Modified: head/usr.sbin/boot0cfg/boot0cfg.c > > ============================================================================== > --- head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:33:20 2015 > (r292409) > +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:42:05 2015 > (r292410) > @@ -337,6 +337,8 @@ read_mbr(const char *disk, u_int8_t **mb > return (mbr_size); > } > *mbr = malloc(sizeof(buf)); > + if (mbr == NULL) > + errx(1, "%s: unable to allocate MBR buffer", disk); > memcpy(*mbr, buf, sizeof(buf)); > close(fd); > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > Hi, Should the check be against *mbr ? + if (*mbr == NULL) + errx(1, "%s: unable to allocate MBR buffer", disk); -- Luke Chang-Hsien Tsai From owner-svn-src-all@freebsd.org Fri Dec 18 05:39:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CF6BA4AEF2; Fri, 18 Dec 2015 05:39:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55CD31EC8; Fri, 18 Dec 2015 05:39:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI5dP4S051440; Fri, 18 Dec 2015 05:39:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI5dPpQ051437; Fri, 18 Dec 2015 05:39:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512180539.tBI5dPpQ051437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 Dec 2015 05:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292425 - in head/sys: geom/sched modules/geom/geom_sched modules/geom/geom_sched/gsched_delay X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:39:26 -0000 Author: imp Date: Fri Dec 18 05:39:25 2015 New Revision: 292425 URL: https://svnweb.freebsd.org/changeset/base/292425 Log: Scheduling module to introduce a fixed delay into the I/O path. Added: head/sys/geom/sched/gs_delay.c (contents, props changed) head/sys/modules/geom/geom_sched/gsched_delay/ head/sys/modules/geom/geom_sched/gsched_delay/Makefile (contents, props changed) Modified: head/sys/modules/geom/geom_sched/Makefile Added: head/sys/geom/sched/gs_delay.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/sched/gs_delay.c Fri Dec 18 05:39:25 2015 (r292425) @@ -0,0 +1,265 @@ +/*- + * Copyright (c) 2015 Netflix, Inc. + * + * Derived from gs_rr.c: + * Copyright (c) 2009-2010 Fabio Checconi + * Copyright (c) 2009-2010 Luigi Rizzo, Universita` di Pisa + * 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. + */ + +/* + * $Id$ + * $FreeBSD$ + * + * A simple scheduler that just delays certain transactions by a certain + * amount. We collect all the transactions that are 'done' and put them on + * a queue. The queue is run through every so often and the transactions that + * have taken longer than the threshold delay are completed. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "gs_scheduler.h" + +/* Useful constants */ +#define BTFRAC_1US 18446744073709ULL /* 2^64 / 1000000 */ + +/* list of scheduler instances */ +LIST_HEAD(g_scheds, g_delay_softc); + +/* + * Per device descriptor, holding the Round Robin list of queues + * accessing the disk, a reference to the geom, and the timer. + */ +struct g_delay_softc { + struct g_geom *sc_geom; + + struct bio_queue_head sc_bioq; /* queue of pending requests */ + struct callout sc_wait; /* timer for completing with delays */ + + /* Statistics */ + int sc_in_flight; /* requests in the driver */ +}; + +/* + * parameters, config and stats + */ +struct g_delay_params { + uint64_t io; + int bypass; /* bypass scheduling */ + int units; /* how many instances */ + int latency; /* How big a latncy are hoping for */ +}; + +static struct g_delay_params me = { + .bypass = 0, + .units = 0, + .latency = 0, + .io = 0, +}; +struct g_delay_params *gs_delay_me = &me; + +SYSCTL_DECL(_kern_geom_sched); +static SYSCTL_NODE(_kern_geom_sched, OID_AUTO, delay, CTLFLAG_RW, 0, + "GEOM_SCHED DELAY stuff"); +SYSCTL_INT(_kern_geom_sched_delay, OID_AUTO, bypass, CTLFLAG_RD, + &me.bypass, 0, "Scheduler bypass"); +SYSCTL_INT(_kern_geom_sched_delay, OID_AUTO, units, CTLFLAG_RD, + &me.units, 0, "Scheduler instances"); +SYSCTL_INT(_kern_geom_sched_delay, OID_AUTO, latency, CTLFLAG_RW, + &me.latency, 0, "Minimum latency for requests, in microseconds (1/hz resolution)"); +SYSCTL_QUAD(_kern_geom_sched_delay, OID_AUTO, io, CTLFLAG_RW, + &me.io, 0, "I/Os delayed\n"); + +static int +g_delay_init_class(void *data, void *priv) +{ + return (0); +} + +static void +g_delay_fini_class(void *data, void *priv) +{ +} + +/* + * Called on a request arrival, timeout or completion. + * Try to serve a request among those queued. + */ +static struct bio * +g_delay_next(void *data, int force) +{ + struct g_delay_softc *sc = data; + struct bio *bp; + struct bintime bt; + + bp = bioq_first(&sc->sc_bioq); + if (bp == NULL) + return (NULL); + + /* + * If the time isn't yet ripe for this bp to be let loose, + * then the time isn't ripe for any of its friends either + * since we insert in-order. Terminate if the bio hasn't + * aged appropriately. Note that there's pathology here + * such that we may be up to one tick early in releasing + * this I/O. We could implement this up to a tick late too + * but choose not to. + */ + getbinuptime(&bt); /* BIO's bio_t0 is uptime */ + if (bintime_cmp(&bp->bio_t0, &bt, >)) + return (NULL); + me.io++; + + /* + * The bp has mellowed enough, let it through and update stats. + * If there's others, we'll catch them next time we get called. + */ + sc->sc_in_flight++; + + bp = bioq_takefirst(&sc->sc_bioq); + return (bp); +} + +/* + * Called when a real request for disk I/O arrives. + * Locate the queue associated with the client. + * If the queue is the one we are anticipating for, reset its timeout; + * if the queue is not in the round robin list, insert it in the list. + * On any error, do not queue the request and return -1, the caller + * will take care of this request. + */ +static int +g_delay_start(void *data, struct bio *bp) +{ + struct g_delay_softc *sc = data; + + if (me.bypass) + return (-1); /* bypass the scheduler */ + + bp->bio_caller1 = sc; + getbinuptime(&bp->bio_t0); /* BIO's bio_t0 is uptime */ + bintime_addx(&bp->bio_t0, BTFRAC_1US * me.latency); + + /* + * Keep the I/Os ordered. Lower layers will reorder as we release them down. + * We rely on this in g_delay_next() so that we delay all things equally. Even + * if we move to multiple queues to push stuff down the stack, we'll want to + * insert in order and let the lower layers do whatever reordering they want. + */ + bioq_insert_tail(&sc->sc_bioq, bp); + + return (0); +} + +static void +g_delay_timeout(void *data) +{ + struct g_delay_softc *sc = data; + + g_sched_lock(sc->sc_geom); + g_sched_dispatch(sc->sc_geom); + g_sched_unlock(sc->sc_geom); + callout_reset(&sc->sc_wait, 1, g_delay_timeout, sc); +} + +/* + * Module glue: allocate descriptor, initialize its fields. + */ +static void * +g_delay_init(struct g_geom *geom) +{ + struct g_delay_softc *sc; + + /* XXX check whether we can sleep */ + sc = malloc(sizeof *sc, M_GEOM_SCHED, M_NOWAIT | M_ZERO); + sc->sc_geom = geom; + bioq_init(&sc->sc_bioq); + callout_init(&sc->sc_wait, CALLOUT_MPSAFE); + callout_reset(&sc->sc_wait, 1, g_delay_timeout, sc); + me.units++; + + return (sc); +} + +/* + * Module glue -- drain the callout structure, destroy the + * hash table and its element, and free the descriptor. + */ +static void +g_delay_fini(void *data) +{ + struct g_delay_softc *sc = data; + + /* We're force drained before getting here */ + + /* Kick out timers */ + callout_drain(&sc->sc_wait); + me.units--; + free(sc, M_GEOM_SCHED); +} + +/* + * Called when the request under service terminates. + * Start the anticipation timer if needed. + */ +static void +g_delay_done(void *data, struct bio *bp) +{ + struct g_delay_softc *sc = data; + + sc->sc_in_flight--; + + g_sched_dispatch(sc->sc_geom); +} + +static void +g_delay_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, + struct g_consumer *cp, struct g_provider *pp) +{ +} + +static struct g_gsched g_delay = { + .gs_name = "delay", + .gs_priv_size = 0, + .gs_init = g_delay_init, + .gs_fini = g_delay_fini, + .gs_start = g_delay_start, + .gs_done = g_delay_done, + .gs_next = g_delay_next, + .gs_dumpconf = g_delay_dumpconf, + .gs_init_class = g_delay_init_class, + .gs_fini_class = g_delay_fini_class, +}; + +DECLARE_GSCHED_MODULE(delay, &g_delay); Modified: head/sys/modules/geom/geom_sched/Makefile ============================================================================== --- head/sys/modules/geom/geom_sched/Makefile Fri Dec 18 05:29:22 2015 (r292424) +++ head/sys/modules/geom/geom_sched/Makefile Fri Dec 18 05:39:25 2015 (r292425) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= gs_sched gsched_rr +SUBDIR= gs_sched gsched_rr gsched_delay .include Added: head/sys/modules/geom/geom_sched/gsched_delay/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/geom/geom_sched/gsched_delay/Makefile Fri Dec 18 05:39:25 2015 (r292425) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +KMOD= gsched_delay +SRCS= gs_delay.c + +# ../Makefile.inc automatically included +.include From owner-svn-src-all@freebsd.org Fri Dec 18 05:44:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A44FA4B24B; Fri, 18 Dec 2015 05:44:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A880B12CF; Fri, 18 Dec 2015 05:44:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI5i1xY054218; Fri, 18 Dec 2015 05:44:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI5i0Zp054199; Fri, 18 Dec 2015 05:44:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512180544.tBI5i0Zp054199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 18 Dec 2015 05:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292426 - in head/sys: arm/allwinner/a20 arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/arm arm/freescale/imx arm/include arm/qemu arm/rockchip arm/samsung/exynos arm/t... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:44:03 -0000 Author: adrian Date: Fri Dec 18 05:43:59 2015 New Revision: 292426 URL: https://svnweb.freebsd.org/changeset/base/292426 Log: [intrng] Migrate the intrng code from sys/arm/arm to sys/kern/subr_intr.c. The ci20 port (by kan@) is going to reuse almost all of the intrng code since the SoC in question looks suspiciously like someone took an ARM SoC design and replaced the ARM core with a MIPS core. * migrate out the code; * rename ARM_ -> INTR_; * rename arm_ -> intr_; * move the interrupt flush routine from intr.c / intrng.c into arm/machdep_intr.c - removing the code duplication and removing the ARM specific bits from here. Thanks to the Star Wars: The Force Awakens premiere line for allowing me a couple hours of quiet time to finish the universe builds. Tested: * make universe TODO: * The structure definitions in subr_intr.c still includes machine/intr.h which requires one duplicates all of the intrng definitions in the platform code (which kan has done, and I think we don't have to.) Instead I should break out the generic things (function declarations, common intr structures, etc) into a separate header. * Kan has requested I make the PIC based IPI stuff optional. Added: head/sys/arm/arm/machdep_intr.c (contents, props changed) head/sys/kern/pic_if.m - copied, changed from r292394, head/sys/arm/arm/pic_if.m head/sys/kern/subr_intr.c - copied, changed from r292394, head/sys/arm/arm/intrng.c Deleted: head/sys/arm/arm/intrng.c head/sys/arm/arm/pic_if.m Modified: head/sys/arm/allwinner/a20/a20_mp.c head/sys/arm/altera/socfpga/socfpga_mp.c head/sys/arm/amlogic/aml8726/aml8726_mp.c head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/arm/exception.S head/sys/arm/arm/gic.c head/sys/arm/arm/intr.c head/sys/arm/arm/mp_machdep.c head/sys/arm/arm/nexus.c head/sys/arm/freescale/imx/imx6_mp.c head/sys/arm/freescale/imx/imx_gpio.c head/sys/arm/include/intr.h head/sys/arm/include/smp.h head/sys/arm/qemu/virt_mp.c head/sys/arm/rockchip/rk30xx_mp.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/xilinx/zy7_mp.c head/sys/conf/files.arm Modified: head/sys/arm/allwinner/a20/a20_mp.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/allwinner/a20/a20_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -61,7 +61,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/altera/socfpga/socfpga_mp.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/altera/socfpga/socfpga_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -87,7 +87,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/amlogic/aml8726/aml8726_mp.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/amlogic/aml8726/aml8726_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -351,7 +351,7 @@ platform_mp_init_secondary(void) * each AP. */ - arm_pic_init_secondary(); + intr_pic_init_secondary(); } Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -122,7 +122,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/arm/exception.S Fri Dec 18 05:43:59 2015 (r292426) @@ -410,7 +410,7 @@ ASENTRY_NP(irq_entry) PUSHFRAMEINSVC /* mode stack, build trapframe there. */ adr lr, exception_exit /* Return from handler via standard */ mov r0, sp /* exception exit routine. Pass the */ - b _C_LABEL(arm_irq_handler)/* trapframe to the handler. */ + b _C_LABEL(intr_irq_handler)/* trapframe to the handler. */ END(irq_entry) /* Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/arm/gic.c Fri Dec 18 05:43:59 2015 (r292426) @@ -120,14 +120,14 @@ __FBSDID("$FreeBSD$"); #ifdef ARM_INTRNG static u_int gic_irq_cpu; static int arm_gic_intr(void *); -static int arm_gic_bind(device_t dev, struct arm_irqsrc *isrc); +static int arm_gic_bind(device_t dev, struct intr_irqsrc *isrc); #endif struct arm_gic_softc { device_t gic_dev; #ifdef ARM_INTRNG void * gic_intrhand; - struct arm_irqsrc ** gic_irqs; + struct intr_irqsrc ** gic_irqs; #endif struct resource * gic_res[3]; bus_space_tag_t gic_c_bst; @@ -216,7 +216,7 @@ static void arm_gic_init_secondary(device_t dev) { struct arm_gic_softc *sc = device_get_softc(dev); - struct arm_irqsrc *isrc; + struct intr_irqsrc *isrc; u_int irq; for (irq = 0; irq < sc->nirqs; irq += 4) @@ -250,7 +250,7 @@ arm_gic_init_secondary(device_t dev) isrc = sc->gic_irqs[irq]; if (isrc == NULL || isrc->isrc_handlers == 0) continue; - if (isrc->isrc_flags & ARM_ISRCF_BOUND) { + if (isrc->isrc_flags & INTR_ISRCF_BOUND) { if (CPU_ISSET(PCPU_GET(cpuid), &isrc->isrc_cpu)) gic_irq_unmask(sc, irq); } else { @@ -456,7 +456,7 @@ arm_gic_attach(device_t dev) * Now, when everything is initialized, it's right time to * register interrupt controller to interrupt framefork. */ - if (arm_pic_register(dev, xref) != 0) { + if (intr_pic_register(dev, xref) != 0) { device_printf(dev, "could not register PIC\n"); goto cleanup; } @@ -468,23 +468,23 @@ arm_gic_attach(device_t dev) */ pxref = ofw_bus_find_iparent(ofw_bus_get_node(dev)); if (pxref == 0 || xref == pxref) { - if (arm_pic_claim_root(dev, xref, arm_gic_intr, sc, + if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc, GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { device_printf(dev, "could not set PIC as a root\n"); - arm_pic_unregister(dev, xref); + intr_pic_unregister(dev, xref); goto cleanup; } } else { if (sc->gic_res[2] == NULL) { device_printf(dev, "not root PIC must have defined interrupt\n"); - arm_pic_unregister(dev, xref); + intr_pic_unregister(dev, xref); goto cleanup; } if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_CLK, arm_gic_intr, NULL, sc, &sc->gic_intrhand)) { device_printf(dev, "could not setup irq handler\n"); - arm_pic_unregister(dev, xref); + intr_pic_unregister(dev, xref); goto cleanup; } } @@ -508,7 +508,7 @@ static int arm_gic_intr(void *arg) { struct arm_gic_softc *sc = arg; - struct arm_irqsrc *isrc; + struct intr_irqsrc *isrc; uint32_t irq_active_reg, irq; struct trapframe *tf; @@ -560,7 +560,7 @@ dispatch_irq: #ifdef SMP /* Call EOI for all IPI before dispatch. */ gic_c_write_4(sc, GICC_EOIR, irq_active_reg); - arm_ipi_dispatch(isrc, tf); + intr_ipi_dispatch(isrc, tf); goto next_irq; #else device_printf(sc->gic_dev, "SGI %u on UP system detected\n", @@ -576,7 +576,7 @@ dispatch_irq: if (isrc->isrc_trig == INTR_TRIGGER_EDGE) gic_c_write_4(sc, GICC_EOIR, irq_active_reg); - arm_irq_dispatch(isrc, tf); + intr_irq_dispatch(isrc, tf); next_irq: arm_irq_memory_barrier(irq); @@ -589,7 +589,7 @@ next_irq: } static int -gic_attach_isrc(struct arm_gic_softc *sc, struct arm_irqsrc *isrc, u_int irq) +gic_attach_isrc(struct arm_gic_softc *sc, struct intr_irqsrc *isrc, u_int irq) { const char *name; @@ -609,16 +609,16 @@ gic_attach_isrc(struct arm_gic_softc *sc name = device_get_nameunit(sc->gic_dev); if (irq <= GIC_LAST_SGI) - arm_irq_set_name(isrc, "%s,i%u", name, irq - GIC_FIRST_SGI); + intr_irq_set_name(isrc, "%s,i%u", name, irq - GIC_FIRST_SGI); else if (irq <= GIC_LAST_PPI) - arm_irq_set_name(isrc, "%s,p%u", name, irq - GIC_FIRST_PPI); + intr_irq_set_name(isrc, "%s,p%u", name, irq - GIC_FIRST_PPI); else - arm_irq_set_name(isrc, "%s,s%u", name, irq - GIC_FIRST_SPI); + intr_irq_set_name(isrc, "%s,s%u", name, irq - GIC_FIRST_SPI); return (0); } static int -gic_detach_isrc(struct arm_gic_softc *sc, struct arm_irqsrc *isrc, u_int irq) +gic_detach_isrc(struct arm_gic_softc *sc, struct intr_irqsrc *isrc, u_int irq) { mtx_lock_spin(&sc->mutex); @@ -630,7 +630,7 @@ gic_detach_isrc(struct arm_gic_softc *sc isrc->isrc_data = 0; mtx_unlock_spin(&sc->mutex); - arm_irq_set_name(isrc, ""); + intr_irq_set_name(isrc, ""); return (0); } @@ -696,15 +696,15 @@ gic_irq_from_nspc(struct arm_gic_softc * { switch (type) { - case ARM_IRQ_NSPC_PLAIN: + case INTR_IRQ_NSPC_PLAIN: *irqp = num; return (*irqp < sc->nirqs ? 0 : EINVAL); - case ARM_IRQ_NSPC_IRQ: + case INTR_IRQ_NSPC_IRQ: *irqp = num + GIC_FIRST_PPI; return (*irqp < sc->nirqs ? 0 : EINVAL); - case ARM_IRQ_NSPC_IPI: + case INTR_IRQ_NSPC_IPI: *irqp = num + GIC_FIRST_SGI; return (*irqp < GIC_LAST_SGI ? 0 : EINVAL); @@ -714,7 +714,7 @@ gic_irq_from_nspc(struct arm_gic_softc * } static int -gic_map_nspc(struct arm_gic_softc *sc, struct arm_irqsrc *isrc, u_int *irqp) +gic_map_nspc(struct arm_gic_softc *sc, struct intr_irqsrc *isrc, u_int *irqp) { int error; @@ -727,7 +727,7 @@ gic_map_nspc(struct arm_gic_softc *sc, s #ifdef FDT static int -gic_map_fdt(struct arm_gic_softc *sc, struct arm_irqsrc *isrc, u_int *irqp) +gic_map_fdt(struct arm_gic_softc *sc, struct intr_irqsrc *isrc, u_int *irqp) { u_int irq, tripol; enum intr_trigger trig; @@ -773,7 +773,7 @@ gic_map_fdt(struct arm_gic_softc *sc, st if (error != 0) return (error); - isrc->isrc_nspc_type = ARM_IRQ_NSPC_PLAIN; + isrc->isrc_nspc_type = INTR_IRQ_NSPC_PLAIN; isrc->isrc_nspc_num = irq; isrc->isrc_trig = trig; isrc->isrc_pol = pol; @@ -784,16 +784,16 @@ gic_map_fdt(struct arm_gic_softc *sc, st #endif static int -arm_gic_register(device_t dev, struct arm_irqsrc *isrc, boolean_t *is_percpu) +arm_gic_register(device_t dev, struct intr_irqsrc *isrc, boolean_t *is_percpu) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq; int error; - if (isrc->isrc_type == ARM_ISRCT_NAMESPACE) + if (isrc->isrc_type == INTR_ISRCT_NAMESPACE) error = gic_map_nspc(sc, isrc, &irq); #ifdef FDT - else if (isrc->isrc_type == ARM_ISRCT_FDT) + else if (isrc->isrc_type == INTR_ISRCT_FDT) error = gic_map_fdt(sc, isrc, &irq); #endif else @@ -805,7 +805,7 @@ arm_gic_register(device_t dev, struct ar } static void -arm_gic_enable_intr(device_t dev, struct arm_irqsrc *isrc) +arm_gic_enable_intr(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq = isrc->isrc_data; @@ -820,7 +820,7 @@ arm_gic_enable_intr(device_t dev, struct * pic_enable_source() and pic_disable_source() should act on * per CPU basis only. Thus, it should be solved here somehow. */ - if (isrc->isrc_flags & ARM_ISRCF_PERCPU) + if (isrc->isrc_flags & INTR_ISRCF_PERCPU) CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); gic_config(sc, irq, isrc->isrc_trig, isrc->isrc_pol); @@ -828,7 +828,7 @@ arm_gic_enable_intr(device_t dev, struct } static void -arm_gic_enable_source(device_t dev, struct arm_irqsrc *isrc) +arm_gic_enable_source(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq = isrc->isrc_data; @@ -838,7 +838,7 @@ arm_gic_enable_source(device_t dev, stru } static void -arm_gic_disable_source(device_t dev, struct arm_irqsrc *isrc) +arm_gic_disable_source(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq = isrc->isrc_data; @@ -847,7 +847,7 @@ arm_gic_disable_source(device_t dev, str } static int -arm_gic_unregister(device_t dev, struct arm_irqsrc *isrc) +arm_gic_unregister(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); u_int irq = isrc->isrc_data; @@ -856,7 +856,7 @@ arm_gic_unregister(device_t dev, struct } static void -arm_gic_pre_ithread(device_t dev, struct arm_irqsrc *isrc) +arm_gic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); @@ -865,7 +865,7 @@ arm_gic_pre_ithread(device_t dev, struct } static void -arm_gic_post_ithread(device_t dev, struct arm_irqsrc *isrc) +arm_gic_post_ithread(device_t dev, struct intr_irqsrc *isrc) { arm_irq_memory_barrier(0); @@ -873,7 +873,7 @@ arm_gic_post_ithread(device_t dev, struc } static void -arm_gic_post_filter(device_t dev, struct arm_irqsrc *isrc) +arm_gic_post_filter(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); @@ -886,7 +886,7 @@ arm_gic_post_filter(device_t dev, struct } static int -arm_gic_bind(device_t dev, struct arm_irqsrc *isrc) +arm_gic_bind(device_t dev, struct intr_irqsrc *isrc) { struct arm_gic_softc *sc = device_get_softc(dev); uint32_t irq = isrc->isrc_data; @@ -895,7 +895,7 @@ arm_gic_bind(device_t dev, struct arm_ir return (EINVAL); if (CPU_EMPTY(&isrc->isrc_cpu)) { - gic_irq_cpu = arm_irq_next_cpu(gic_irq_cpu, &all_cpus); + gic_irq_cpu = intr_irq_next_cpu(gic_irq_cpu, &all_cpus); CPU_SETOF(gic_irq_cpu, &isrc->isrc_cpu); } return (gic_bind(sc, irq, &isrc->isrc_cpu)); @@ -903,7 +903,7 @@ arm_gic_bind(device_t dev, struct arm_ir #ifdef SMP static void -arm_gic_ipi_send(device_t dev, struct arm_irqsrc *isrc, cpuset_t cpus) +arm_gic_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus) { struct arm_gic_softc *sc = device_get_softc(dev); uint32_t irq, val = 0, i; @@ -1097,7 +1097,7 @@ arm_get_next_irq(int last_irq) #ifdef SMP void -arm_pic_init_secondary(void) +intr_pic_init_secondary(void) { arm_gic_init_secondary(gic_sc->gic_dev); Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/arm/intr.c Fri Dec 18 05:43:59 2015 (r292426) @@ -70,7 +70,7 @@ typedef void (*mask_fn)(void *); static struct intr_event *intr_events[NIRQ]; -void arm_irq_handler(struct trapframe *); +void intr_irq_handler(struct trapframe *); void (*arm_post_filter)(void *) = NULL; int (*arm_config_irq)(int irq, enum intr_trigger trig, @@ -104,7 +104,7 @@ SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER #ifdef FDT int -arm_fdt_map_irq(phandle_t iparent, pcell_t *intr, int icells) +intr_fdt_map_irq(phandle_t iparent, pcell_t *intr, int icells) { fdt_pic_decode_t intr_decode; phandle_t intr_parent; @@ -179,7 +179,7 @@ dosoftints(void) } void -arm_irq_handler(struct trapframe *frame) +intr_irq_handler(struct trapframe *frame) { struct intr_event *event; int i; @@ -199,67 +199,3 @@ arm_irq_handler(struct trapframe *frame) pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, frame); #endif } - -/* - * arm_irq_memory_barrier() - * - * Ensure all writes to device memory have reached devices before proceeding. - * - * This is intended to be called from the post-filter and post-thread routines - * of an interrupt controller implementation. A peripheral device driver should - * use bus_space_barrier() if it needs to ensure a write has reached the - * hardware for some reason other than clearing interrupt conditions. - * - * The need for this function arises from the ARM weak memory ordering model. - * Writes to locations mapped with the Device attribute bypass any caches, but - * are buffered. Multiple writes to the same device will be observed by that - * device in the order issued by the cpu. Writes to different devices may - * appear at those devices in a different order than issued by the cpu. That - * is, if the cpu writes to device A then device B, the write to device B could - * complete before the write to device A. - * - * Consider a typical device interrupt handler which services the interrupt and - * writes to a device status-acknowledge register to clear the interrupt before - * returning. That write is posted to the L2 controller which "immediately" - * places it in a store buffer and automatically drains that buffer. This can - * be less immediate than you'd think... There may be no free slots in the store - * buffers, so an existing buffer has to be drained first to make room. The - * target bus may be busy with other traffic (such as DMA for various devices), - * delaying the drain of the store buffer for some indeterminate time. While - * all this delay is happening, execution proceeds on the CPU, unwinding its way - * out of the interrupt call stack to the point where the interrupt driver code - * is ready to EOI and unmask the interrupt. The interrupt controller may be - * accessed via a faster bus than the hardware whose handler just ran; the write - * to unmask and EOI the interrupt may complete quickly while the device write - * to ack and clear the interrupt source is still lingering in a store buffer - * waiting for access to a slower bus. With the interrupt unmasked at the - * interrupt controller but still active at the device, as soon as interrupts - * are enabled on the core the device re-interrupts immediately: now you've got - * a spurious interrupt on your hands. - * - * The right way to fix this problem is for every device driver to use the - * proper bus_space_barrier() calls in its interrupt handler. For ARM a single - * barrier call at the end of the handler would work. This would have to be - * done to every driver in the system, not just arm-specific drivers. - * - * Another potential fix is to map all device memory as Strongly-Ordered rather - * than Device memory, which takes the store buffers out of the picture. This - * has a pretty big impact on overall system performance, because each strongly - * ordered memory access causes all L2 store buffers to be drained. - * - * A compromise solution is to have the interrupt controller implementation call - * this function to establish a barrier between writes to the interrupt-source - * device and writes to the interrupt controller device. - * - * This takes the interrupt number as an argument, and currently doesn't use it. - * The plan is that maybe some day there is a way to flag certain interrupts as - * "memory barrier safe" and we can avoid this overhead with them. - */ -void -arm_irq_memory_barrier(uintptr_t irq) -{ - - dsb(); - cpu_l2cache_drain_writebuf(); -} - Added: head/sys/arm/arm/machdep_intr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/machdep_intr.c Fri Dec 18 05:43:59 2015 (r292426) @@ -0,0 +1,123 @@ +/* $NetBSD: intr.c,v 1.12 2003/07/15 00:24:41 lukem Exp $ */ + +/*- + * Copyright (c) 2004 Olivier Houchard. + * Copyright (c) 1994-1998 Mark Brinicombe. + * 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 Mark Brinicombe + * for the NetBSD Project. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * + * Soft interrupt and other generic interrupt functions. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* + * arm_irq_memory_barrier() + * + * Ensure all writes to device memory have reached devices before proceeding. + * + * This is intended to be called from the post-filter and post-thread routines + * of an interrupt controller implementation. A peripheral device driver should + * use bus_space_barrier() if it needs to ensure a write has reached the + * hardware for some reason other than clearing interrupt conditions. + * + * The need for this function arises from the ARM weak memory ordering model. + * Writes to locations mapped with the Device attribute bypass any caches, but + * are buffered. Multiple writes to the same device will be observed by that + * device in the order issued by the cpu. Writes to different devices may + * appear at those devices in a different order than issued by the cpu. That + * is, if the cpu writes to device A then device B, the write to device B could + * complete before the write to device A. + * + * Consider a typical device interrupt handler which services the interrupt and + * writes to a device status-acknowledge register to clear the interrupt before + * returning. That write is posted to the L2 controller which "immediately" + * places it in a store buffer and automatically drains that buffer. This can + * be less immediate than you'd think... There may be no free slots in the store + * buffers, so an existing buffer has to be drained first to make room. The + * target bus may be busy with other traffic (such as DMA for various devices), + * delaying the drain of the store buffer for some indeterminate time. While + * all this delay is happening, execution proceeds on the CPU, unwinding its way + * out of the interrupt call stack to the point where the interrupt driver code + * is ready to EOI and unmask the interrupt. The interrupt controller may be + * accessed via a faster bus than the hardware whose handler just ran; the write + * to unmask and EOI the interrupt may complete quickly while the device write + * to ack and clear the interrupt source is still lingering in a store buffer + * waiting for access to a slower bus. With the interrupt unmasked at the + * interrupt controller but still active at the device, as soon as interrupts + * are enabled on the core the device re-interrupts immediately: now you've got + * a spurious interrupt on your hands. + * + * The right way to fix this problem is for every device driver to use the + * proper bus_space_barrier() calls in its interrupt handler. For ARM a single + * barrier call at the end of the handler would work. This would have to be + * done to every driver in the system, not just arm-specific drivers. + * + * Another potential fix is to map all device memory as Strongly-Ordered rather + * than Device memory, which takes the store buffers out of the picture. This + * has a pretty big impact on overall system performance, because each strongly + * ordered memory access causes all L2 store buffers to be drained. + * + * A compromise solution is to have the interrupt controller implementation call + * this function to establish a barrier between writes to the interrupt-source + * device and writes to the interrupt controller device. + * + * This takes the interrupt number as an argument, and currently doesn't use it. + * The plan is that maybe some day there is a way to flag certain interrupts as + * "memory barrier safe" and we can avoid this overhead with them. + */ +void +arm_irq_memory_barrier(uintptr_t irq) +{ + + dsb(); + cpu_l2cache_drain_writebuf(); +} + Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/arm/mp_machdep.c Fri Dec 18 05:43:59 2015 (r292426) @@ -443,12 +443,12 @@ release_aps(void *dummy __unused) return; #ifdef ARM_INTRNG - arm_ipi_set_handler(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL, 0); - arm_ipi_set_handler(IPI_AST, "ast", ipi_ast, NULL, 0); - arm_ipi_set_handler(IPI_STOP, "stop", ipi_stop, NULL, 0); - arm_ipi_set_handler(IPI_PREEMPT, "preempt", ipi_preempt, NULL, 0); - arm_ipi_set_handler(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL, 0); - arm_ipi_set_handler(IPI_TLB, "tlb", ipi_tlb, NULL, 0); + intr_ipi_set_handler(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL, 0); + intr_ipi_set_handler(IPI_AST, "ast", ipi_ast, NULL, 0); + intr_ipi_set_handler(IPI_STOP, "stop", ipi_stop, NULL, 0); + intr_ipi_set_handler(IPI_PREEMPT, "preempt", ipi_preempt, NULL, 0); + intr_ipi_set_handler(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL, 0); + intr_ipi_set_handler(IPI_TLB, "tlb", ipi_tlb, NULL, 0); #else #ifdef IPI_IRQ_START Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/arm/nexus.c Fri Dec 18 05:43:59 2015 (r292426) @@ -267,7 +267,7 @@ nexus_config_intr(device_t dev, int irq, int ret = ENODEV; #ifdef ARM_INTRNG - ret = arm_irq_config(irq, trig, pol); + ret = intr_irq_config(irq, trig, pol); #else if (arm_config_irq) ret = (*arm_config_irq)(irq, trig, pol); @@ -286,7 +286,7 @@ nexus_setup_intr(device_t dev, device_t for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { #ifdef ARM_INTRNG - arm_irq_add_handler(child, filt, intr, arg, irq, flags, + intr_irq_add_handler(child, filt, intr, arg, irq, flags, cookiep); #else arm_setup_irqhandler(device_get_nameunit(child), @@ -302,7 +302,7 @@ nexus_teardown_intr(device_t dev, device { #ifdef ARM_INTRNG - return (arm_irq_remove_handler(child, rman_get_start(r), ih)); + return (intr_irq_remove_handler(child, rman_get_start(r), ih)); #else return (arm_remove_irqhandler(rman_get_start(r), ih)); #endif @@ -314,7 +314,7 @@ nexus_describe_intr(device_t dev, device void *cookie, const char *descr) { - return (arm_irq_describe(rman_get_start(irq), cookie, descr)); + return (intr_irq_describe(rman_get_start(irq), cookie, descr)); } #ifdef SMP @@ -322,7 +322,7 @@ static int nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { - return (arm_irq_bind(rman_get_start(irq), cpu)); + return (intr_irq_bind(rman_get_start(irq), cpu)); } #endif #endif @@ -396,6 +396,6 @@ nexus_ofw_map_intr(device_t dev, device_ pcell_t *intr) { - return (arm_fdt_map_irq(iparent, intr, icells)); + return (intr_fdt_map_irq(iparent, intr, icells)); } #endif Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/freescale/imx/imx6_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -69,7 +69,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/freescale/imx/imx_gpio.c Fri Dec 18 05:43:59 2015 (r292426) @@ -101,7 +101,7 @@ struct imx51_gpio_softc { bus_space_handle_t sc_ioh; int gpio_npins; struct gpio_pin gpio_pins[NGPIO]; - struct arm_irqsrc *gpio_pic_irqsrc[NGPIO]; + struct intr_irqsrc *gpio_pic_irqsrc[NGPIO]; }; static struct ofw_compat_data compat_data[] = { @@ -149,7 +149,7 @@ static int imx51_gpio_pin_toggle(device_ * this is teardown_intr */ static void -gpio_pic_disable_intr(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) { struct imx51_gpio_softc *sc; u_int irq; @@ -168,7 +168,7 @@ gpio_pic_disable_intr(device_t dev, stru * this is mask_intr */ static void -gpio_pic_disable_source(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_disable_source(device_t dev, struct intr_irqsrc *isrc) { struct imx51_gpio_softc *sc; @@ -183,7 +183,7 @@ gpio_pic_disable_source(device_t dev, st * this is setup_intr */ static void -gpio_pic_enable_intr(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) { struct imx51_gpio_softc *sc; int icfg; @@ -226,7 +226,7 @@ gpio_pic_enable_intr(device_t dev, struc * this is unmask_intr */ static void -gpio_pic_enable_source(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_enable_source(device_t dev, struct intr_irqsrc *isrc) { struct imx51_gpio_softc *sc; @@ -238,7 +238,7 @@ gpio_pic_enable_source(device_t dev, str } static void -gpio_pic_post_filter(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_post_filter(device_t dev, struct intr_irqsrc *isrc) { struct imx51_gpio_softc *sc; @@ -250,7 +250,7 @@ gpio_pic_post_filter(device_t dev, struc } static void -gpio_pic_post_ithread(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) { arm_irq_memory_barrier(0); @@ -258,7 +258,7 @@ gpio_pic_post_ithread(device_t dev, stru } static void -gpio_pic_pre_ithread(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) { gpio_pic_disable_source(dev, isrc); @@ -268,7 +268,7 @@ gpio_pic_pre_ithread(device_t dev, struc * intrng calls this to make a new isrc known to us. */ static int -gpio_pic_register(device_t dev, struct arm_irqsrc *isrc, boolean_t *is_percpu) +gpio_pic_register(device_t dev, struct intr_irqsrc *isrc, boolean_t *is_percpu) { struct imx51_gpio_softc *sc; u_int irq, tripol; @@ -320,7 +320,7 @@ gpio_pic_register(device_t dev, struct a tripol); return (ENOTSUP); } - isrc->isrc_nspc_type = ARM_IRQ_NSPC_PLAIN; + isrc->isrc_nspc_type = INTR_IRQ_NSPC_PLAIN; isrc->isrc_nspc_num = irq; /* @@ -337,12 +337,12 @@ gpio_pic_register(device_t dev, struct a isrc->isrc_data = irq; mtx_unlock_spin(&sc->sc_mtx); - arm_irq_set_name(isrc, "%s,%u", device_get_nameunit(sc->dev), irq); + intr_irq_set_name(isrc, "%s,%u", device_get_nameunit(sc->dev), irq); return (0); } static int -gpio_pic_unregister(device_t dev, struct arm_irqsrc *isrc) +gpio_pic_unregister(device_t dev, struct intr_irqsrc *isrc) { struct imx51_gpio_softc *sc; u_int irq; @@ -359,7 +359,7 @@ gpio_pic_unregister(device_t dev, struct isrc->isrc_data = 0; mtx_unlock_spin(&sc->sc_mtx); - arm_irq_set_name(isrc, ""); + intr_irq_set_name(isrc, ""); return (0); } @@ -378,7 +378,7 @@ gpio_pic_filter(void *arg) if ((interrupts & 0x1) == 0) continue; if (sc->gpio_pic_irqsrc[i]) - arm_irq_dispatch(sc->gpio_pic_irqsrc[i], curthread->td_intr_frame); + intr_irq_dispatch(sc->gpio_pic_irqsrc[i], curthread->td_intr_frame); else device_printf(sc->dev, "spurious interrupt %d\n", i); } @@ -656,7 +656,7 @@ imx51_gpio_attach(device_t dev) } #ifdef ARM_INTRNG - arm_pic_register(dev, OF_xref_from_node(ofw_bus_get_node(dev))); + intr_pic_register(dev, OF_xref_from_node(ofw_bus_get_node(dev))); #endif sc->sc_busdev = gpiobus_attach_bus(dev); Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/include/intr.h Fri Dec 18 05:43:59 2015 (r292426) @@ -51,33 +51,33 @@ #ifdef notyet #define INTR_SOLO INTR_MD1 -typedef int arm_irq_filter_t(void *arg, struct trapframe *tf); +typedef int intr_irq_filter_t(void *arg, struct trapframe *tf); #else -typedef int arm_irq_filter_t(void *arg); +typedef int intr_irq_filter_t(void *arg); #endif -#define ARM_ISRC_NAMELEN (MAXCOMLEN + 1) +#define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) -typedef void arm_ipi_filter_t(void *arg); +typedef void intr_ipi_filter_t(void *arg); -enum arm_isrc_type { - ARM_ISRCT_NAMESPACE, - ARM_ISRCT_FDT +enum intr_isrc_type { + INTR_ISRCT_NAMESPACE, + INTR_ISRCT_FDT }; -#define ARM_ISRCF_REGISTERED 0x01 /* registered in a controller */ -#define ARM_ISRCF_PERCPU 0x02 /* per CPU interrupt */ -#define ARM_ISRCF_BOUND 0x04 /* bound to a CPU */ +#define INTR_ISRCF_REGISTERED 0x01 /* registered in a controller */ +#define INTR_ISRCF_PERCPU 0x02 /* per CPU interrupt */ +#define INTR_ISRCF_BOUND 0x04 /* bound to a CPU */ /* Interrupt source definition. */ -struct arm_irqsrc { +struct intr_irqsrc { device_t isrc_dev; /* where isrc is mapped */ intptr_t isrc_xref; /* device reference key */ uintptr_t isrc_data; /* device data for isrc */ u_int isrc_irq; /* unique identificator */ - enum arm_isrc_type isrc_type; /* how is isrc decribed */ + enum intr_isrc_type isrc_type; /* how is isrc decribed */ u_int isrc_flags; - char isrc_name[ARM_ISRC_NAMELEN]; + char isrc_name[INTR_ISRC_NAMELEN]; uint16_t isrc_nspc_type; uint16_t isrc_nspc_num; enum intr_trigger isrc_trig; @@ -87,8 +87,8 @@ struct arm_irqsrc { u_long * isrc_count; u_int isrc_handlers; struct intr_event * isrc_event; - arm_irq_filter_t * isrc_filter; - arm_ipi_filter_t * isrc_ipifilter; + intr_irq_filter_t * isrc_filter; + intr_ipi_filter_t * isrc_ipifilter; void * isrc_arg; #ifdef FDT u_int isrc_ncells; @@ -96,45 +96,45 @@ struct arm_irqsrc { #endif }; -void arm_irq_set_name(struct arm_irqsrc *isrc, const char *fmt, ...) +void intr_irq_set_name(struct intr_irqsrc *isrc, const char *fmt, ...) __printflike(2, 3); -void arm_irq_dispatch(struct arm_irqsrc *isrc, struct trapframe *tf); +void intr_irq_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); -#define ARM_IRQ_NSPC_NONE 0 -#define ARM_IRQ_NSPC_PLAIN 1 -#define ARM_IRQ_NSPC_IRQ 2 -#define ARM_IRQ_NSPC_IPI 3 +#define INTR_IRQ_NSPC_NONE 0 +#define INTR_IRQ_NSPC_PLAIN 1 +#define INTR_IRQ_NSPC_IRQ 2 +#define INTR_IRQ_NSPC_IPI 3 -u_int arm_namespace_map_irq(device_t dev, uint16_t type, uint16_t num); +u_int intr_namespace_map_irq(device_t dev, uint16_t type, uint16_t num); #ifdef FDT -u_int arm_fdt_map_irq(phandle_t, pcell_t *, u_int); +u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int); #endif -int arm_pic_register(device_t dev, intptr_t xref); -int arm_pic_unregister(device_t dev, intptr_t xref); -int arm_pic_claim_root(device_t dev, intptr_t xref, arm_irq_filter_t *filter, +int intr_pic_register(device_t dev, intptr_t xref); +int intr_pic_unregister(device_t dev, intptr_t xref); +int intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter, void *arg, u_int ipicount); -int arm_irq_add_handler(device_t dev, driver_filter_t, driver_intr_t, void *, +int intr_irq_add_handler(device_t dev, driver_filter_t, driver_intr_t, void *, u_int, int, void **); -int arm_irq_remove_handler(device_t dev, u_int, void *); -int arm_irq_config(u_int, enum intr_trigger, enum intr_polarity); -int arm_irq_describe(u_int, void *, const char *); +int intr_irq_remove_handler(device_t dev, u_int, void *); +int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity); +int intr_irq_describe(u_int, void *, const char *); -u_int arm_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); +u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask); #ifdef SMP -int arm_irq_bind(u_int, int); +int intr_irq_bind(u_int, int); -void arm_ipi_dispatch(struct arm_irqsrc *isrc, struct trapframe *tf); +void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); #define AISHF_NOALLOC 0x0001 -int arm_ipi_set_handler(u_int ipi, const char *name, arm_ipi_filter_t *filter, +int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, void *arg, u_int flags); -void arm_pic_init_secondary(void); +void intr_pic_init_secondary(void); #endif #else /* ARM_INTRNG */ @@ -178,11 +178,11 @@ extern void (*arm_post_filter)(void *); extern int (*arm_config_irq)(int irq, enum intr_trigger trig, enum intr_polarity pol); -void arm_pic_init_secondary(void); +void intr_pic_init_secondary(void); #ifdef FDT int gic_decode_fdt(phandle_t, pcell_t *, int *, int *, int *); -int arm_fdt_map_irq(phandle_t, pcell_t *, int); +int intr_fdt_map_irq(phandle_t, pcell_t *, int); #endif #endif /* ARM_INTRNG */ Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/include/smp.h Fri Dec 18 05:43:59 2015 (r292426) @@ -16,7 +16,7 @@ enum { IPI_HARDCLOCK, IPI_TLB, IPI_CACHE, - ARM_IPI_COUNT + INTR_IPI_COUNT }; #else #define IPI_AST 0 Modified: head/sys/arm/qemu/virt_mp.c ============================================================================== --- head/sys/arm/qemu/virt_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/qemu/virt_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -102,7 +102,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/rockchip/rk30xx_mp.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/rockchip/rk30xx_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -82,7 +82,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -73,7 +73,7 @@ void platform_mp_init_secondary(void) { - arm_pic_init_secondary(); + intr_pic_init_secondary(); } void Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Fri Dec 18 05:39:25 2015 (r292425) +++ head/sys/arm/ti/omap4/omap4_mp.c Fri Dec 18 05:43:59 2015 (r292426) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 18 05:45:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 690EDA4B3EF; Fri, 18 Dec 2015 05:45:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC16162C; Fri, 18 Dec 2015 05:45:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI5jnG0054430; Fri, 18 Dec 2015 05:45:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI5jnS0054429; Fri, 18 Dec 2015 05:45:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512180545.tBI5jnS0054429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 Dec 2015 05:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292427 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:45:50 -0000 Author: imp Date: Fri Dec 18 05:45:49 2015 New Revision: 292427 URL: https://svnweb.freebsd.org/changeset/base/292427 Log: Use variable names that aren't as prone to dyslexic confusion. Suggested by: jmallet@ Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Dec 18 05:43:59 2015 (r292426) +++ head/libexec/rtld-elf/rtld.c Fri Dec 18 05:45:49 2015 (r292427) @@ -257,7 +257,7 @@ bool ld_library_path_rpath = false; /* * Globals for path names, and such */ -char *ld_path_elf_hints = _PATH_ELF_HINTS; +char *ld_elf_hints_default = _PATH_ELF_HINTS; char *ld_path_libmap_conf = _PATH_LIBMAP_CONF; char *ld_path_rtld = _PATH_RTLD; char *ld_standard_library_path = STANDARD_LIBRARY_PATH; @@ -458,7 +458,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ ld_utrace = getenv(LD_ "UTRACE"); if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) - ld_elf_hints_path = ld_path_elf_hints; + ld_elf_hints_path = ld_elf_hints_default; if (ld_debug != NULL && *ld_debug != '\0') debug = 1; From owner-svn-src-all@freebsd.org Fri Dec 18 05:53:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D59A4B8F4; Fri, 18 Dec 2015 05:53:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA89E1D27; Fri, 18 Dec 2015 05:53:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id jx14so26065609pad.2; Thu, 17 Dec 2015 21:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UEC9XHjFPNi9zK7wJt9KaLR7MZhfue+m3lGTp5CjChw=; b=wUKZi4RKKprs1ZV1eDF0/gYAUZ2kHn0joaXjCxUng9U9rx0jS5vV+6Jf5omz6lmNwK KS2wpTpy69bFrp7hEVXWqXV38miDRHyYwd7fbmL49CfqTfwZBYj5t6NOu5FV1UTpFoVx Z8vhUWtljNj5oQjqYKdMa9tqbh9EknO2aSHxtlIieUFuQaMqDrtbYUJESpS9iUm3QCqx uIerkkRp8L7FtzGfgQqvuWyWivG0UZb99+h8FIlCpki/iheD3MvdEjXqJwl+lXPgH33R nEBnnhDj2tp5hmRB+OX7eHUA/arlZq0t3t43brjgTSv/F27RF8R6uY63DguMaZOGQhdn 2tSw== X-Received: by 10.66.158.129 with SMTP id wu1mr2583007pab.146.1450418019234; Thu, 17 Dec 2015 21:53:39 -0800 (PST) Received: from [100.193.155.241] ([172.56.42.96]) by smtp.gmail.com with ESMTPSA id e67sm14989027pfj.53.2015.12.17.21.53.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 21:53:38 -0800 (PST) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r292410 - head/usr.sbin/boot0cfg From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: Date: Thu, 17 Dec 2015 21:53:36 -0800 Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <30CD0290-06B9-4024-8EEE-F25090608D46@gmail.com> References: <201512172042.tBHKg5bM091931@repo.freebsd.org> To: luke Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:53:39 -0000 > On Dec 17, 2015, at 21:36, luke wrote: >=20 >> On Fri, Dec 18, 2015 at 4:42 AM, John Baldwin wrote: >> Author: jhb >> Date: Thu Dec 17 20:42:05 2015 >> New Revision: 292410 >> URL: https://svnweb.freebsd.org/changeset/base/292410 >>=20 >> Log: >> Exit cleanly if malloc() fails to allocate a buffer for a copy of the >> current MBR. >>=20 >> PR: 205322 >> Submitted by: Alexander Kuleshov >> MFC after: 1 week >>=20 >> Modified: >> head/usr.sbin/boot0cfg/boot0cfg.c >>=20 >> Modified: head/usr.sbin/boot0cfg/boot0cfg.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/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:33:20 2015 (= r292409) >> +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:42:05 2015 (= r292410) >> @@ -337,6 +337,8 @@ read_mbr(const char *disk, u_int8_t **mb >> return (mbr_size); >> } >> *mbr =3D malloc(sizeof(buf)); >> + if (mbr =3D=3D NULL) >> + errx(1, "%s: unable to allocate MBR buffer", disk); >> memcpy(*mbr, buf, sizeof(buf)); >> close(fd); > Hi,=20 >=20 > Should the check be against *mbr ? > + if (*mbr =3D=3D NULL) > + errx(1, "%s: unable to allocate MBR buffer", disk); Yup!= From owner-svn-src-all@freebsd.org Fri Dec 18 05:55:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C40A4B9FE; Fri, 18 Dec 2015 05:55:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C861EC1; Fri, 18 Dec 2015 05:55:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI5tOiW057349; Fri, 18 Dec 2015 05:55:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI5tOAv057347; Fri, 18 Dec 2015 05:55:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512180555.tBI5tOAv057347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 Dec 2015 05:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292428 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 05:55:26 -0000 Author: imp Date: Fri Dec 18 05:55:24 2015 New Revision: 292428 URL: https://svnweb.freebsd.org/changeset/base/292428 Log: No need to test command values this way. There can be only one, even though the encoding is bit-wise today... Modified: head/sys/dev/nand/nand_cdev.c head/sys/dev/nand/nand_geom.c Modified: head/sys/dev/nand/nand_cdev.c ============================================================================== --- head/sys/dev/nand/nand_cdev.c Fri Dec 18 05:45:49 2015 (r292427) +++ head/sys/dev/nand/nand_cdev.c Fri Dec 18 05:55:24 2015 (r292428) @@ -236,10 +236,10 @@ nand_strategy(struct bio *bp) chip = dev->si_drv1; nand_debug(NDBG_CDEV, "Strategy %s on chip %d [%p]\n", - (bp->bio_cmd & BIO_READ) == BIO_READ ? "READ" : "WRITE", + bp->bio_cmd == BIO_READ ? "READ" : "WRITE", chip->num, chip); - if ((bp->bio_cmd & BIO_READ) == BIO_READ) { + if (bp->bio_cmd == BIO_READ) { err = nand_read(chip, bp->bio_offset & 0xffffffff, bp->bio_data, bp->bio_bcount); Modified: head/sys/dev/nand/nand_geom.c ============================================================================== --- head/sys/dev/nand/nand_geom.c Fri Dec 18 05:45:49 2015 (r292427) +++ head/sys/dev/nand/nand_geom.c Fri Dec 18 05:55:24 2015 (r292428) @@ -100,9 +100,9 @@ nand_strategy(struct bio *bp) bp->bio_driver1 = BIO_NAND_STD; nand_debug(NDBG_GEOM, "Strategy %s on chip %d [%p]", - (bp->bio_cmd & BIO_READ) == BIO_READ ? "READ" : - ((bp->bio_cmd & BIO_WRITE) == BIO_WRITE ? "WRITE" : - ((bp->bio_cmd & BIO_DELETE) == BIO_DELETE ? "DELETE" : "UNKNOWN")), + bp->bio_cmd == BIO_READ ? "READ" : + (bp->bio_cmd == BIO_WRITE ? "WRITE" : + (bp->bio_cmd == BIO_DELETE ? "DELETE" : "UNKNOWN")), chip->num, chip); mtx_lock(&chip->qlock); @@ -122,9 +122,9 @@ nand_strategy_raw(struct bio *bp) bp->bio_driver1 = BIO_NAND_RAW; nand_debug(NDBG_GEOM, "Strategy %s on chip %d [%p]", - (bp->bio_cmd & BIO_READ) == BIO_READ ? "READ" : - ((bp->bio_cmd & BIO_WRITE) == BIO_WRITE ? "WRITE" : - ((bp->bio_cmd & BIO_DELETE) == BIO_DELETE ? "DELETE" : "UNKNOWN")), + bp->bio_cmd == BIO_READ ? "READ" : + (bp->bio_cmd == BIO_WRITE ? "WRITE" : + (bp->bio_cmd == BIO_DELETE ? "DELETE" : "UNKNOWN")), chip->num, chip); mtx_lock(&chip->qlock); @@ -320,21 +320,21 @@ nand_io_proc(void *arg, int pending) break; if (bp->bio_driver1 == BIO_NAND_STD) { - if ((bp->bio_cmd & BIO_READ) == BIO_READ) { + if (bp->bio_cmd == BIO_READ) { err = nand_read(chip, bp->bio_offset & 0xffffffff, bp->bio_data, bp->bio_bcount); - } else if ((bp->bio_cmd & BIO_WRITE) == BIO_WRITE) { + } else if (bp->bio_cmd == BIO_WRITE) { err = nand_write(chip, bp->bio_offset & 0xffffffff, bp->bio_data, bp->bio_bcount); } } else if (bp->bio_driver1 == BIO_NAND_RAW) { - if ((bp->bio_cmd & BIO_READ) == BIO_READ) { + if (bp->bio_cmd == BIO_READ) { err = nand_read_raw(chip, bp->bio_offset & 0xffffffff, bp->bio_data, bp->bio_bcount); - } else if ((bp->bio_cmd & BIO_WRITE) == BIO_WRITE) { + } else if (bp->bio_cmd == BIO_WRITE) { err = nand_write_raw(chip, bp->bio_offset & 0xffffffff, bp->bio_data, bp->bio_bcount); @@ -342,7 +342,7 @@ nand_io_proc(void *arg, int pending) } else panic("Unknown access type in bio->bio_driver1\n"); - if ((bp->bio_cmd & BIO_DELETE) == BIO_DELETE) { + if (bp->bio_cmd == BIO_DELETE) { nand_debug(NDBG_GEOM, "Delete on chip%d offset %lld " "length %ld\n", chip->num, bp->bio_offset, bp->bio_bcount); From owner-svn-src-all@freebsd.org Fri Dec 18 06:13:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02136A4A43A; Fri, 18 Dec 2015 06:13:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C80FC177E; Fri, 18 Dec 2015 06:13:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI6DIV2062979; Fri, 18 Dec 2015 06:13:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI6DI3Q062978; Fri, 18 Dec 2015 06:13:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512180613.tBI6DI3Q062978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 Dec 2015 06:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292429 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 06:13:20 -0000 Author: imp Date: Fri Dec 18 06:13:18 2015 New Revision: 292429 URL: https://svnweb.freebsd.org/changeset/base/292429 Log: Add a generic firmware dependent handle to pass from the loader to the kernel. This will be used for passing in things like the system table from EFI or other similar metadata that can be used by the kernel to communicate with the firmware. Modified: head/sys/sys/linker.h Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Fri Dec 18 05:55:24 2015 (r292428) +++ head/sys/sys/linker.h Fri Dec 18 06:13:18 2015 (r292429) @@ -215,6 +215,7 @@ void *linker_hwpmc_list_objects(void); #define MODINFOMD_SHDR 0x0009 /* section header table */ #define MODINFOMD_CTORS_ADDR 0x000a /* address of .ctors */ #define MODINFOMD_CTORS_SIZE 0x000b /* size of .ctors */ +#define MODINFOMD_FW_HANDLE 0x000c /* Firmware dependent handle */ #define MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */ #define MODINFOMD_DEPLIST (0x4001 | MODINFOMD_NOCOPY) /* depends on */ From owner-svn-src-all@freebsd.org Fri Dec 18 06:17:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECDBA4A684; Fri, 18 Dec 2015 06:17:17 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x241.google.com (mail-ob0-x241.google.com [IPv6:2607:f8b0:4003:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED80C1982; Fri, 18 Dec 2015 06:17:16 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ob0-x241.google.com with SMTP id ny9so6416157obb.0; Thu, 17 Dec 2015 22:17:16 -0800 (PST) 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=DV+3WG4T/hntYbiuwX+ye8wkYLRNgrSDtu5IydadX2E=; b=ifjX9WyJWs46sYwu/MULSzlFlEh0/XBTYMhR3rxrQNYSvWingMJjv3BecxAFW0Hkb/ LSE7n70VzHWEauIIvrbq2Uj/VZGKOsLUjWcuTcfWw1AF/MiEqA6TJ9KMSXwNOqJRmGGZ JvUAvtiiyBPscqjqQtvwO2BNzgUhmZcNDl+XL9f85PRIMjwHpDk6Z8UxVANmm7xPVHT6 0v80XkyuFUJ6j5FHDs0SqSZAXK1yntR4bv/ALr0Q2xmndljZSsp8VEQNbKRk7s2pmr+q OsUOWcfo0E1w6XYvJJ8fqYQY3IDoU+3VxGrRlW3l6aiA/o8lbdkaxzr32vIqDXz+Ee37 imlg== MIME-Version: 1.0 X-Received: by 10.60.39.200 with SMTP id r8mr799263oek.81.1450419436154; Thu, 17 Dec 2015 22:17:16 -0800 (PST) Received: by 10.182.7.33 with HTTP; Thu, 17 Dec 2015 22:17:16 -0800 (PST) Reply-To: araujo@FreeBSD.org In-Reply-To: <30CD0290-06B9-4024-8EEE-F25090608D46@gmail.com> References: <201512172042.tBHKg5bM091931@repo.freebsd.org> <30CD0290-06B9-4024-8EEE-F25090608D46@gmail.com> Date: Fri, 18 Dec 2015 14:17:16 +0800 Message-ID: Subject: Re: svn commit: r292410 - head/usr.sbin/boot0cfg From: Marcelo Araujo To: Garrett Cooper Cc: luke , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , John Baldwin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 06:17:17 -0000 2015-12-18 13:53 GMT+08:00 Garrett Cooper : > > > On Dec 17, 2015, at 21:36, luke wrote: > > > >> On Fri, Dec 18, 2015 at 4:42 AM, John Baldwin wrote: > >> Author: jhb > >> Date: Thu Dec 17 20:42:05 2015 > >> New Revision: 292410 > >> URL: https://svnweb.freebsd.org/changeset/base/292410 > >> > >> Log: > >> Exit cleanly if malloc() fails to allocate a buffer for a copy of the > >> current MBR. > >> > >> PR: 205322 > >> Submitted by: Alexander Kuleshov > >> MFC after: 1 week > >> > >> Modified: > >> head/usr.sbin/boot0cfg/boot0cfg.c > >> > >> Modified: head/usr.sbin/boot0cfg/boot0cfg.c > >> > ============================================================================== > >> --- head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:33:20 2015 > (r292409) > >> +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:42:05 2015 > (r292410) > >> @@ -337,6 +337,8 @@ read_mbr(const char *disk, u_int8_t **mb > >> return (mbr_size); > >> } > >> *mbr = malloc(sizeof(buf)); > >> + if (mbr == NULL) > >> + errx(1, "%s: unable to allocate MBR buffer", disk); > >> memcpy(*mbr, buf, sizeof(buf)); > >> close(fd); > > > > Hi, > > > > Should the check be against *mbr ? > > + if (*mbr == NULL) > > + errx(1, "%s: unable to allocate MBR buffer", disk); > > Yup! > +1 Could be write as: if ((*mbr = malloc(sizeof(buf))) == NULL) errx(1, "%s: unable to allocate MBR buffer", disk); Br, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Fri Dec 18 06:36:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 261F8A4B34D; Fri, 18 Dec 2015 06:36:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3BD41199; Fri, 18 Dec 2015 06:36:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x229.google.com with SMTP id wq6so55532996pac.1; Thu, 17 Dec 2015 22:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zewPloNwHITgsQ8/mjLTor5s1UNU+HJ6X1G9RCI4q4g=; b=E3zZlvlBHZDxVgwlUaeY4I/77WYrdlRMhS/sPhoFmMI49bvmwl/9FmRlOwgXQ3jPUP 1rOhLeKZoYLsf9xDxtnIEKC453IFD1BT94Sem2RE4GkVnG2ky9wpAw6G+S/eIQD0cjVY ctuG207u2KnMlW7h5oSuAc3hBkha/K2pVfANEp0VAqYDUegkTINZ6VrTbqALtXMyqWZO sfOcu/kKjUad1Zt1bR9x9Nq1vdub4UvLnwIVtpl4PJOpsCpKFr3s95rWkGA8N7FvFvpQ xx02nWXHcooZNp8zSvK3NAz/lIxqsnSV1X9qGazvaT9CQHFiV5Buxon3ksox0HnCpgih zr1Q== X-Received: by 10.66.144.65 with SMTP id sk1mr2742080pab.126.1450420606490; Thu, 17 Dec 2015 22:36:46 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:7d5d:f255:bbbe:e499? ([2601:601:800:126d:7d5d:f255:bbbe:e499]) by smtp.gmail.com with ESMTPSA id yn8sm19717080pac.32.2015.12.17.22.36.45 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 22:36:45 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r292428 - head/sys/dev/nand From: NGie Cooper In-Reply-To: <201512180555.tBI5tOAv057347@repo.freebsd.org> Date: Thu, 17 Dec 2015 22:36:44 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201512180555.tBI5tOAv057347@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 06:36:47 -0000 > On Dec 17, 2015, at 21:55, Warner Losh wrote: >=20 > Author: imp > Date: Fri Dec 18 05:55:24 2015 > New Revision: 292428 > URL: https://svnweb.freebsd.org/changeset/base/292428 >=20 > Log: > No need to test command values this way. There can be only one, even > though the encoding is bit-wise today... What if a third party has defined other BIOs in addition to these and = are doing bitwise ORs? I know $work specialized the buf layer =E2=80=94 = but we don=E2=80=99t use nandfs(4) today=E2=80=A6 not sure about = others... Thanks, -NGie= From owner-svn-src-all@freebsd.org Fri Dec 18 06:52:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA0BA4BD6B for ; Fri, 18 Dec 2015 06:52:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC13D1CE4 for ; Fri, 18 Dec 2015 06:52:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22e.google.com with SMTP id c96so26756577qgd.3 for ; Thu, 17 Dec 2015 22:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=RgWA4qE4f61RC+K0r99mP4jNAtFCaamaj4mCTWBEKW4=; b=iOQqIE/TClTmP3G8YqzKAG+eRbfhvar1hePApmm/oVL+TiHDIIWw0s21j7ufmZVwiW qeH2TAx3WKjI7hyEykGHm7/8ClFFmLHNu4FWKZoLt3gUNlmVCtpMVGw/1uS6opYQ1X34 Ly+Z4WH6AuTagZjPNTarIjmVo+HQsIGPz4uGU9f+cUrLR+v3qX5qiPp1YQvVFaP6SuDE WEVAJm18LvUGwmiJhhn+QS034GF159qp8sa/5j3+a3cKl6w89x0BurXK54fnAWX+jNMf WbOv3ySYJ4GWSyatHqsE1ybUYBWvZoB1RAO+IuuSu6Llxy2OWF6tLL/VigwK9boMQrsY uSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=RgWA4qE4f61RC+K0r99mP4jNAtFCaamaj4mCTWBEKW4=; b=KhVYMG+GqHYdOPYIweHc4lYVupOVLKYKWcQUcaLn6SpKkjIL29rkUyPz/31wW17xPf sI+E2HIpXjpmLpUBwFCUDbpVQC8o/fZwrOr0i8k3l57q6IQSsSKkySfwDL6uDmY7UBGL uQx38Tagsib02iEcLQUk9j7j03S4vZezt+FuGa/w6Tphbk/1Ua0DD64iktFNPAN3FLzJ qwGcKjgidrP6Vw5+5YNiE9Tm+Esj/ZmnR2BbawAbzUA/D0StnD/kjgJbhB5S+JomGdAc aiFxTt3tbby60sdxJPO+WPRKOo2Y7sYArGf9RuPADaxj6SLH12Loopy/u0RIV3iGAvis XBhg== X-Gm-Message-State: ALoCoQlsXQk1ioRiDBzqOLw7ZWBkh4q+w6fyqF25BWZoba72U2AJtYS+oUuO3IF+PDNvtkP6fOXAW7SpFe+hOig1FDbdqlGH6w== MIME-Version: 1.0 X-Received: by 10.140.40.38 with SMTP id w35mr2680859qgw.52.1450421546814; Thu, 17 Dec 2015 22:52:26 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Thu, 17 Dec 2015 22:52:26 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201512180555.tBI5tOAv057347@repo.freebsd.org> Date: Thu, 17 Dec 2015 23:52:26 -0700 X-Google-Sender-Auth: Wbazq1sza1J8tEFWEM9dMdaxXBg Message-ID: Subject: Re: svn commit: r292428 - head/sys/dev/nand From: Warner Losh To: NGie Cooper Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 06:52:28 -0000 On Thu, Dec 17, 2015 at 11:36 PM, NGie Cooper wrote= : > > > On Dec 17, 2015, at 21:55, Warner Losh wrote: > > > > Author: imp > > Date: Fri Dec 18 05:55:24 2015 > > New Revision: 292428 > > URL: https://svnweb.freebsd.org/changeset/base/292428 > > > > Log: > > No need to test command values this way. There can be only one, even > > though the encoding is bit-wise today... > > What if a third party has defined other BIOs in addition to these and are > doing bitwise ORs? I know $work specialized the buf layer =E2=80=94 but w= e don=E2=80=99t > use nandfs(4) today=E2=80=A6 not sure about others... > Those applications would fail. But they would fail hard in FreeBSD's default stack due to the pervasive use of switch statements and direct tests for equality. Only one bit can ever be set in the stack today and have things actually work as intended. The only reason they are assigned as bits was so that drivers could pass whole classes of commands up / down the stack by looking at a bitmask, rather than a series of if statements. This consideration isn't relevant to the changes I made, which merely obfuscated the tests for no benefit. Warner From owner-svn-src-all@freebsd.org Fri Dec 18 06:58:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1634A4A062; Fri, 18 Dec 2015 06:58:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0E21F08; Fri, 18 Dec 2015 06:58:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI6wiqD074760; Fri, 18 Dec 2015 06:58:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI6wiU1074754; Fri, 18 Dec 2015 06:58:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512180658.tBI6wiU1074754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 18 Dec 2015 06:58:44 +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: r292430 - stable/10/lib/libc/resolv 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 06:58:46 -0000 Author: ngie Date: Fri Dec 18 06:58:44 2015 New Revision: 292430 URL: https://svnweb.freebsd.org/changeset/base/292430 Log: MFC r292250: Allow users override `DEBUG` on the command line via DEBUG_FLAGS="-DDEBUG" with lib/libc/resolv by conditionalizing its definition Reviewed by: ume, vangyzen Differential Revision: https://reviews.freebsd.org/D4519 Modified: stable/10/lib/libc/resolv/res_init.c stable/10/lib/libc/resolv/res_mkquery.c stable/10/lib/libc/resolv/res_mkupdate.c stable/10/lib/libc/resolv/res_query.c stable/10/lib/libc/resolv/res_send.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_init.c ============================================================================== --- stable/10/lib/libc/resolv/res_init.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_init.c Fri Dec 18 06:58:44 2015 (r292430) @@ -115,7 +115,9 @@ __FBSDID("$FreeBSD$"); /*% Options. Should all be left alone. */ #define RESOLVSORT -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #ifdef SOLARIS2 #include Modified: stable/10/lib/libc/resolv/res_mkquery.c ============================================================================== --- stable/10/lib/libc/resolv/res_mkquery.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_mkquery.c Fri Dec 18 06:58:44 2015 (r292430) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif extern const char *_res_opcodes[]; Modified: stable/10/lib/libc/resolv/res_mkupdate.c ============================================================================== --- stable/10/lib/libc/resolv/res_mkupdate.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_mkupdate.c Fri Dec 18 06:58:44 2015 (r292430) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #define MAXPORT 1024 static int getnum_str(u_char **, u_char *); Modified: stable/10/lib/libc/resolv/res_query.c ============================================================================== --- stable/10/lib/libc/resolv/res_query.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_query.c Fri Dec 18 06:58:44 2015 (r292430) @@ -88,7 +88,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ Modified: stable/10/lib/libc/resolv/res_send.c ============================================================================== --- stable/10/lib/libc/resolv/res_send.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_send.c Fri Dec 18 06:58:44 2015 (r292430) @@ -119,7 +119,9 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #include "res_debug.h" #include "res_private.h" From owner-svn-src-all@freebsd.org Fri Dec 18 07:00:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B130A4A1ED; Fri, 18 Dec 2015 07:00:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CB1610FF; Fri, 18 Dec 2015 07:00:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI70htY075276; Fri, 18 Dec 2015 07:00:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI70hDH075271; Fri, 18 Dec 2015 07:00:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512180700.tBI70hDH075271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 18 Dec 2015 07:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292431 - stable/9/lib/libc/resolv 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 07:00:44 -0000 Author: ngie Date: Fri Dec 18 07:00:42 2015 New Revision: 292431 URL: https://svnweb.freebsd.org/changeset/base/292431 Log: MFstable/10 r292430: MFC r292250: Allow users override `DEBUG` on the command line via DEBUG_FLAGS="-DDEBUG" with lib/libc/resolv by conditionalizing its definition Reviewed by: ume, vangyzen Differential Revision: https://reviews.freebsd.org/D4519 Modified: stable/9/lib/libc/resolv/res_init.c stable/9/lib/libc/resolv/res_mkquery.c stable/9/lib/libc/resolv/res_mkupdate.c stable/9/lib/libc/resolv/res_query.c stable/9/lib/libc/resolv/res_send.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/resolv/res_init.c ============================================================================== --- stable/9/lib/libc/resolv/res_init.c Fri Dec 18 06:58:44 2015 (r292430) +++ stable/9/lib/libc/resolv/res_init.c Fri Dec 18 07:00:42 2015 (r292431) @@ -115,7 +115,9 @@ __FBSDID("$FreeBSD$"); /*% Options. Should all be left alone. */ #define RESOLVSORT -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #ifdef SOLARIS2 #include Modified: stable/9/lib/libc/resolv/res_mkquery.c ============================================================================== --- stable/9/lib/libc/resolv/res_mkquery.c Fri Dec 18 06:58:44 2015 (r292430) +++ stable/9/lib/libc/resolv/res_mkquery.c Fri Dec 18 07:00:42 2015 (r292431) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif extern const char *_res_opcodes[]; Modified: stable/9/lib/libc/resolv/res_mkupdate.c ============================================================================== --- stable/9/lib/libc/resolv/res_mkupdate.c Fri Dec 18 06:58:44 2015 (r292430) +++ stable/9/lib/libc/resolv/res_mkupdate.c Fri Dec 18 07:00:42 2015 (r292431) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #define MAXPORT 1024 static int getnum_str(u_char **, u_char *); Modified: stable/9/lib/libc/resolv/res_query.c ============================================================================== --- stable/9/lib/libc/resolv/res_query.c Fri Dec 18 06:58:44 2015 (r292430) +++ stable/9/lib/libc/resolv/res_query.c Fri Dec 18 07:00:42 2015 (r292431) @@ -88,7 +88,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ Modified: stable/9/lib/libc/resolv/res_send.c ============================================================================== --- stable/9/lib/libc/resolv/res_send.c Fri Dec 18 06:58:44 2015 (r292430) +++ stable/9/lib/libc/resolv/res_send.c Fri Dec 18 07:00:42 2015 (r292431) @@ -119,7 +119,9 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #include "res_debug.h" #include "res_private.h" From owner-svn-src-all@freebsd.org Fri Dec 18 09:48:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D936DA4BC27; Fri, 18 Dec 2015 09:48:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A48319CC; Fri, 18 Dec 2015 09:48:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI9m8nB024888; Fri, 18 Dec 2015 09:48:08 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI9m24i024822; Fri, 18 Dec 2015 09:48:02 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512180948.tBI9m24i024822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 18 Dec 2015 09:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292432 - in head/contrib/openbsm: . bin bin/audit bin/auditd bin/auditdistd bin/auditfilterd bin/auditreduce bin/praudit bsm compat etc libauditd libbsm man modules modules/auditfilter... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 09:48:10 -0000 Author: brueffer Date: Fri Dec 18 09:48:01 2015 New Revision: 292432 URL: https://svnweb.freebsd.org/changeset/base/292432 Log: Merge OpenBSM 1.2 alpha 4. MFC after: 2 weeks Relnotes: yes Added: head/contrib/openbsm/.travis.yml - copied unchanged from r292016, vendor/openbsm/dist/.travis.yml head/contrib/openbsm/libbsm/au_notify.3 - copied unchanged from r292016, vendor/openbsm/dist/libbsm/au_notify.3 Modified: head/contrib/openbsm/INSTALL head/contrib/openbsm/LICENSE head/contrib/openbsm/Makefile.am head/contrib/openbsm/Makefile.in head/contrib/openbsm/NEWS head/contrib/openbsm/README head/contrib/openbsm/TODO head/contrib/openbsm/VERSION head/contrib/openbsm/autogen.sh head/contrib/openbsm/bin/Makefile.am head/contrib/openbsm/bin/audit/Makefile.am head/contrib/openbsm/bin/audit/audit.8 head/contrib/openbsm/bin/audit/audit.c head/contrib/openbsm/bin/auditd/Makefile.am head/contrib/openbsm/bin/auditd/audit_triggers.defs head/contrib/openbsm/bin/auditd/audit_warn.c head/contrib/openbsm/bin/auditd/auditd.8 head/contrib/openbsm/bin/auditd/auditd.c head/contrib/openbsm/bin/auditd/auditd.h head/contrib/openbsm/bin/auditd/auditd_control.defs head/contrib/openbsm/bin/auditd/auditd_darwin.c head/contrib/openbsm/bin/auditd/auditd_fbsd.c head/contrib/openbsm/bin/auditdistd/Makefile.am head/contrib/openbsm/bin/auditdistd/auditdistd.8 head/contrib/openbsm/bin/auditdistd/auditdistd.c head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 head/contrib/openbsm/bin/auditdistd/auditdistd.h head/contrib/openbsm/bin/auditdistd/faccessat.h head/contrib/openbsm/bin/auditdistd/fstatat.h head/contrib/openbsm/bin/auditdistd/openat.h head/contrib/openbsm/bin/auditdistd/parse.y head/contrib/openbsm/bin/auditdistd/pjdlog.c head/contrib/openbsm/bin/auditdistd/pjdlog.h head/contrib/openbsm/bin/auditdistd/proto.c head/contrib/openbsm/bin/auditdistd/proto.h head/contrib/openbsm/bin/auditdistd/proto_common.c head/contrib/openbsm/bin/auditdistd/proto_impl.h head/contrib/openbsm/bin/auditdistd/proto_socketpair.c head/contrib/openbsm/bin/auditdistd/proto_tcp.c head/contrib/openbsm/bin/auditdistd/proto_tls.c head/contrib/openbsm/bin/auditdistd/proto_uds.c head/contrib/openbsm/bin/auditdistd/receiver.c head/contrib/openbsm/bin/auditdistd/renameat.h head/contrib/openbsm/bin/auditdistd/sandbox.c head/contrib/openbsm/bin/auditdistd/sandbox.h head/contrib/openbsm/bin/auditdistd/sender.c head/contrib/openbsm/bin/auditdistd/sigtimedwait.h head/contrib/openbsm/bin/auditdistd/strndup.h head/contrib/openbsm/bin/auditdistd/subr.c head/contrib/openbsm/bin/auditdistd/subr.h head/contrib/openbsm/bin/auditdistd/synch.h head/contrib/openbsm/bin/auditdistd/token.l head/contrib/openbsm/bin/auditdistd/trail.c head/contrib/openbsm/bin/auditdistd/trail.h head/contrib/openbsm/bin/auditdistd/unlinkat.h head/contrib/openbsm/bin/auditfilterd/Makefile.am head/contrib/openbsm/bin/auditfilterd/auditfilterd.8 head/contrib/openbsm/bin/auditfilterd/auditfilterd.c head/contrib/openbsm/bin/auditfilterd/auditfilterd.h head/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c head/contrib/openbsm/bin/auditreduce/Makefile.am head/contrib/openbsm/bin/auditreduce/auditreduce.1 head/contrib/openbsm/bin/auditreduce/auditreduce.c head/contrib/openbsm/bin/auditreduce/auditreduce.h head/contrib/openbsm/bin/praudit/Makefile.am head/contrib/openbsm/bin/praudit/praudit.1 head/contrib/openbsm/bin/praudit/praudit.c head/contrib/openbsm/bsm/Makefile.am head/contrib/openbsm/bsm/audit_filter.h head/contrib/openbsm/bsm/audit_uevents.h head/contrib/openbsm/bsm/auditd_lib.h head/contrib/openbsm/bsm/libbsm.h head/contrib/openbsm/compat/clock_gettime.h head/contrib/openbsm/compat/closefrom.h head/contrib/openbsm/compat/compat.h head/contrib/openbsm/compat/endian.h head/contrib/openbsm/compat/endian_enc.h head/contrib/openbsm/compat/flopen.h head/contrib/openbsm/compat/pidfile.h head/contrib/openbsm/compat/queue.h head/contrib/openbsm/compat/strlcat.h head/contrib/openbsm/compat/strlcpy.h head/contrib/openbsm/configure head/contrib/openbsm/configure.ac head/contrib/openbsm/etc/audit_class head/contrib/openbsm/etc/audit_control head/contrib/openbsm/etc/audit_event head/contrib/openbsm/etc/audit_filter head/contrib/openbsm/etc/audit_user head/contrib/openbsm/etc/audit_warn head/contrib/openbsm/libauditd/Makefile.am head/contrib/openbsm/libauditd/auditd_lib.c head/contrib/openbsm/libauditd/libauditd.3 head/contrib/openbsm/libbsm/Makefile.am head/contrib/openbsm/libbsm/Makefile.in head/contrib/openbsm/libbsm/au_class.3 head/contrib/openbsm/libbsm/au_control.3 head/contrib/openbsm/libbsm/au_domain.3 head/contrib/openbsm/libbsm/au_errno.3 head/contrib/openbsm/libbsm/au_event.3 head/contrib/openbsm/libbsm/au_fcntl_cmd.3 head/contrib/openbsm/libbsm/au_free_token.3 head/contrib/openbsm/libbsm/au_io.3 head/contrib/openbsm/libbsm/au_mask.3 head/contrib/openbsm/libbsm/au_open.3 head/contrib/openbsm/libbsm/au_socket_type.3 head/contrib/openbsm/libbsm/au_token.3 head/contrib/openbsm/libbsm/au_user.3 head/contrib/openbsm/libbsm/audit_submit.3 head/contrib/openbsm/libbsm/bsm_audit.c head/contrib/openbsm/libbsm/bsm_class.c head/contrib/openbsm/libbsm/bsm_control.c head/contrib/openbsm/libbsm/bsm_domain.c head/contrib/openbsm/libbsm/bsm_errno.c head/contrib/openbsm/libbsm/bsm_event.c head/contrib/openbsm/libbsm/bsm_fcntl.c head/contrib/openbsm/libbsm/bsm_flags.c head/contrib/openbsm/libbsm/bsm_io.c head/contrib/openbsm/libbsm/bsm_mask.c head/contrib/openbsm/libbsm/bsm_notify.c head/contrib/openbsm/libbsm/bsm_socket_type.c head/contrib/openbsm/libbsm/bsm_token.c head/contrib/openbsm/libbsm/bsm_user.c head/contrib/openbsm/libbsm/bsm_wrappers.c head/contrib/openbsm/libbsm/libbsm.3 head/contrib/openbsm/man/Makefile.am head/contrib/openbsm/man/Makefile.in head/contrib/openbsm/man/audit.2 head/contrib/openbsm/man/audit.log.5 head/contrib/openbsm/man/audit_class.5 head/contrib/openbsm/man/audit_control.5 head/contrib/openbsm/man/audit_event.5 head/contrib/openbsm/man/audit_user.5 head/contrib/openbsm/man/audit_warn.5 head/contrib/openbsm/man/auditctl.2 head/contrib/openbsm/man/auditon.2 head/contrib/openbsm/man/getaudit.2 head/contrib/openbsm/man/getauid.2 head/contrib/openbsm/man/setaudit.2 head/contrib/openbsm/man/setauid.2 head/contrib/openbsm/modules/Makefile.am head/contrib/openbsm/modules/auditfilter_noop/Makefile.am head/contrib/openbsm/modules/auditfilter_noop/auditfilter_noop.c head/contrib/openbsm/sys/Makefile.am head/contrib/openbsm/sys/bsm/Makefile.am head/contrib/openbsm/sys/bsm/audit.h head/contrib/openbsm/sys/bsm/audit_domain.h head/contrib/openbsm/sys/bsm/audit_errno.h head/contrib/openbsm/sys/bsm/audit_fcntl.h head/contrib/openbsm/sys/bsm/audit_internal.h head/contrib/openbsm/sys/bsm/audit_kevents.h head/contrib/openbsm/sys/bsm/audit_record.h head/contrib/openbsm/sys/bsm/audit_socket_type.h head/contrib/openbsm/test/Makefile.am head/contrib/openbsm/test/bsm/Makefile.am head/contrib/openbsm/test/bsm/generate.c head/contrib/openbsm/tools/Makefile.am head/contrib/openbsm/tools/audump.c Directory Properties: head/contrib/openbsm/ (props changed) Copied: head/contrib/openbsm/.travis.yml (from r292016, vendor/openbsm/dist/.travis.yml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openbsm/.travis.yml Fri Dec 18 09:48:01 2015 (r292432, copy of r292016, vendor/openbsm/dist/.travis.yml) @@ -0,0 +1,18 @@ +language: c + +compiler: + - clang + - gcc + +os: + - linux + - osx + +before_install: + - if [ $TRAVIS_OS_NAME == "linux" ]; then + sudo apt-get -qq update; + sudo apt-get -qq install byacc flex; + elif [ $TRAVIS_OS_NAME == "osx" ]; then + brew update; + brew install byacc flex; + fi Modified: head/contrib/openbsm/INSTALL ============================================================================== --- head/contrib/openbsm/INSTALL Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/INSTALL Fri Dec 18 09:48:01 2015 (r292432) @@ -3,7 +3,7 @@ OpenBSM Build and Installation Instructi OpenBSM is currently built using autoconf and automake, which should allow for building on a range of operating systems, including FreeBSD, Mac OS X, and Linux. Some components are built only if appropriate kernel audit -suppport is found. Typical builds will be performed using: +support is found. Typical builds will be performed using: ./configure make @@ -31,7 +31,7 @@ not configurable. You may wish to specify that the OpenBSM components not be installed in the base system, rather in a specific directory. This may be done using the --prefix argument to configure. If installing to a specific directory, -remember to update your library path so that running tools from that +remember to update your library path so that when running tools from that directory the correct libbsm is used: ./configure --prefix=/home/rwatson/openbsm Modified: head/contrib/openbsm/LICENSE ============================================================================== --- head/contrib/openbsm/LICENSE Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/LICENSE Fri Dec 18 09:48:01 2015 (r292432) @@ -34,5 +34,3 @@ as a whole: The TrustedBSD Project would appreciate the contribution of fixes and enhancements under an identical license in order to avoid potentially confusing license proliferation. - -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: head/contrib/openbsm/Makefile.am ============================================================================== --- head/contrib/openbsm/Makefile.am Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/Makefile.am Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ -## - SUBDIRS = \ bsm Modified: head/contrib/openbsm/Makefile.in ============================================================================== --- head/contrib/openbsm/Makefile.in Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/Makefile.in Fri Dec 18 09:48:01 2015 (r292432) @@ -59,9 +59,9 @@ DIST_COMMON = README $(am__configure_dep $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ - NEWS TODO config/config.guess config/config.sub config/depcomp \ - config/install-sh config/ltmain.sh config/missing \ - config/ylwrap + NEWS TODO config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/ltmain.sh \ + config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ Modified: head/contrib/openbsm/NEWS ============================================================================== --- head/contrib/openbsm/NEWS Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/NEWS Fri Dec 18 09:48:01 2015 (r292432) @@ -1,5 +1,16 @@ OpenBSM Version History +OpenBSM 1.2 alpha 4 + +- Fix praudit to emit correct XML. +- Fix auditdistd bugs related to IPv6 support, locking, and a kqueue-related + descriptor leak. +- Add audit event definitions for Capsicum-related syscalls, as well as + AUE_BINDAT and AUE_CONNECTAT. +- Manpage symlinks for all libbsm functions are installed again after the + move to autotools in OpenBSM 1.0 Alpha 5. +- A variety of minor documentation cleanups. + OpenBSM 1.2 alpha 3 - Various minor tweaks to the auditdistd build to make it fit the FreeBSD @@ -494,5 +505,3 @@ OpenBSM 1.0 alpha 1 - auditd(8), audit(8) added to the OpenBSM distribution. auditd extended to support reloading of kernel event table. - Allow comments in /etc/security configuration files. - -$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: head/contrib/openbsm/README ============================================================================== --- head/contrib/openbsm/README Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/README Fri Dec 18 09:48:01 2015 (r292432) @@ -1,4 +1,4 @@ -OpenBSM 1.2a2 +OpenBSM Introduction @@ -10,7 +10,7 @@ of several organizations. OpenBSM includes several command line tools, including auditreduce(8) and praudit(8) for reducing and printing audit trails, as well as the libbsm(3) library to manage configuration files, generate audit records, and parse and -print audit trils. +print audit trails. Coupled with a kernel audit implementation, OpenBSM can be used to maintain system audit streams, and is a foundation for a full audit-enabled system. @@ -64,5 +64,3 @@ Information on OpenBSM may be found on t Information on TrustedBSD may be found on the TrustedBSD home page: http://www.TrustedBSD.org/ - -$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: head/contrib/openbsm/TODO ============================================================================== --- head/contrib/openbsm/TODO Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/TODO Fri Dec 18 09:48:01 2015 (r292432) @@ -7,8 +7,6 @@ OpenBSM TODO - Document contents of libbsm "public" data structures in libbsm man pages. - The audit.log.5 man page is incomplete, as it does not describe all token types. -- With the move to autoconf/automake, man page symlinks are no longer - installed. This needs to be fixed. - It might be desirable to be able to provide EOPNOTSUPP system call stubs on systems that don't have the necessary audit system calls; that would allow the full libbsm and tool set to build, just not run. @@ -23,5 +21,3 @@ OpenBSM TODO not available on the local OS platform. - Support for client certificates in auditdistd, to include certificate chain validation. - -$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: head/contrib/openbsm/VERSION ============================================================================== --- head/contrib/openbsm/VERSION Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/VERSION Fri Dec 18 09:48:01 2015 (r292432) @@ -1 +1 @@ -OPENBSM_1_2_alpha3 +OPENBSM_1_2_alpha4 Modified: head/contrib/openbsm/autogen.sh ============================================================================== --- head/contrib/openbsm/autogen.sh Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/autogen.sh Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,4 @@ #!/bin/sh -# -# $P4: //depot/projects/trustedbsd/openbsm/autogen.sh#2 $ -# libtoolize --copy --force aclocal Modified: head/contrib/openbsm/bin/Makefile.am ============================================================================== --- head/contrib/openbsm/bin/Makefile.am Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/Makefile.am Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/Makefile.am#4 $ -## - SUBDIRS = \ auditdistd \ auditfilterd \ Modified: head/contrib/openbsm/bin/audit/Makefile.am ============================================================================== --- head/contrib/openbsm/bin/audit/Makefile.am Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/audit/Makefile.am Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/audit/Makefile.am#7 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: head/contrib/openbsm/bin/audit/audit.8 ============================================================================== --- head/contrib/openbsm/bin/audit/audit.8 Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/audit/audit.8 Fri Dec 18 09:48:01 2015 (r292432) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.8#16 $ -.\" -.Dd January 29, 2009 +.Dd July 25, 2015 .Dt AUDIT 8 .Os .Sh NAME @@ -88,7 +86,7 @@ Audit policy file used to configure the .Xr audit 4 , .Xr audit_control 5 , .Xr auditd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: head/contrib/openbsm/bin/audit/audit.c ============================================================================== --- head/contrib/openbsm/bin/audit/audit.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/audit/audit.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.c#15 $ */ /* * Program to trigger the audit daemon with a message that is either: Modified: head/contrib/openbsm/bin/auditd/Makefile.am ============================================================================== --- head/contrib/openbsm/bin/auditd/Makefile.am Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/Makefile.am Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/Makefile.am#6 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: head/contrib/openbsm/bin/auditd/audit_triggers.defs ============================================================================== --- head/contrib/openbsm/bin/auditd/audit_triggers.defs Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/audit_triggers.defs Fri Dec 18 09:48:01 2015 (r292432) @@ -1,5 +1 @@ -/* - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_triggers.defs#1 $ - */ - #include Modified: head/contrib/openbsm/bin/auditd/audit_warn.c ============================================================================== --- head/contrib/openbsm/bin/auditd/audit_warn.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/audit_warn.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#11 $ */ #include Modified: head/contrib/openbsm/bin/auditd/auditd.8 ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.8 Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/auditd.8 Fri Dec 18 09:48:01 2015 (r292432) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ -.\" -.Dd December 11, 2008 +.Dd July 25, 2015 .Dt AUDITD 8 .Os .Sh NAME @@ -123,7 +121,7 @@ and are no longer available as arguments .Xr audit_warn 5 , .Xr audit 8 , .Xr auditdistd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: head/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/auditd.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#50 $ */ #include Modified: head/contrib/openbsm/bin/auditd/auditd.h ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/auditd.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#13 $ */ #ifndef _AUDITD_H_ Modified: head/contrib/openbsm/bin/auditd/auditd_control.defs ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd_control.defs Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/auditd_control.defs Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_control.defs#2 $ */ /* Modified: head/contrib/openbsm/bin/auditd/auditd_darwin.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd_darwin.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/auditd_darwin.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#5 $ */ #include Modified: head/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd_fbsd.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditd/auditd_fbsd.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#4 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/Makefile.am ============================================================================== --- head/contrib/openbsm/bin/auditdistd/Makefile.am Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/Makefile.am Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/Makefile.am#1 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.8 ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.8 Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.8 Fri Dec 18 09:48:01 2015 (r292432) @@ -41,7 +41,7 @@ .Sh DESCRIPTION The .Nm -daemon is responsible for distributing audit trail files over TCP/IP network in +daemon is responsible for distributing audit trail files over a TCP/IP network in a secure and reliable way. .Pp The @@ -49,7 +49,7 @@ The daemon can be started with the following command line arguments: .Bl -tag -width ".Fl P Ar pidfile" .It Fl c Ar config -Specify alternative location of the configuration file. +Specify an alternative location of the configuration file. The default location is .Pa /etc/security/auditdistd.conf . Note: the configuration file may contain passwords. @@ -74,7 +74,7 @@ usage message. Start in a launchd-friendly mode, ie. do not use .Xr daemon 3 . .It Fl P Ar pidfile -Specify alternative location of a file where main process PID will be +Specify an alternative location of a file where main process PID will be stored. The default location is .Pa /var/run/auditdistd.pid . Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Fri Dec 18 09:48:01 2015 (r292432) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2011 +.Dd July 1, 2015 .Dt AUDITDISTD.CONF 5 .Os .Sh NAME @@ -37,19 +37,21 @@ daemon. .Sh DESCRIPTION Note: the configuration file may contain passwords. -Care should be taken to configure proper permissions on this file -.Li ( eg. 0600 ) . +Care should be taken to configure proper permissions for this file +.Li ( e.g., 0600 ) . .Pp -Every line starting with # is treated as comment and ignored. +Every line starting with +.Li # +gets treated as a comment and is ignored. .Sh CONFIGURATION FILE SYNTAX -General syntax of the +The general syntax of the .Nm -file is following: -.Bd -literal -offset +file is as follows: +.Bd -literal ## Global section. # Our name. -# The default is first part of the hostname. +# The default is the first part of the hostname. name "" # Connection timeout. @@ -71,11 +73,11 @@ sender { # The default is /var/audit/dist. directory "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" @@ -86,7 +88,7 @@ sender { # Optional. source "" - # Address of auditdistd receiver. + # Address of the auditdistd receiver. # No default. Obligatory. remote "" @@ -95,7 +97,7 @@ sender { directory "" # Fingerprint of the receiver's public key when using TLS - # for connection. + # for connections. # Example fingerprint: # SHA256=8F:0A:FC:8A:3D:09:80:AF:D9:AA:38:CC:8A:86:53:E6:8F:B6:1C:55:30:14:D7:F9:AA:8B:3E:73:CD:F5:76:2B fingerprint "" @@ -103,37 +105,37 @@ sender { # Password used to authenticate in front of the receiver. password "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" } - # Currently local audit trail files can be send only to one remote + # Currently local audit trail files can be sent only to one remote # auditdistd receiver, but this can change in the future. } receiver { ## Receiver section. - # Address to listen on. Multiple listen addresses might be specified. + # Address to listen on. Multiple listen addresses may be specified. # The defaults are "tcp4://0.0.0.0:7878" and "tcp6://[::]:7878". listen "" # Base directory. - # If directory in host section is no absolute, it will be concatenated - # with this base directory. + # If the directory in the host section is not absolute, it will be + # concatenated with this base directory. # The default is "/var/audit/remote". directory "" - # Path to receiver's certificate file. + # Path to the receiver's certificate file. # The default is "/etc/security/auditdistd.cert.pem". certfile "" - # Path to receiver's private key file. + # Path to the receiver's private key file. # The default is "/etc/security/auditdistd.key.pem". keyfile "" @@ -158,7 +160,7 @@ receiver { .Ed .Pp Most of the various available configuration parameters are optional. -If parameter is not defined in the particular section, it will be +If a parameter is not defined in the particular section, it will be inherited from the parent section if possible. For example, if the .Ic source @@ -172,14 +174,14 @@ In case the section does not define the .Ic source parameter at all, the default value will be used. -.Sh CONFIGURATION FILE DESCRIPTION +.Sh CONFIGURATION OPTION DESCRIPTION The following statements are available: .Bl -tag -width ".Ic xxxx" .It Ic name Aq name .Pp This host's name. -It is send to the receiver, so it can properly recognize us if there are -more than one sender coming from the same IP address. +It is sent to the receiver, so it can properly recognize us if there are +multiple senders coming from the same IP address. .It Ic timeout Aq seconds .Pp Connection timeout in seconds. @@ -198,17 +200,17 @@ The default value is Local address to bind to before connecting to the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. .It Ic directory Aq path .Pp -Directory where to look for audit trail files in case of sender mode or -directory where to store received audit trail files. +The directory where to look for audit trail files in case of sender mode, or +the directory where to store received audit trail files. The provided path has to be an absolute path. -The only exception is when directory is provided in the +The only exception is when the directory is provided in the .Ic receiver -section, then path provided in the +section; then the path provided in the .Ic host subsections can be relative to the directory in the .Ic receiver @@ -229,13 +231,13 @@ subsections in the .Ic receiver section where .Aq name -is host's name. +is the host's name. .\".It Ic checksum Aq algorithm .\".Pp .\"Checksum algorithm should be one of the following: .\".Bl -tag -width ".Ic sha256" .\".It Ic none -.\"No checksum will be calculated for the data being send over the network. +.\"No checksum will be calculated for the data being sent over the network. .\"This is the default setting. .\".It Ic crc32 .\"CRC32 checksum will be calculated. @@ -247,30 +249,30 @@ is host's name. .\"Compression algorithm should be one of the following: .\".Bl -tag -width ".Ic none" .\".It Ic none -.\"Data send over the network will not be compressed. +.\"Data sent over the network will not be compressed. .\"This is the default setting. .\".It Ic lzf .\"The .\".Nm LZF .\"algorithm by .\".An Marc Alexander Lehmann -.\"will be used to compress the data send over the network. +.\"will be used to compress the data sent over the network. .\".Nm LZF -.\"is very fast, general purpose compression algorithm. +.\"is a very fast, general purpose compression algorithm. .\".El .It Ic remote Aq addr .Pp Address of the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. -When operating in the +When operating in .Ic sender mode this address will be used to connect to the .Ic receiver . -When operating in the +When operating in .Ic receiver mode only connections from this address will be accepted. .It Ic listen Aq addr @@ -296,21 +298,22 @@ By default listens on .Pa tcp4://0.0.0.0:7878 and -.Pa tcp6://[::]:7878 -if kernel supports IPv4 and IPv6 respectively. +.Pa tcp6://[::]:7878 , +if the kernel supports IPv4 and IPv6 respectively. .It Ic keyfile Aq path .Pp -Path to a file that contains private key for TLS communication. +Path to a file that contains the private key for TLS communication. .It Ic certfile Aq path .Pp -Path to a file that contains certificate for TLS communication. +Path to a file that contains the certificate for TLS communication. .It Ic fingerprint Aq algo=hash .Pp -Finger print of the receiver's public key. -Currently only SHA256 algorithm is supported. -Certificate public key's fingerprint ready to be pasted into auditdistd +Fingerprint of the receiver's public key. +Currently only the SHA256 algorithm is supported. +The certificate public key's fingerprint ready to be pasted into the +.Nm auditdistd configuration file can be obtained by running: -.Bd -literal -offset +.Bd -literal # openssl x509 -in /etc/security/auditdistd.cert.pem -noout -fingerprint -sha256 | awk -F '[ =]' '{printf("%s=%s\\n", $1, $3)}' .Ed .It Ic password Aq password @@ -352,10 +355,10 @@ receiver { .Ed .Sh SEE ALSO .Xr audit 4 , -.Xr auditdistd 8 . +.Xr auditdistd 8 .Sh AUTHORS The .Nm auditdistd -was developed by +daemon was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.h#2 $ */ #ifndef _AUDITDISTD_H_ Modified: head/contrib/openbsm/bin/auditdistd/faccessat.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/faccessat.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/faccessat.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/faccessat.h#1 $ */ #ifndef _FACCESSAT_H_ Modified: head/contrib/openbsm/bin/auditdistd/fstatat.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/fstatat.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/fstatat.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/fstatat.h#1 $ */ #ifndef _FSTATAT_H_ Modified: head/contrib/openbsm/bin/auditdistd/openat.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/openat.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/openat.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/openat.h#1 $ */ #ifndef _OPENAT_H_ Modified: head/contrib/openbsm/bin/auditdistd/parse.y ============================================================================== --- head/contrib/openbsm/bin/auditdistd/parse.y Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/parse.y Fri Dec 18 09:48:01 2015 (r292432) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/pjdlog.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/pjdlog.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/pjdlog.c Fri Dec 18 09:48:01 2015 (r292432) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.c#1 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/pjdlog.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/pjdlog.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/pjdlog.h Fri Dec 18 09:48:01 2015 (r292432) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.h#1 $ */ #ifndef _PJDLOG_H_ Modified: head/contrib/openbsm/bin/auditdistd/proto.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.c#1 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/proto.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.h#1 $ */ #ifndef _PROTO_H_ Modified: head/contrib/openbsm/bin/auditdistd/proto_common.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_common.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto_common.c Fri Dec 18 09:48:01 2015 (r292432) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_common.c#1 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/proto_impl.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_impl.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto_impl.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_impl.h#1 $ */ #ifndef _PROTO_IMPL_H_ Modified: head/contrib/openbsm/bin/auditdistd/proto_socketpair.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_socketpair.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto_socketpair.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_socketpair.c#1 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/proto_tcp.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_tcp.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto_tcp.c Fri Dec 18 09:48:01 2015 (r292432) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#2 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/proto_tls.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_tls.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto_tls.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#2 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/proto_uds.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_uds.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/proto_uds.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#2 $ */ /* UDS - UNIX Domain Socket */ Modified: head/contrib/openbsm/bin/auditdistd/receiver.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/receiver.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/receiver.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#3 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/renameat.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/renameat.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/renameat.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/renameat.h#1 $ */ #ifndef _RENAMEAT_H_ Modified: head/contrib/openbsm/bin/auditdistd/sandbox.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/sandbox.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/sandbox.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#3 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/sandbox.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/sandbox.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/sandbox.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.h#1 $ */ #ifndef _SANDBOX_H_ Modified: head/contrib/openbsm/bin/auditdistd/sender.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/sender.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/sender.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#3 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/sigtimedwait.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/sigtimedwait.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/sigtimedwait.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#2 $ */ #ifndef _SIGTIMEDWAIT_H_ Modified: head/contrib/openbsm/bin/auditdistd/strndup.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/strndup.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/strndup.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/strndup.h#1 $ */ #ifndef _STRNDUP_H_ Modified: head/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/subr.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/subr.c Fri Dec 18 09:48:01 2015 (r292432) @@ -22,8 +22,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#3 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/subr.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/subr.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/subr.h Fri Dec 18 09:48:01 2015 (r292432) @@ -22,8 +22,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.h#1 $ */ #ifndef _AUDITDISTD_SUBR_H_ Modified: head/contrib/openbsm/bin/auditdistd/synch.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/synch.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/synch.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#3 $ */ #ifndef _SYNCH_H_ Modified: head/contrib/openbsm/bin/auditdistd/token.l ============================================================================== --- head/contrib/openbsm/bin/auditdistd/token.l Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/token.l Fri Dec 18 09:48:01 2015 (r292432) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/trail.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/trail.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/trail.c Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#3 $ */ #include Modified: head/contrib/openbsm/bin/auditdistd/trail.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/trail.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/trail.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.h#1 $ */ #ifndef _AUDITDISTD_TRAIL_H_ Modified: head/contrib/openbsm/bin/auditdistd/unlinkat.h ============================================================================== --- head/contrib/openbsm/bin/auditdistd/unlinkat.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditdistd/unlinkat.h Fri Dec 18 09:48:01 2015 (r292432) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/unlinkat.h#1 $ */ #ifndef _UNLINKAT_H_ Modified: head/contrib/openbsm/bin/auditfilterd/Makefile.am ============================================================================== --- head/contrib/openbsm/bin/auditfilterd/Makefile.am Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditfilterd/Makefile.am Fri Dec 18 09:48:01 2015 (r292432) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/Makefile.am#4 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: head/contrib/openbsm/bin/auditfilterd/auditfilterd.8 ============================================================================== --- head/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Fri Dec 18 09:48:01 2015 (r292432) @@ -23,8 +23,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.8#6 $ -.\" .Dd October 3, 2006 .Dt AUDITFILTERD 8 .Os Modified: head/contrib/openbsm/bin/auditfilterd/auditfilterd.c ============================================================================== --- head/contrib/openbsm/bin/auditfilterd/auditfilterd.c Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditfilterd/auditfilterd.c Fri Dec 18 09:48:01 2015 (r292432) @@ -24,8 +24,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.c#13 $ */ /* @@ -131,7 +129,7 @@ present_rawrecord(struct timespec *ts, u } /* - * Parse the BSM into a set of tokens, which will be pased to registered + * Parse the BSM into a set of tokens, which will be passed to registered * and interested filters. */ #define MAX_TOKENS 128 /* Maximum tokens we handle per record. */ Modified: head/contrib/openbsm/bin/auditfilterd/auditfilterd.h ============================================================================== --- head/contrib/openbsm/bin/auditfilterd/auditfilterd.h Fri Dec 18 07:00:42 2015 (r292431) +++ head/contrib/openbsm/bin/auditfilterd/auditfilterd.h Fri Dec 18 09:48:01 2015 (r292432) @@ -24,8 +24,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.h#5 $ */ #define AUDITFILTERD_CONFFILE "/etc/security/audit_filter" Modified: head/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c ============================================================================== --- head/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c Fri Dec 18 07:00:42 2015 (r292431) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 18 09:49:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D44A4BD24; Fri, 18 Dec 2015 09:49:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA1A1B4A; Fri, 18 Dec 2015 09:49:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI9nBJK024969; Fri, 18 Dec 2015 09:49:11 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI9nBXn024968; Fri, 18 Dec 2015 09:49:11 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512180949.tBI9nBXn024968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 18 Dec 2015 09:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292433 - head/contrib/openbsm/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 09:49:12 -0000 Author: brueffer Date: Fri Dec 18 09:49:11 2015 New Revision: 292433 URL: https://svnweb.freebsd.org/changeset/base/292433 Log: Regenerate config.h for OpenBSM 1.2 alpha 4. MFC after: 2 weeks Modified: head/contrib/openbsm/config/config.h Modified: head/contrib/openbsm/config/config.h ============================================================================== --- head/contrib/openbsm/config/config.h Fri Dec 18 09:48:01 2015 (r292432) +++ head/contrib/openbsm/config/config.h Fri Dec 18 09:49:11 2015 (r292433) @@ -229,13 +229,13 @@ #define PACKAGE "OpenBSM" /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "trustedbsd-audit@TrustesdBSD.org" +#define PACKAGE_BUGREPORT "trustedbsd-audit@TrustedBSD.org" /* Define to the full name of this package. */ #define PACKAGE_NAME "OpenBSM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "OpenBSM 1.2-alpha3" +#define PACKAGE_STRING "OpenBSM 1.2-alpha4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "openbsm" @@ -244,7 +244,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.2-alpha3" +#define PACKAGE_VERSION "1.2-alpha4" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void @@ -280,7 +280,7 @@ #define USE_SYS_ENDIAN_H /**/ /* Version number of package */ -#define VERSION "1.2-alpha3" +#define VERSION "1.2-alpha4" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ From owner-svn-src-all@freebsd.org Fri Dec 18 09:50:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79405A4BDC7; Fri, 18 Dec 2015 09:50:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485F11CFC; Fri, 18 Dec 2015 09:50:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI9oOPT025070; Fri, 18 Dec 2015 09:50:24 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI9oOdV025069; Fri, 18 Dec 2015 09:50:24 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512180950.tBI9oOdV025069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 18 Dec 2015 09:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292434 - head/lib/libbsm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 09:50:25 -0000 Author: brueffer Date: Fri Dec 18 09:50:24 2015 New Revision: 292434 URL: https://svnweb.freebsd.org/changeset/base/292434 Log: Add au_notify.2 and MLINKs (added in OpenBSM 1.2 alpha 4). MFC after: 2 weeks Modified: head/lib/libbsm/Makefile Modified: head/lib/libbsm/Makefile ============================================================================== --- head/lib/libbsm/Makefile Fri Dec 18 09:49:11 2015 (r292433) +++ head/lib/libbsm/Makefile Fri Dec 18 09:50:24 2015 (r292434) @@ -48,6 +48,7 @@ MAN= libbsm.3 \ au_free_token.3 \ au_io.3 \ au_mask.3 \ + au_notify.3 \ au_open.3 \ au_socket_type.3 \ au_token.3 \ @@ -112,6 +113,9 @@ MLINKS= libbsm.3 bsm.3 \ au_mask.3 au_preselect.3 \ au_mask.3 getauditflagsbin.3 \ au_mask.3 getauditflagschar.3 \ + au_notify.3 au_get_state.3 \ + au_notify.3 au_notify_initialize.3 \ + au_notify.3 au_notify_terminate.3 \ au_open.3 au_close.3 \ au_open.3 au_close_buffer.3 \ au_open.3 au_close_token.3 \ From owner-svn-src-all@freebsd.org Fri Dec 18 11:20:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57289A4B8A4; Fri, 18 Dec 2015 11:20:52 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23723142F; Fri, 18 Dec 2015 11:20:52 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIBKpvU052839; Fri, 18 Dec 2015 11:20:51 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIBKpgv052838; Fri, 18 Dec 2015 11:20:51 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512181120.tBIBKpgv052838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 18 Dec 2015 11:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292435 - head/usr.sbin/ypserv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 11:20:52 -0000 Author: ume Date: Fri Dec 18 11:20:50 2015 New Revision: 292435 URL: https://svnweb.freebsd.org/changeset/base/292435 Log: - Keep hosts.by{name,addr} IPv4 only. - Add comment how we handle hosts and ipnodes. (from NetBSD) MFC after: 1 week. Modified: head/usr.sbin/ypserv/Makefile.yp Modified: head/usr.sbin/ypserv/Makefile.yp ============================================================================== --- head/usr.sbin/ypserv/Makefile.yp Fri Dec 18 09:50:24 2015 (r292434) +++ head/usr.sbin/ypserv/Makefile.yp Fri Dec 18 11:20:50 2015 (r292435) @@ -387,9 +387,20 @@ netgroup.byuser: $(NETGROUP) .endif +# Solaris 8 does the following: +# - /etc/hosts and hosts.{byname,byaddr} are IPv4 only. +# - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol +# independent name-to-address mapping. +# +# For local name resolution, we made /etc/hosts protocol independent. +# For NIS name resolution, we obey Solaris 8 practice. +# - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8 +# clients. +# - ipnodes.{byname,byaddr} is used for protocol independent mapping. +# hosts.byname: $(HOSTS) @echo "Updating $@..." - @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ + @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -399,7 +410,7 @@ hosts.byname: $(HOSTS) hosts.byaddr: $(HOSTS) @echo "Updating $@..." - @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \ + @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \ | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c From owner-svn-src-all@freebsd.org Fri Dec 18 13:40:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C05FAA4B7C5 for ; Fri, 18 Dec 2015 13:40:34 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53F7E1AC4 for ; Fri, 18 Dec 2015 13:40:34 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22a.google.com with SMTP id p187so65388268wmp.0 for ; Fri, 18 Dec 2015 05:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=SPT3lUx/kxT+B0JidiZ0YwKC/EmPjlFkOJCI0rlqCsI=; b=JnET0daxU3XxvM7DEq9dV6AKyx/7LxLQqbkvnkFoaTSuOfnQmZ4qPr3q7bluvsXQDM VQ66kdBv+HqSs9k3314vZwFREI9BGA8qx8WkyAWPODyDGG2W2PxGB6zzOibJQqbzIX0u sitT2ndGBURvlop1QwR+Gri04KRnV7rX4m5MwKiV/IGBDBkxeZgSoIoAUjQPRV+OrLbJ WZrHjyRggQGmglrLUeWsgQSA8+pInU72BRIxvdaFvypSIleZNTeFEgSH7VWoVeX4/6B2 AqJ4KF4SaayugPy/8wpCsOL4//JN4T0g2dsFK2uS4PjHxsFjFEZN2J74G/2cMTF88U/v jXzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=SPT3lUx/kxT+B0JidiZ0YwKC/EmPjlFkOJCI0rlqCsI=; b=X65f+fUa+1HpKLLpAkAXpYjIoSmLC/7WIrgtveulIATwxj/NNyfkFElwK/mPkuHZDP d77MBOc58wgEhWxWCNPoFjtYsYxynNZB1l4Bx2Z0X0vk0WHPI5JSJaeq+RvEbFecZaaY 3EbV9jBDnCHol+UcgHT/sWuxGefdMer0XqIFFZ8ykevrlJOk84bQQihqBF97VSMwFWtQ oeO6adkh92GU80AcmhQ4O6TF1J7LZ31mqKOLcQY5Tto3h8ADo4Nj7NmJuazSIzapDmKs ya3be3ELT5P+B1IXsQ/FHZ5n3ZsGd3EPiV+7Yo63Rhwxg1JFl8rn2XTZFd06fTMvY16Q QhWA== X-Gm-Message-State: ALoCoQlxEgrunMrwrduDVE3iaLPAR7BPjpsXtjPj+4obSWwYI2vLfKg885Yq+Vsm59FGJVCpewV6ABMYVg7NTN1Pq3ffNHE6pw== X-Received: by 10.28.189.5 with SMTP id n5mr3375799wmf.76.1450446032767; Fri, 18 Dec 2015 05:40:32 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id u126sm6723693wme.3.2015.12.18.05.40.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Dec 2015 05:40:31 -0800 (PST) Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 To: Gleb Smirnoff References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> <20151217191630.GL42340@FreeBSD.org> <567344BC.20501@multiplay.co.uk> <20151217234630.GX42340@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Steven Hartland Message-ID: <56740CCF.2070101@multiplay.co.uk> Date: Fri, 18 Dec 2015 13:40:31 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151217234630.GX42340@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 13:40:34 -0000 On 17/12/2015 23:46, Gleb Smirnoff wrote: > On Thu, Dec 17, 2015 at 11:26:52PM +0000, Steven Hartland wrote: > S> You may have not read all the detail in the review so you might not have > S> noticed that I > S> identified that carp IPv6 NA was broken by r251584 which was committed 2 1/2 > S> years ago. I'm guessing not may people use it for IPv6. > > My suggestion is to look at this regression separated from the lagg failover > and fix it separately. We could, but from this new code it was a few characters, implemented separately you'd need a good portion of the code from this change anyway, so it made sense to just include it here IMO. > S> > The "link aggregation" itself refers to an aggregation of links between > S> > two logical devices. If you build lagg(4) interface on top of two ports > S> > that are plugged into different switches, you are calling for trouble. > S> > S> While multiple switches complicates the matter its not the only issue as > S> you can > S> reproduce this with a single switch and two nics in LAGG failover mode > S> with a simple > S> ifconfig down. At this point any traffic entering the switch for > S> LAGG member > S> will back-whole instead of being received by the other nic. > S> > S> It is much more common in networking now to have multiple physical switches > S> configured as part of bigger logical devices using protocols such as > S> MLAG, which is > S> what we're using with Cisco's and Arista's, so not some cheepo network ;-) > > Right, you are confirming what I said above. Multiple physical devices, but > still one logical on each side of lagg. In our target environment this is correct. > S> > Nevertheless, someone wants to give a kick to this initially broken > S> > network design and run it somehow. And this "somehow" implies Layer2 > S> > upcalling into upper layers to do something, since there is no > S> > established standard layer2 heartbeat packet. I have chatted with > S> > networking gurus at my job, and they said, that they don't know > S> > any decent network equipment that supports such setup. However, they > S> > noticed that Windows is capable for such failover. I haven't yet > S> > learned on how Windows solves the problem. Actually, those who > S> > pushed committing 156226 should have done these investigations. > S> > Probably Windows does exactly the same, sends gratutious ARP or > S> > its IPv6 analog. Or may be does something better like sending > S> > useless L2 datagram, but with a proper source hardware address. > S> Actually our testing here showed both Windows and Linux worked as > S> expected and > S> from my reading doing the GARP / UNA is actually expected in this > S> situation, for this very reason. > > Is it possible for you to sniff the traffic and see what actually happens > in there? My expectations are the same, but want to be sure. Netops here did do that, which lead them to conclude the missing GARP/NA. > S> I'd like to step back for a second and get you feedback on the changes > S> that where > S> reverted, which didn't have the DELAY in the callout. What where the > S> issues as you > S> saw them? So we don't spam people any more I've reopened the review so > S> we can > S> take this there: https://reviews.freebsd.org/D4111 > > Before going into implementation, can we first settle on the protocol? > Could be that GARP/NA is the only solution there, but let's be sure first. > I did try forcing traffic out from backup interface using the console once the primary was down, and unfortunately that didn't help. net.link.lagg.failover_rx_all=1 helps in the converse test but the only thing we found that fixed it fully in a timely manor was GARP/NA. In the tests you can clearly see the impact of ARP timeouts as sometimes it would converge quicker than others. If you would like me to try something else by all means LMK. Regards Steve From owner-svn-src-all@freebsd.org Fri Dec 18 14:10:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA0CA4AAB1; Fri, 18 Dec 2015 14:10:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE221BA5; Fri, 18 Dec 2015 14:10:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIEA0N6099701; Fri, 18 Dec 2015 14:10:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIEA0FD099700; Fri, 18 Dec 2015 14:10:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512181410.tBIEA0FD099700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 Dec 2015 14:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292436 - head/sys/geom/sched X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 14:10:01 -0000 Author: imp Date: Fri Dec 18 14:10:00 2015 New Revision: 292436 URL: https://svnweb.freebsd.org/changeset/base/292436 Log: It turns out that it's OK to sleep in this context, so use M_WAITOK for the softc for the delay module. Noticed by: rpokala@ Modified: head/sys/geom/sched/gs_delay.c Modified: head/sys/geom/sched/gs_delay.c ============================================================================== --- head/sys/geom/sched/gs_delay.c Fri Dec 18 11:20:50 2015 (r292435) +++ head/sys/geom/sched/gs_delay.c Fri Dec 18 14:10:00 2015 (r292436) @@ -201,8 +201,7 @@ g_delay_init(struct g_geom *geom) { struct g_delay_softc *sc; - /* XXX check whether we can sleep */ - sc = malloc(sizeof *sc, M_GEOM_SCHED, M_NOWAIT | M_ZERO); + sc = malloc(sizeof *sc, M_GEOM_SCHED, M_WAITOK | M_ZERO); sc->sc_geom = geom; bioq_init(&sc->sc_bioq); callout_init(&sc->sc_wait, CALLOUT_MPSAFE); From owner-svn-src-all@freebsd.org Fri Dec 18 14:35:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00670A4B842; Fri, 18 Dec 2015 14:35:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26021BE4; Fri, 18 Dec 2015 14:35:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIEZRPs008735; Fri, 18 Dec 2015 14:35:27 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIEZRkB008734; Fri, 18 Dec 2015 14:35:27 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201512181435.tBIEZRkB008734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 18 Dec 2015 14:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292437 - head/sys/powerpc/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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 14:35:29 -0000 Author: nwhitehorn Date: Fri Dec 18 14:35:27 2015 New Revision: 292437 URL: https://svnweb.freebsd.org/changeset/base/292437 Log: Enable PRINTF_BUFR_SIZE on powerpc64, following r194204 on x86. The kernel message garbling was becoming very noticeable on the 64-CPU systems we now support and run on. Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Dec 18 14:10:00 2015 (r292436) +++ head/sys/powerpc/conf/GENERIC64 Fri Dec 18 14:35:27 2015 (r292437) @@ -69,6 +69,7 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode From owner-svn-src-all@freebsd.org Fri Dec 18 14:47:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2DA7A4B0A1 for ; Fri, 18 Dec 2015 14:47:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3E931572 for ; Fri, 18 Dec 2015 14:47:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x22b.google.com with SMTP id k90so55158100qge.0 for ; Fri, 18 Dec 2015 06:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=VScuHyEDx07Unwv/SOBcfvKpKnzdnlaCBpiDmCDRNns=; b=toOSiW5EQ99byH4aIhTfdoQJ0sffgaRfmXN3ImvoOs7ryCieGCLRpKN4jz9sOk2dHW 3zRNSoj+gzva/8klkTx53ujXWoDxKBnub+WSk3c12vZXIsqxJCKk6mDK/W3IXBgrdQgT SuSj9CpMH/L0ux45lUj68B920AlA2s66XM99EqG1GC7KKq8T29QRGaeRb/cTDjDOlZt7 MGLukno6hUgHW920++i2ZUT2r4wbw24O9cu1WrJvwt9A1kyuaVf0gDOvGjIdlk6flXIk Uwc5LkJxhDcanA/dqzjoJ6n6yN/Z57t+z7SMdUc0w/bUMrYDVnGW0Mruk/M/FGtjSIzl RBhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=VScuHyEDx07Unwv/SOBcfvKpKnzdnlaCBpiDmCDRNns=; b=iCugD4tB/t1xGf76XE/jRdunwCq4vyU13Qn2i6zyFuQjtOWIdqAOIlRnKTQApeSrL+ tD4Dxosrz41ZDQEA+hfDrJc0p4bZ7DHSK8O9Q5nw0XaHhCsCBZP8xKOrLH8eno3IGwxh S3X3/a5OyBTvR3UZj7k7dK8ovb+U/joGX04P1r5q4klx8AP0WwyG3V+HzZ3XHI4WoCG3 t5i6wq8JWJuThMr8HGHGDM0fIF+UtzPQWKcb3rkZp2SRUW+ZEqfteBfac/CgMpXvnZWu BAQoZwKfFMbFQikWBHxoU5/67xwuEKq+5q1gPVWBOAf9rUoaGIReRxQOPOmnJQ9mtiaV sSjA== X-Gm-Message-State: ALoCoQniTUSUwi1JujwjH0VfbkfGpkxPw1wkH+NFVFJlLPcDORQxPhEEJA9dgPS8g/OkjINaChZGeqSlU14bgNWAz8ZedMZMzg== X-Received: by 10.141.3.9 with SMTP id f9mr5698122qhd.98.1450450031403; Fri, 18 Dec 2015 06:47:11 -0800 (PST) Received: from mutt-hardenedbsd ([63.88.83.104]) by smtp.gmail.com with ESMTPSA id 63sm6919778qgl.31.2015.12.18.06.47.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Dec 2015 06:47:09 -0800 (PST) Date: Fri, 18 Dec 2015 09:47:08 -0500 From: Shawn Webb To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292436 - head/sys/geom/sched Message-ID: <20151218144708.GA27589@mutt-hardenedbsd> References: <201512181410.tBIEA0FD099700@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <201512181410.tBIEA0FD099700@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 14:47:13 -0000 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 18, 2015 at 02:10:00PM +0000, Warner Losh wrote: > Author: imp > Date: Fri Dec 18 14:10:00 2015 > New Revision: 292436 > URL: https://svnweb.freebsd.org/changeset/base/292436 >=20 > Log: > It turns out that it's OK to sleep in this context, so use M_WAITOK > for the softc for the delay module. > =20 > Noticed by: rpokala@ >=20 > Modified: > head/sys/geom/sched/gs_delay.c >=20 > Modified: head/sys/geom/sched/gs_delay.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/geom/sched/gs_delay.c Fri Dec 18 11:20:50 2015 (r292435) > +++ head/sys/geom/sched/gs_delay.c Fri Dec 18 14:10:00 2015 (r292436) > @@ -201,8 +201,7 @@ g_delay_init(struct g_geom *geom) > { > struct g_delay_softc *sc; > =20 > - /* XXX check whether we can sleep */ > - sc =3D malloc(sizeof *sc, M_GEOM_SCHED, M_NOWAIT | M_ZERO); > + sc =3D malloc(sizeof *sc, M_GEOM_SCHED, M_WAITOK | M_ZERO); > sc->sc_geom =3D geom; > bioq_init(&sc->sc_bioq); > callout_init(&sc->sc_wait, CALLOUT_MPSAFE); Additionally, this fixed a potential NULL dereference bug. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWdBxpAAoJEGqEZY9SRW7u7zMP/RtRB+MMhXK4kkSolcWnkoiH /FYTIqHM7tOuSAnM/GANTapjE9yCNv4QqeCNucY3XNBex4r3mprRmVrX5LVm2Djo ig67b3FUaBN90ix4FBMvw3kuYVEcLzCIiHUWZ+B4FnJJEUrCDUxN26XWoC/VmFlD weCvY1CCE7rqcDI7WjGXC06AOF5oag59liPSCLvbRgTH5DIGjtf01w0vn8wXdKEM xyei8g4C5dqfCzKuhq/2QSj3uSfuTXSBcfaV9aCkwDN4n4Hb+GwtmFyAkGfAp8bD +E016sKJHfSKtSTDrIm+ZisOH0cjk7vSNnnAPBHkUgS++9eafs2FBzjQ0r+ELCpb h/MEKMBXNUBcsJZiasy6Pty/J1uLe0/M6JhG5Snf9CEICm8/bWqHkwPltHnA34YO X9794WLdqinHlr+mwNejzAsIYX6ux+pahuFXPXzAgcVx6EBZ0k0Lg8raL1zLlWT0 MbMPt1qkkCy1iJvAxzyKQUEq8Wtd+Ef4xSpqPel+Zt5kzvTjswHcyEwddDzaGOfL Sb3yyRuOoiteTAXJ10pZbiNOgdyPLO3Kky+fiNErvNTlde0AbskY665oUPDFTvCg FdapM524HHhmN7dk9pWwxG15jgfX8dknfesGLtdAFQylKqR9+LONIQTH1HBULDa5 BLGHsrOk7qAlS0p+byju =soDD -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT-- From owner-svn-src-all@freebsd.org Fri Dec 18 14:52:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8FDA4B521; Fri, 18 Dec 2015 14:52:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 778071CE1; Fri, 18 Dec 2015 14:52:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIEqCXn014952; Fri, 18 Dec 2015 14:52:12 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIEqC5N014951; Fri, 18 Dec 2015 14:52:12 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512181452.tBIEqC5N014951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 18 Dec 2015 14:52:12 +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: r292438 - stable/10/sys/dev/hyperv/utilities 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 14:52:13 -0000 Author: royger Date: Fri Dec 18 14:52:12 2015 New Revision: 292438 URL: https://svnweb.freebsd.org/changeset/base/292438 Log: MFC r292258: hyperv/kvp: wake up the daemon if it's sleeping due to poll() Submitted by: Dexuan Cui Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Fri Dec 18 14:35:27 2015 (r292437) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Fri Dec 18 14:52:12 2015 (r292438) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,6 +115,8 @@ static struct cdev *hv_kvp_dev; static struct hv_kvp_msg *hv_kvp_dev_buf; struct proc *daemon_task; +static struct selinfo hv_kvp_selinfo; + /* * Global state to track and synchronize multiple * KVP transaction requests from the host. @@ -628,6 +631,9 @@ hv_kvp_send_msg_to_daemon(void) /* Send the msg to user via function deamon_read - setting sema */ sema_post(&kvp_globals.dev_sema); + + /* We should wake up the daemon, in case it's doing poll() */ + selwakeup(&hv_kvp_selinfo); } @@ -940,7 +946,7 @@ hv_kvp_dev_daemon_write(struct cdev *dev * for daemon to read. */ static int -hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td __unused) +hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td) { int revents = 0; @@ -953,6 +959,9 @@ hv_kvp_dev_daemon_poll(struct cdev *dev */ if (kvp_globals.daemon_busy == true) revents = POLLIN; + else + selrecord(td, &hv_kvp_selinfo); + mtx_unlock(&kvp_globals.pending_mutex); return (revents); From owner-svn-src-all@freebsd.org Fri Dec 18 14:56:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76754A4B7D1; Fri, 18 Dec 2015 14:56:50 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43B4211B2; Fri, 18 Dec 2015 14:56:50 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIEuniH015546; Fri, 18 Dec 2015 14:56:49 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIEun02015545; Fri, 18 Dec 2015 14:56:49 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512181456.tBIEun02015545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 18 Dec 2015 14:56: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: r292439 - stable/10/sys/dev/hyperv/netvsc 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 14:56:50 -0000 Author: royger Date: Fri Dec 18 14:56:49 2015 New Revision: 292439 URL: https://svnweb.freebsd.org/changeset/base/292439 Log: MFC r291156: Ignore the inbound checksum flags when doing packet forwarding in netvsc driver. Sponsored by: Microsoft OSTC PR: 203630 Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Dec 18 14:52:12 2015 (r292438) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Dec 18 14:56:49 2015 (r292439) @@ -128,6 +128,15 @@ __FBSDID("$FreeBSD$"); #define HV_NV_SC_PTR_OFFSET_IN_BUF 0 #define HV_NV_PACKET_OFFSET_IN_BUF 16 +/* + * A unified flag for all outbound check sum flags is useful, + * and it helps avoiding unnecessary check sum calculation in + * network forwarding scenario. + */ +#define HV_CSUM_FOR_OUTBOUND \ + (CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP|CSUM_IP_TSO| \ + CSUM_IP_ISCSI|CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP| \ + CSUM_IP6_TSO|CSUM_IP6_ISCSI) /* * Data types @@ -570,7 +579,8 @@ hn_start_locked(struct ifnet *ifp) packet->vlan_tci & 0xfff; } - if (0 == m_head->m_pkthdr.csum_flags) { + /* Only check the flags for outbound and ignore the ones for inbound */ + if (0 == (m_head->m_pkthdr.csum_flags & HV_CSUM_FOR_OUTBOUND)) { goto pre_send; } From owner-svn-src-all@freebsd.org Fri Dec 18 16:05:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C19A4B454; Fri, 18 Dec 2015 16:05:18 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7665217A4; Fri, 18 Dec 2015 16:05:18 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-24-6-178-251.hsd1.ca.comcast.net [24.6.178.251]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0NZK006H4A0N3O10@mr11p00im-asmtp002.me.com>; Fri, 18 Dec 2015 16:05:12 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-18_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1512180286 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Fri, 18 Dec 2015 08:05:11 -0800 Subject: Re: svn commit: r292436 - head/sys/geom/sched From: Ravi Pokala Sender: "Pokala, Ravi" To: Shawn Webb , Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <8C1C369D-9E9C-4212-895C-5F5A37334C8D@panasas.com> Thread-topic: svn commit: r292436 - head/sys/geom/sched References: <201512181410.tBIEA0FD099700@repo.freebsd.org> <20151218144708.GA27589@mutt-hardenedbsd> In-reply-to: <20151218144708.GA27589@mutt-hardenedbsd> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 16:05:18 -0000 -----Original Message----- From: on behalf of Shawn Webb Date: 2015-12-18, Friday at 06:47 To: Warner Losh Cc: , , Subject: Re: svn commit: r292436 - head/sys/geom/sched >Additionally, this fixed a potential NULL dereference bug. That's actually what I noticed and mentioned to Warner; he determined that sleeping is okay, so rather than checking for NULL, he made it impossible to get NULL in the first place. :-) -Ravi >Thanks, > >-- >Shawn Webb >HardenedBSD > >GPG Key ID: 0x6A84658F52456EEE >GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE From owner-svn-src-all@freebsd.org Fri Dec 18 16:33:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16E24A4C5FC; Fri, 18 Dec 2015 16:33:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4EA41B19; Fri, 18 Dec 2015 16:33:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIGXFR7046685; Fri, 18 Dec 2015 16:33:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIGXFff046683; Fri, 18 Dec 2015 16:33:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201512181633.tBIGXFff046683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 18 Dec 2015 16:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292440 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 16:33:17 -0000 Author: mjg Date: Fri Dec 18 16:33:15 2015 New Revision: 292440 URL: https://svnweb.freebsd.org/changeset/base/292440 Log: proc: fix a race which could result in dereference of bad p_pgrp pointer on fork During fork p_starcopy - p_endcopy area of a process is populated with bcopy with only proc lock held. Another forking thread can find such a process and proceed to access p_pgrp included in said area. Fix the problem by moving the field outside. It is being properly assigned later. Reviewed by: kib Diagnosed by: kib Tested by: Fabian Keil MFC after: 10 days Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Dec 18 14:56:49 2015 (r292439) +++ head/sys/kern/kern_proc.c Fri Dec 18 16:33:15 2015 (r292440) @@ -248,6 +248,7 @@ proc_init(void *mem, int size, int flags TAILQ_INIT(&p->p_threads); /* all threads in proc */ EVENTHANDLER_INVOKE(process_init, p); p->p_stats = pstats_alloc(); + p->p_pgrp = NULL; SDT_PROBE3(proc, , init, return, p, size, flags); return (0); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Dec 18 14:56:49 2015 (r292439) +++ head/sys/sys/proc.h Fri Dec 18 16:33:15 2015 (r292440) @@ -586,7 +586,6 @@ struct proc { int p_osrel; /* (x) osreldate for the binary (from ELF note, if any) */ char p_comm[MAXCOMLEN + 1]; /* (b) Process name. */ - struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */ struct pargs *p_args; /* (c) Process arguments. */ rlim_t p_cpulimit; /* (c) Current CPU limit in seconds. */ @@ -599,6 +598,7 @@ struct proc { u_int p_xsig; /* (c) Stop/kill sig. */ /* End area that is copied on creation. */ #define p_endcopy p_xsig + struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ struct knlist p_klist; /* (c) Knotes attached to this proc. */ int p_numthreads; /* (c) Number of threads. */ struct mdproc p_md; /* Any machine-dependent fields. */ From owner-svn-src-all@freebsd.org Fri Dec 18 17:30:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB52A4AA2E; Fri, 18 Dec 2015 17:30:23 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 521901EF8; Fri, 18 Dec 2015 17:30:23 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIHUMIf061696; Fri, 18 Dec 2015 17:30:22 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIHUMCB061695; Fri, 18 Dec 2015 17:30:22 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512181730.tBIHUMCB061695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 18 Dec 2015 17:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292441 - head/usr.sbin/ypserv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 17:30:23 -0000 Author: ume Date: Fri Dec 18 17:30:22 2015 New Revision: 292441 URL: https://svnweb.freebsd.org/changeset/base/292441 Log: Generate ipnodes.by{addr,name} from /etc/hosts for compatibility with FreeBSD local name resolution. If /var/yp/ipnodes exists, we generate them from it for backward compatibility. Inspired by: NetBSD MFC after: 1 week Modified: head/usr.sbin/ypserv/Makefile.yp Modified: head/usr.sbin/ypserv/Makefile.yp ============================================================================== --- head/usr.sbin/ypserv/Makefile.yp Fri Dec 18 16:33:15 2015 (r292440) +++ head/usr.sbin/ypserv/Makefile.yp Fri Dec 18 17:30:22 2015 (r292441) @@ -141,6 +141,7 @@ target: # If you want to omit some of them, feel free to comment # them out from this list. TARGETS= servers hosts networks protocols rpc services shells group +TARGETS+= ipnodes #TARGETS+= aliases # Sanity checks: filter out targets we can't build @@ -193,10 +194,8 @@ TARGETS+= amd.map AMDHOST= /dev/null .endif -.if exists($(IPNODES)) -TARGETS+= ipnodes -.else -IPNODES= /dev/null +.if !exists($(IPNODES)) +IPNODES= $(HOSTS) .endif all: $(TARGETS) @@ -397,6 +396,8 @@ netgroup.byuser: $(NETGROUP) # - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8 # clients. # - ipnodes.{byname,byaddr} is used for protocol independent mapping. +# We generate all the mappings from /etc/hosts unless /var/yp/ipnodes +# exists, for compatibility with FreeBSD local name resolution. # hosts.byname: $(HOSTS) @echo "Updating $@..." @@ -420,30 +421,22 @@ hosts.byaddr: $(HOSTS) ipnodes.byname: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif ipnodes.byaddr: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \ | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif networks.byname: $(NETWORKS) From owner-svn-src-all@freebsd.org Fri Dec 18 17:39:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24AEDA4B0E7; Fri, 18 Dec 2015 17:39:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D030B15DC; Fri, 18 Dec 2015 17:39:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIHds3R064586; Fri, 18 Dec 2015 17:39:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIHdsDj064585; Fri, 18 Dec 2015 17:39:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512181739.tBIHdsDj064585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 17:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292442 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 17:39:56 -0000 Author: emaste Date: Fri Dec 18 17:39:54 2015 New Revision: 292442 URL: https://svnweb.freebsd.org/changeset/base/292442 Log: loader.efi: show EFI error number, not full status value EFI return values set the high bit to indicate an error. The log messages changed here are printed only in the case of an error, so including the error bit is redundant. Also switch to decimal to match the error definitions (in sys/boot/efi/include/efierr.h). MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/loader/bootinfo.c Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Fri Dec 18 17:30:22 2015 (r292441) +++ head/sys/boot/efi/loader/bootinfo.c Fri Dec 18 17:39:54 2015 (r292442) @@ -250,8 +250,8 @@ bi_add_efi_data_and_exit(struct preloade for (retry = 2; retry > 0; retry--) { status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); if (EFI_ERROR(status)) { - printf("%s: GetMemoryMap() returned 0x%lx\n", __func__, - (long)status); + printf("%s: GetMemoryMap error %lu\n", __func__, + (unsigned long)(status & ~EFI_ERROR_MASK)); return (EINVAL); } status = BS->ExitBootServices(IH, efi_mapkey); @@ -264,7 +264,8 @@ bi_add_efi_data_and_exit(struct preloade return (0); } } - printf("ExitBootServices() returned 0x%lx\n", (long)status); + printf("ExitBootServices error %lu\n", + (unsigned long)(status & ~EFI_ERROR_MASK)); return (EINVAL); } @@ -317,8 +318,8 @@ bi_load_efi_data(struct preloaded_file * status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, pages, &addr); if (EFI_ERROR(status)) { - printf("%s: AllocatePages() returned 0x%lx\n", __func__, - (long)status); + printf("%s: AllocatePages error %lu\n", __func__, + (unsigned long)(status & ~EFI_ERROR_MASK)); return (ENOMEM); } From owner-svn-src-all@freebsd.org Fri Dec 18 17:52:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43998A4B967; Fri, 18 Dec 2015 17:52:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 126EB1E64; Fri, 18 Dec 2015 17:52:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIHq9aA069910; Fri, 18 Dec 2015 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIHq9QN069909; Fri, 18 Dec 2015 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512181752.tBIHq9QN069909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292443 - head/usr.sbin/boot0cfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 17:52:10 -0000 Author: jhb Date: Fri Dec 18 17:52:08 2015 New Revision: 292443 URL: https://svnweb.freebsd.org/changeset/base/292443 Log: Fix the precious change to check the pointer returned by malloc(). Submitted by: luke Pointy hat to: jhb Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Fri Dec 18 17:39:54 2015 (r292442) +++ head/usr.sbin/boot0cfg/boot0cfg.c Fri Dec 18 17:52:08 2015 (r292443) @@ -337,7 +337,7 @@ read_mbr(const char *disk, u_int8_t **mb return (mbr_size); } *mbr = malloc(sizeof(buf)); - if (mbr == NULL) + if (*mbr == NULL) errx(1, "%s: unable to allocate MBR buffer", disk); memcpy(*mbr, buf, sizeof(buf)); close(fd); From owner-svn-src-all@freebsd.org Fri Dec 18 17:53:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42D63A4BAB4; Fri, 18 Dec 2015 17:53:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 197D21039; Fri, 18 Dec 2015 17:53:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIHrJ2Y069989; Fri, 18 Dec 2015 17:53:19 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIHrJlb069987; Fri, 18 Dec 2015 17:53:19 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512181753.tBIHrJlb069987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 18 Dec 2015 17:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292444 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 17:53:20 -0000 Author: ume Date: Fri Dec 18 17:53:18 2015 New Revision: 292444 URL: https://svnweb.freebsd.org/changeset/base/292444 Log: Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3). PR: 198092 MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.3 head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.3 ============================================================================== --- head/lib/libc/net/getaddrinfo.3 Fri Dec 18 17:52:08 2015 (r292443) +++ head/lib/libc/net/getaddrinfo.3 Fri Dec 18 17:53:18 2015 (r292444) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2015 +.Dd December 19, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -130,11 +130,13 @@ field to which the parameter points shall be set to zero or be the bitwise-inclusive OR of one or more of the values .Dv AI_ADDRCONFIG , +.Dv AI_ALL , .Dv AI_CANONNAME , .Dv AI_NUMERICHOST , -.Dv AI_NUMERICSERV +.Dv AI_NUMERICSERV , +.Dv AI_PASSIVE and -.Dv AI_PASSIVE . +.Dv AI_V4MAPPED . For a UNIX-domain address, .Fa ai_flags is ignored. @@ -146,6 +148,25 @@ bit is set, IPv4 addresses shall be retu an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. +.It Dv AI_ALL +If the +.Dv AI_ALL +flag is used with the +.Dv AI_V4MAPPED +flag, then +.Fn getaddrinfo +shall return all matching IPv6 and IPv4 addresses. +.Pp +For example, when using the DNS, queries are made for both AAAA records and A records, and +.Fn getaddrinfo +returns the combined results of both queries. +Any IPv4 addresses found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_ALL +flag without the +.Dv AI_V4MAPPED +flag is ignored. .It Dv AI_CANONNAME If the .Dv AI_CANONNAME @@ -210,6 +231,25 @@ loopback address if is the null pointer and .Dv AI_PASSIVE is not set. +.It Dv AI_V4MAPPED +If the +.Dv AI_V4MAPPED +flag is specified along with an ai_family of +.Dv AF_INET6 , +then +.Fn getaddrinfo +shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( +.Fa ai_addrlen +shall be 16). +.Pp +For example, when using the DNS, if no AAAA records are found then a query is made for A records and any found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_V4MAPPED +flag shall be ignored unless +.Fa ai_family +equals +.Dv AF_INET6 . .El .El .Pp Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Fri Dec 18 17:52:08 2015 (r292443) +++ head/lib/libc/net/getaddrinfo.c Fri Dec 18 17:53:18 2015 (r292444) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "netdb_private.h" #include "libc_private.h" #ifdef NS_CACHING #include "nscache.h" @@ -470,6 +471,24 @@ getaddrinfo(const char *hostname, const } /* + * RFC 3493: AI_ALL and AI_V4MAPPED are effective only against + * AF_INET6 query. They need to be ignored if specified in other + * occassions. + */ + switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) { + case AI_V4MAPPED: + case AI_ALL | AI_V4MAPPED: +#ifdef INET6 + if (pai->ai_family != AF_INET6) + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; +#endif + case AI_ALL: + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; + } + + /* * check for special cases. (1) numeric servname is disallowed if * socktype/protocol are left unspecified. (2) servname is disallowed * for raw and other inet{,6} sockets. @@ -861,6 +880,16 @@ set_source(struct ai_order *aio, struct if ((s = _socket(ai.ai_family, ai.ai_socktype | SOCK_CLOEXEC, ai.ai_protocol)) < 0) return; /* give up */ +#ifdef INET6 + if (ai.ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai.ai_addr; + int off = 0; + + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + (void)_setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, + (char *)&off, sizeof(off)); + } +#endif if (_connect(s, ai.ai_addr, ai.ai_addrlen) < 0) goto cleanup; srclen = ai.ai_addrlen; @@ -1199,7 +1228,7 @@ explore_numeric(const struct addrinfo *p const char *servname, struct addrinfo **res, const char *canonname) { const struct afd *afd; - struct addrinfo *ai; + struct addrinfo *ai, ai0; int error; char pton[PTON_MAX], path[PATH_MAX], *p; @@ -1236,8 +1265,17 @@ explore_numeric(const struct addrinfo *p p = pton; break; default: - if (inet_pton(afd->a_af, hostname, pton) != 1) - return 0; + if (inet_pton(afd->a_af, hostname, pton) != 1) { + if (pai->ai_family != AF_INET6 || + (pai->ai_flags & AI_V4MAPPED) != AI_V4MAPPED) + return 0; + if (inet_aton(hostname, (struct in_addr *)pton) != 1) + return 0; + afd = &afdl[N_INET]; + ai0 = *pai; + ai0.ai_family = AF_INET; + pai = &ai0; + } p = pton; break; } @@ -1354,6 +1392,15 @@ get_ai(const struct addrinfo *pai, const { char *p; struct addrinfo *ai; +#ifdef INET6 + struct in6_addr mapaddr; + + if (afd->a_af == AF_INET && (pai->ai_flags & AI_V4MAPPED) != 0) { + afd = &afdl[N_INET6]; + _map_v4v6_address(addr, (char *)&mapaddr); + addr = (char *)&mapaddr; + } +#endif ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); @@ -2192,7 +2239,7 @@ addr4sort(struct addrinfo *sentinel, res static int _dns_getaddrinfo(void *rv, void *cb_data, va_list ap) { - struct addrinfo *ai; + struct addrinfo *ai, ai0; querybuf *buf, *buf2; const char *hostname; const struct addrinfo *pai; @@ -2222,6 +2269,13 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_NOTFOUND; } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) { + ai0 = *pai; + ai0.ai_family = AF_UNSPEC; + pai = &ai0; + } + switch (pai->ai_family) { case AF_UNSPEC: q.name = hostname; @@ -2277,9 +2331,12 @@ _dns_getaddrinfo(void *rv, void *cb_data cur = cur->ai_next; } } - ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); - if (ai) - cur->ai_next = ai; + if (!ai || pai->ai_family != AF_UNSPEC || + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) { + ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); + if (ai) + cur->ai_next = ai; + } free(buf); free(buf2); if (sentinel.ai_next == NULL) @@ -2361,6 +2418,9 @@ found: hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, "0", &hints, &res0); if (error) goto again; @@ -2388,6 +2448,20 @@ found: return res0; } +static struct addrinfo * +_getht(FILE **hostf, const char *name, const struct addrinfo *pai, + struct addrinfo *cur) +{ + struct addrinfo *p; + + while ((p = _gethtent(hostf, name, pai)) != NULL) { + cur->ai_next = p; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + return (cur); +} + /*ARGSUSED*/ static int _files_getaddrinfo(void *rv, void *cb_data, va_list ap) @@ -2395,7 +2469,6 @@ _files_getaddrinfo(void *rv, void *cb_da const char *name; const struct addrinfo *pai; struct addrinfo sentinel, *cur; - struct addrinfo *p; FILE *hostf = NULL; name = va_arg(ap, char *); @@ -2405,11 +2478,19 @@ _files_getaddrinfo(void *rv, void *cb_da cur = &sentinel; _sethtent(&hostf); - while ((p = _gethtent(&hostf, name, pai)) != NULL) { - cur->ai_next = p; - while (cur && cur->ai_next) - cur = cur->ai_next; - } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) == AI_V4MAPPED) { + struct addrinfo ai0 = *pai; + + ai0.ai_flags &= ~AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + if (sentinel.ai_next == NULL) { + _sethtent(&hostf); + ai0.ai_flags |= AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + } + } else + cur = _getht(&hostf, name, pai, cur); _endhtent(&hostf); *((struct addrinfo **)rv) = sentinel.ai_next; @@ -2469,6 +2550,9 @@ nextline: hints = *pai; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, NULL, &hints, &res0); if (error == 0) { for (res = res0; res; res = res->ai_next) { @@ -2516,15 +2600,46 @@ _yp_getaddrinfo(void *rv, void *cb_data, memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + /* ipnodes.byname can hold both IPv4/v6 */ + r = yp_match(ypdomain, "ipnodes.byname", name, + (int)strlen(name), &ypbuf, &ypbuflen); + if (r == 0) { + ai = _yphostent(ypbuf, pai); + if (ai) { + cur->ai_next = ai; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + free(ypbuf); + } + + if (ai != NULL) { + struct sockaddr_in6 *sin6; + + switch (ai->ai_family) { + case AF_INET: + goto done; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ai->ai_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + goto done; + break; + } + } + /* hosts.byname is only for IPv4 (Solaris8) */ - if (pai->ai_family == PF_UNSPEC || pai->ai_family == PF_INET) { + if (pai->ai_family == AF_UNSPEC || pai->ai_family == AF_INET || + ((pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) && + (ai == NULL || (pai->ai_flags & AI_ALL) == AI_ALL))) { r = yp_match(ypdomain, "hosts.byname", name, (int)strlen(name), &ypbuf, &ypbuflen); if (r == 0) { struct addrinfo ai4; ai4 = *pai; - ai4.ai_family = AF_INET; + if (pai->ai_family == AF_UNSPEC) + ai4.ai_family = AF_INET; ai = _yphostent(ypbuf, &ai4); if (ai) { cur->ai_next = ai; @@ -2535,16 +2650,7 @@ _yp_getaddrinfo(void *rv, void *cb_data, } } - /* ipnodes.byname can hold both IPv4/v6 */ - r = yp_match(ypdomain, "ipnodes.byname", name, - (int)strlen(name), &ypbuf, &ypbuflen); - if (r == 0) { - ai = _yphostent(ypbuf, pai); - if (ai) - cur->ai_next = ai; - free(ypbuf); - } - +done: if (sentinel.ai_next == NULL) { RES_SET_H_ERRNO(__res_state(), HOST_NOT_FOUND); return NS_NOTFOUND; From owner-svn-src-all@freebsd.org Fri Dec 18 17:57:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EADDA4BD59; Fri, 18 Dec 2015 17:57:32 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B88113BC; Fri, 18 Dec 2015 17:57:32 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIHvVFI070330; Fri, 18 Dec 2015 17:57:31 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIHvVaL070329; Fri, 18 Dec 2015 17:57:31 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512181757.tBIHvVaL070329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 18 Dec 2015 17:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292445 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 17:57:32 -0000 Author: ume Date: Fri Dec 18 17:57:31 2015 New Revision: 292445 URL: https://svnweb.freebsd.org/changeset/base/292445 Log: Use _map_v4v6_address(). Suggested by: hrs MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Fri Dec 18 17:53:18 2015 (r292444) +++ head/lib/libc/net/getaddrinfo.c Fri Dec 18 17:57:31 2015 (r292445) @@ -797,10 +797,9 @@ match_addrselectpolicy(struct sockaddr * memset(&key, 0, sizeof(key)); key.sin6_family = AF_INET6; key.sin6_len = sizeof(key); - key.sin6_addr.s6_addr[10] = 0xff; - key.sin6_addr.s6_addr[11] = 0xff; - memcpy(&key.sin6_addr.s6_addr[12], - &((struct sockaddr_in *)addr)->sin_addr, 4); + _map_v4v6_address( + (char *)&((struct sockaddr_in *)addr)->sin_addr, + (char *)&key.sin6_addr); break; default: return(NULL); From owner-svn-src-all@freebsd.org Fri Dec 18 18:08:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC8DBA49679; Fri, 18 Dec 2015 18:08:54 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F23E1C0F; Fri, 18 Dec 2015 18:08:54 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBII8rlF073280; Fri, 18 Dec 2015 18:08:53 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBII8rMj073279; Fri, 18 Dec 2015 18:08:53 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512181808.tBII8rMj073279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 18 Dec 2015 18:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292446 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 18:08:54 -0000 Author: ume Date: Fri Dec 18 18:08:53 2015 New Revision: 292446 URL: https://svnweb.freebsd.org/changeset/base/292446 Log: Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3). We need to change netdb.h to make it actually enabled. PR: 198092 MFC after: 1 week Modified: head/include/netdb.h Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Fri Dec 18 17:57:31 2015 (r292445) +++ head/include/netdb.h Fri Dec 18 18:08:53 2015 (r292446) @@ -179,7 +179,7 @@ struct addrinfo { /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ - AI_ADDRCONFIG) + AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ From owner-svn-src-all@freebsd.org Fri Dec 18 18:35:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400C6A4B9C8; Fri, 18 Dec 2015 18:35:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02F2F1DD0; Fri, 18 Dec 2015 18:35:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIIZmcd082169; Fri, 18 Dec 2015 18:35:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIIZkE3082149; Fri, 18 Dec 2015 18:35:46 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201512181835.tBIIZkE3082149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 18 Dec 2015 18:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292447 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/components/events sour... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 18:35:49 -0000 Author: jkim Date: Fri Dec 18 18:35:46 2015 New Revision: 292447 URL: https://svnweb.freebsd.org/changeset/base/292447 Log: Import ACPICA 20151218. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/common/acfileio.c vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/getopt.c vendor-sys/acpica/dist/source/compiler/aslascii.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/asllisting.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmap.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslrules.y vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/dttemplate.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c vendor-sys/acpica/dist/source/components/events/evhandler.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/events/evrgnini.c vendor-sys/acpica/dist/source/components/events/evxfregn.c vendor-sys/acpica/dist/source/components/executer/excreate.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exmisc.c vendor-sys/acpica/dist/source/components/executer/exoparg1.c vendor-sys/acpica/dist/source/components/namespace/nsconvert.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsload.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psopcode.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/utilities/utinit.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/include/acapps.h vendor-sys/acpica/dist/source/include/acevents.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acopcode.h vendor-sys/acpica/dist/source/include/acparser.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/amlcode.h vendor-sys/acpica/dist/source/tools/acpibin/abmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpinames/anmain.c vendor-sys/acpica/dist/source/tools/examples/examples.c vendor-sys/acpica/dist/tests/misc/grammar.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/changes.txt Fri Dec 18 18:35:46 2015 (r292447) @@ -1,4 +1,161 @@ ---------------------------------------- +18 December 2015. Summary of changes for version 20151218: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Implemented per-AML-table execution of "module-level code" as individual +ACPI tables are loaded into the namespace during ACPICA initialization. +In other words, any module-level code within an AML table is executed +immediately after the table is loaded, instead of batched and executed +after all of the tables have been loaded. This provides compatibility +with other ACPI implementations. ACPICA BZ 1219. Bob Moore, Lv Zheng, +David Box. + +To fully support the feature above, the default operation region handlers +for the SystemMemory, SystemIO, and PCI_Config address spaces are now +installed before any ACPI tables are loaded. This enables module-level +code to access these address spaces during the table load and module- +level code execution phase. ACPICA BZ 1220. Bob Moore, Lv Zheng, David +Box. + +Implemented several changes to the internal _REG support in conjunction +with the changes above. Also, changes to the AcpiExec/AcpiNames/Examples +utilities for the changes above. Although these tools were changed, host +operating systems that simply use the default handlers for SystemMemory, +SystemIO, and PCI_Config spaces should not require any update. Lv Zheng. + +For example, in the code below, DEV1 is conditionally added to the +namespace by the DSDT via module-level code that accesses an operation +region. The SSDT references DEV1 via the Scope operator. DEV1 must be +created immediately after the DSDT is loaded in order for the SSDT to +successfully reference DEV1. Previously, this code would cause an +AE_NOT_EXIST exception during the load of the SSDT. Now, this code is +fully supported by ACPICA. + + DefinitionBlock ("", "DSDT", 2, "Intel", "DSDT1", 1) + { + OperationRegion (OPR1, SystemMemory, 0x400, 32) + Field (OPR1, AnyAcc, NoLock, Preserve) + { + FLD1, 1 + } + If (FLD1) + { + Device (\DEV1) + { + } + } + } + DefinitionBlock ("", "SSDT", 2, "Intel", "SSDT1", 1) + { + External (\DEV1, DeviceObj) + Scope (\DEV1) + { + } + } + +Fixed an AML interpreter problem where control method invocations were +not handled correctly when the invocation was itself a SuperName argument +to another ASL operator. In these cases, the method was not invoked. +ACPICA BZ 1002. Affects the following ASL operators that have a SuperName +argument: + Store + Acquire, Wait + CondRefOf, RefOf + Decrement, Increment + Load, Unload + Notify + Signal, Release, Reset + SizeOf + +Implemented automatic String-to-ObjectReference conversion support for +packages returned by predefined names (such as _DEP). A common BIOS error +is to add double quotes around an ObjectReference namepath, which turns +the reference into an unexpected string object. This support detects the +problem and corrects it before the package is returned to the caller that +invoked the method. Lv Zheng. + +Implemented extensions to the Concatenate operator. Concatenate now +accepts any type of object, it is not restricted to simply +Integer/String/Buffer. For objects other than these 3 basic data types, +the argument is treated as a string containing the name of the object +type. This expands the utility of Concatenate and the Printf/Fprintf +macros. ACPICA BZ 1222. + +Cleaned up the output of the ASL Debug object. The timer() value is now +optional and no longer emitted by default. Also, the basic data types of +Integer/String/Buffer are simply emitted as their values, without a data +type string -- since the data type is obvious from the output. ACPICA BZ +1221. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 102.6K Code, 28.4K Data, 131.0K Total + Debug Version: 200.3K Code, 81.9K Data, 282.3K Total + Previous Release: + Non-Debug Version: 102.0K Code, 28.3K Data, 130.3K Total + Debug Version: 199.6K Code, 81.8K Data, 281.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed some issues with the ASL Include() operator. This operator +was incorrectly defined in the iASL parser rules, causing a new scope to +be opened for the code within the include file. This could lead to +several issues, including allowing ASL code that is technically illegal +and not supported by AML interpreters. Note, this does not affect the +related #include preprocessor operator. ACPICA BZ 1212. + +iASL/Disassembler: Implemented support for the ASL ElseIf operator. This +operator is essentially an ASL macro since there is no AML opcode +associated with it. The code emitted by the iASL compiler for ElseIf is +an Else opcode followed immediately by an If opcode. The disassembler +will now emit an ElseIf if it finds an Else immediately followed by an +If. This simplifies the decoded ASL, especially for deeply nested +If..Else and large Switch constructs. Thus, the disassembled code more +closely follows the original source ASL. ACPICA BZ 1211. Example: + + Old disassembly: + Else + { + If (Arg0 == 0x02) + { + Local0 = 0x05 + } + } + + New disassembly: + ElseIf (Arg0 == 0x02) + { + Local0 = 0x05 + } + +AcpiExec: Added support for the new module level code behavior and the +early region installation. This required a small change to the +initialization, since AcpiExec must install its own operation region +handlers. + +AcpiExec: Added support to make the debug object timer optional. Default +is timer disabled. This cleans up the debug object output -- the timer +data is rarely used. + +AcpiExec: Multiple ACPI tables are now loaded in the order that they +appear on the command line. This can be important when there are +interdependencies/references between the tables. + +iASL/Templates. Add support to generate template files with multiple +SSDTs within a single output file. Also added ommand line support to +specify the number of SSDTs (in addition to a single DSDT). ACPICA BZ +1223, 1225. + +---------------------------------------- 24 November 2015. Summary of changes for version 20151124: This release is available at https://acpica.org/downloads Modified: vendor-sys/acpica/dist/source/common/acfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/common/acfileio.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/common/acfileio.c Fri Dec 18 18:35:46 2015 (r292447) @@ -55,20 +55,20 @@ /* Local prototypes */ static ACPI_STATUS -AcpiAcGetOneTableFromFile ( +AcGetOneTableFromFile ( char *Filename, FILE *File, UINT8 GetOnlyAmlTables, ACPI_TABLE_HEADER **Table); static ACPI_STATUS -AcpiAcCheckTextModeCorruption ( +AcCheckTextModeCorruption ( ACPI_TABLE_HEADER *Table); /******************************************************************************* * - * FUNCTION: AcpiAcGetAllTablesFromFile + * FUNCTION: AcGetAllTablesFromFile * * PARAMETERS: Filename - Table filename * GetOnlyAmlTables - TRUE if the tables must be AML tables @@ -81,7 +81,7 @@ AcpiAcCheckTextModeCorruption ( ******************************************************************************/ ACPI_STATUS -AcpiAcGetAllTablesFromFile ( +AcGetAllTablesFromFile ( char *Filename, UINT8 GetOnlyAmlTables, ACPI_NEW_TABLE_DESC **ReturnListHead) @@ -115,19 +115,36 @@ AcpiAcGetAllTablesFromFile ( return (AE_ERROR); } - if (FileSize < 4) + fprintf (stderr, + "Input file %s, Length 0x%X (%u) bytes\n", + Filename, FileSize, FileSize); + + /* We must have at least one ACPI table header */ + + if (FileSize < sizeof (ACPI_TABLE_HEADER)) { return (AE_BAD_HEADER); } + /* Check for an non-binary file */ + + if (!AcIsFileBinary (File)) + { + fprintf (stderr, + " %s: File does not appear to contain a valid AML table\n", + Filename); + return (AE_TYPE); + } + /* Read all tables within the file */ while (ACPI_SUCCESS (Status)) { /* Get one entire ACPI table */ - Status = AcpiAcGetOneTableFromFile ( + Status = AcGetOneTableFromFile ( Filename, File, GetOnlyAmlTables, &Table); + if (Status == AE_CTRL_TERMINATE) { Status = AE_OK; @@ -135,13 +152,20 @@ AcpiAcGetAllTablesFromFile ( } else if (Status == AE_TYPE) { - continue; + return (AE_OK); } else if (ACPI_FAILURE (Status)) { return (Status); } + /* Print table header for iASL/disassembler only */ + +#ifdef ACPI_ASL_COMPILER + + AcpiTbPrintTableHeader (0, Table); +#endif + /* Allocate and link a table descriptor */ TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC)); @@ -186,7 +210,7 @@ AcpiAcGetAllTablesFromFile ( /******************************************************************************* * - * FUNCTION: AcpiAcGetOneTableFromFile + * FUNCTION: AcGetOneTableFromFile * * PARAMETERS: Filename - File where table is located * File - Open FILE pointer to Filename @@ -204,7 +228,7 @@ AcpiAcGetAllTablesFromFile ( ******************************************************************************/ static ACPI_STATUS -AcpiAcGetOneTableFromFile ( +AcGetOneTableFromFile ( char *Filename, FILE *File, UINT8 GetOnlyAmlTables, @@ -214,21 +238,28 @@ AcpiAcGetOneTableFromFile ( ACPI_TABLE_HEADER TableHeader; ACPI_TABLE_HEADER *Table; INT32 Count; - long Position; + long TableOffset; *ReturnTable = NULL; + /* Get the table header to examine signature and length */ - /* Get just the table header to get signature and length */ - - Position = ftell (File); + TableOffset = ftell (File); Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File); if (Count != sizeof (ACPI_TABLE_HEADER)) { return (AE_CTRL_TERMINATE); } + /* Validate the table signature/header (limited ASCII chars) */ + + Status = AcValidateTableHeader (File, TableOffset); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (GetOnlyAmlTables) { /* Table must be an AML table (DSDT/SSDT) or FADT */ @@ -237,7 +268,7 @@ AcpiAcGetOneTableFromFile ( !AcpiUtIsAmlTable (&TableHeader)) { fprintf (stderr, - " %s: [%4.4s] is not an AML table - ignoring\n", + " %s: Table [%4.4s] is not an AML table - ignoring\n", Filename, TableHeader.Signature); return (AE_TYPE); @@ -252,9 +283,9 @@ AcpiAcGetOneTableFromFile ( return (AE_NO_MEMORY); } - /* Now read the entire table */ + /* Read the entire ACPI table, including header */ - fseek (File, Position, SEEK_SET); + fseek (File, TableOffset, SEEK_SET); Count = fread (Table, 1, TableHeader.Length, File); if (Count != (INT32) TableHeader.Length) @@ -268,18 +299,13 @@ AcpiAcGetOneTableFromFile ( Status = AcpiTbVerifyChecksum (Table, TableHeader.Length); if (ACPI_FAILURE (Status)) { - Status = AcpiAcCheckTextModeCorruption (Table); + Status = AcCheckTextModeCorruption (Table); if (ACPI_FAILURE (Status)) { goto ErrorExit; } } - fprintf (stderr, - "Loading ACPI table [%4.4s] from file %12s - Length 0x%06X (%u)\n", - TableHeader.Signature, Filename, - TableHeader.Length, TableHeader.Length); - *ReturnTable = Table; return (AE_OK); @@ -292,7 +318,159 @@ ErrorExit: /******************************************************************************* * - * FUNCTION: AcpiAcCheckTextModeCorruption + * FUNCTION: AcIsFileBinary + * + * PARAMETERS: File - Open input file + * + * RETURN: TRUE if file appears to be binary + * + * DESCRIPTION: Scan a file for any non-ASCII bytes. + * + * Note: Maintains current file position. + * + ******************************************************************************/ + +BOOLEAN +AcIsFileBinary ( + FILE *File) +{ + UINT8 Byte; + BOOLEAN IsBinary = FALSE; + long FileOffset; + + + /* Scan entire file for any non-ASCII bytes */ + + FileOffset = ftell (File); + while (fread (&Byte, 1, 1, File) == 1) + { + if (!isprint (Byte) && !isspace (Byte)) + { + IsBinary = TRUE; + goto Exit; + } + } + +Exit: + fseek (File, FileOffset, SEEK_SET); + return (IsBinary); +} + + +/******************************************************************************* + * + * FUNCTION: AcValidateTableHeader + * + * PARAMETERS: File - Open input file + * + * RETURN: Status + * + * DESCRIPTION: Determine if a file seems to contain one or more binary ACPI + * tables, via the + * following checks on what would be the table header: + * 1) File must be at least as long as an ACPI_TABLE_HEADER + * 2) There must be enough room in the file to hold entire table + * 3) Signature, OemId, OemTableId, AslCompilerId must be ASCII + * + * Note: There can be multiple definition blocks per file, so we cannot + * expect/compare the file size to be equal to the table length. 12/2015. + * + * Note: Maintains current file position. + * + ******************************************************************************/ + +ACPI_STATUS +AcValidateTableHeader ( + FILE *File, + long TableOffset) +{ + ACPI_TABLE_HEADER TableHeader; + size_t Actual; + long OriginalOffset; + UINT32 FileSize; + UINT32 i; + + + ACPI_FUNCTION_TRACE ("AcValidateTableHeader"); + + + /* Read a potential table header */ + + OriginalOffset = ftell (File); + fseek (File, TableOffset, SEEK_SET); + + Actual = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File); + fseek (File, OriginalOffset, SEEK_SET); + + if (Actual < sizeof (ACPI_TABLE_HEADER)) + { + return (AE_ERROR); + } + + /* Validate the signature (limited ASCII chars) */ + + if (!AcpiIsValidSignature (TableHeader.Signature)) + { + fprintf (stderr, "Invalid table signature: 0x%8.8X\n", + *ACPI_CAST_PTR (UINT32, TableHeader.Signature)); + return (AE_BAD_SIGNATURE); + } + + /* Validate table length against bytes remaining in the file */ + + FileSize = CmGetFileSize (File); + if (TableHeader.Length > (UINT32) (FileSize - TableOffset)) + { + fprintf (stderr, "Table [%4.4s] is too long for file - " + "needs: 0x%.2X, remaining in file: 0x%.2X\n", + TableHeader.Signature, TableHeader.Length, + (UINT32) (FileSize - TableOffset)); + return (AE_BAD_HEADER); + } + + /* + * These fields must be ASCII: OemId, OemTableId, AslCompilerId. + * We allow a NULL terminator in OemId and OemTableId. + */ + for (i = 0; i < ACPI_NAME_SIZE; i++) + { + if (!ACPI_IS_ASCII ((UINT8) TableHeader.AslCompilerId[i])) + { + goto BadCharacters; + } + } + + for (i = 0; (i < ACPI_OEM_ID_SIZE) && (TableHeader.OemId[i]); i++) + { + if (!ACPI_IS_ASCII ((UINT8) TableHeader.OemId[i])) + { + goto BadCharacters; + } + } + + for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (TableHeader.OemTableId[i]); i++) + { + if (!ACPI_IS_ASCII ((UINT8) TableHeader.OemTableId[i])) + { + goto BadCharacters; + } + } + + return (AE_OK); + + +BadCharacters: + + ACPI_WARNING ((AE_INFO, + "Table header for [%4.4s] has invalid ASCII character(s)", + TableHeader.Signature)); + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcCheckTextModeCorruption * * PARAMETERS: Table - Table buffer starting with table header * @@ -305,7 +483,7 @@ ErrorExit: ******************************************************************************/ static ACPI_STATUS -AcpiAcCheckTextModeCorruption ( +AcCheckTextModeCorruption ( ACPI_TABLE_HEADER *Table) { UINT32 i; Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/common/adisasm.c Fri Dec 18 18:35:46 2015 (r292447) @@ -192,10 +192,12 @@ AdAmlDisassemble ( { /* Get the list of all AML tables in the file */ - Status = AcpiAcGetAllTablesFromFile (Filename, + Status = AcGetAllTablesFromFile (Filename, ACPI_GET_ALL_TABLES, &ListHead); if (ACPI_FAILURE (Status)) { + AcpiOsPrintf ("Could not get ACPI tables from %s, %s\n", + Filename, AcpiFormatException (Status)); return (Status); } @@ -281,13 +283,12 @@ AdAmlDisassemble ( Cleanup: -// check! -#if 0 - if (Table && !AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table)) + if (Table && + !AcpiGbl_ForceAmlDisassembly && + !AcpiUtIsAmlTable (Table)) { ACPI_FREE (Table); } -#endif if (File) { @@ -592,7 +593,7 @@ AdDoExternalFileList ( AcpiOsPrintf ("External object resolution file %16s\n", ExternalFilename); - Status = AcpiAcGetAllTablesFromFile ( + Status = AcGetAllTablesFromFile ( ExternalFilename, ACPI_GET_ONLY_AML_TABLES, &ExternalListHead); if (ACPI_FAILURE (Status)) { Modified: vendor-sys/acpica/dist/source/common/getopt.c ============================================================================== --- vendor-sys/acpica/dist/source/common/getopt.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/common/getopt.c Fri Dec 18 18:35:46 2015 (r292447) @@ -47,6 +47,7 @@ * Option strings: * "f" - Option has no arguments * "f:" - Option requires an argument + * "f+" - Option has an optional argument * "f^" - Option has optional single-char sub-options * "f|" - Option has required single-char sub-options */ Modified: vendor-sys/acpica/dist/source/compiler/aslascii.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslascii.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslascii.c Fri Dec 18 18:35:46 2015 (r292447) @@ -42,6 +42,7 @@ */ #include "aslcompiler.h" +#include #include #define _COMPONENT ACPI_COMPILER @@ -63,90 +64,7 @@ FlConsumeNewComment ( /******************************************************************************* * - * FUNCTION: FlCheckForAcpiTable - * - * PARAMETERS: Handle - Open input file - * - * RETURN: Status - * - * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the - * following checks on what would be the table header: - * 0) File must be at least as long as an ACPI_TABLE_HEADER - * 1) The header length field must match the file size - * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII - * - ******************************************************************************/ - -ACPI_STATUS -FlCheckForAcpiTable ( - FILE *Handle) -{ - ACPI_TABLE_HEADER Table; - UINT32 FileSize; - size_t Actual; - UINT32 i; - - - /* Read a potential table header */ - - Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle); - fseek (Handle, 0, SEEK_SET); - - if (Actual < sizeof (ACPI_TABLE_HEADER)) - { - return (AE_ERROR); - } - - /* Header length field must match the file size */ - - FileSize = CmGetFileSize (Handle); - if (Table.Length != FileSize) - { - return (AE_ERROR); - } - - /* - * These fields must be ASCII: - * Signature, OemId, OemTableId, AslCompilerId. - * We allow a NULL terminator in OemId and OemTableId. - */ - for (i = 0; i < ACPI_NAME_SIZE; i++) - { - if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i])) - { - return (AE_ERROR); - } - - if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i])) - { - return (AE_ERROR); - } - } - - for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++) - { - if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i])) - { - return (AE_ERROR); - } - } - - for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++) - { - if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i])) - { - return (AE_ERROR); - } - } - - printf ("Binary file appears to be a valid ACPI table, disassembling\n"); - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: FlCheckForAscii + * FUNCTION: FlIsFileAsciiSource * * PARAMETERS: Filename - Full input filename * DisplayErrors - TRUE if error messages desired @@ -163,7 +81,7 @@ FlCheckForAcpiTable ( ******************************************************************************/ ACPI_STATUS -FlCheckForAscii ( +FlIsFileAsciiSource ( char *Filename, BOOLEAN DisplayErrors) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Dec 18 18:35:46 2015 (r292447) @@ -167,11 +167,7 @@ CmDeleteCaches ( * aslascii - ascii support */ ACPI_STATUS -FlCheckForAcpiTable ( - FILE *Handle); - -ACPI_STATUS -FlCheckForAscii ( +FlIsFileAsciiSource ( char *Filename, BOOLEAN DisplayErrors); @@ -741,6 +737,10 @@ TrSetEndLineNumber ( ACPI_PARSE_OBJECT *Op); void +TrSetCurrentFilename ( + ACPI_PARSE_OBJECT *Op); + +void TrWalkTree ( void); @@ -923,6 +923,10 @@ DbgPrint ( #define ASL_PARSE_OUTPUT 1 #define ASL_TREE_OUTPUT 2 +BOOLEAN +UtQueryForOverwrite ( + char *Pathname); + void UtDisplaySupportedTables ( void); @@ -1281,6 +1285,6 @@ DtDoCompile( ACPI_STATUS DtCreateTemplates ( - char *Signature); + char **argv); #endif /* __ASLCOMPILER_H */ Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Fri Dec 18 18:35:46 2015 (r292447) @@ -106,10 +106,10 @@ /* Types for input files */ -#define ASL_INPUT_TYPE_BINARY 0 -#define ASL_INPUT_TYPE_ACPI_TABLE 1 -#define ASL_INPUT_TYPE_ASCII_ASL 2 -#define ASL_INPUT_TYPE_ASCII_DATA 3 +#define ASL_INPUT_TYPE_BINARY 0 +#define ASL_INPUT_TYPE_BINARY_ACPI_TABLE 1 +#define ASL_INPUT_TYPE_ASCII_ASL 2 +#define ASL_INPUT_TYPE_ASCII_DATA 3 /* Misc */ Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Fri Dec 18 18:35:46 2015 (r292447) @@ -336,6 +336,7 @@ FlOpenIncludeWithPrefix ( */ Gbl_CurrentLineNumber--; OriginalLineNumber = Gbl_CurrentLineNumber; + while (DtGetNextLine (IncludeFile, DT_ALLOW_MULTILINE_QUOTES) != ASL_EOF) { if (Gbl_CurrentLineBuffer[0] == '#') @@ -344,6 +345,7 @@ FlOpenIncludeWithPrefix ( Op, "use #include instead"); } } + Gbl_CurrentLineNumber = OriginalLineNumber; /* Must seek back to the start of the file */ @@ -570,7 +572,7 @@ FlOpenMiscOutputFiles ( /* All done for disassembler */ - if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE) + if (Gbl_FileType == ASL_INPUT_TYPE_BINARY_ACPI_TABLE) { return (AE_OK); } Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Fri Dec 18 18:35:46 2015 (r292447) @@ -197,6 +197,7 @@ ASL_EXTERN char ASL_ ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); ASL_EXTERN char *Gbl_CurrentInputFilename; ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalRefFilename, NULL); +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_PreviousIncludeFilename, NULL); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE); @@ -246,7 +247,6 @@ ASL_EXTERN ASL_LISTING_NODE ASL_ ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode; ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL); -ASL_EXTERN char *Gbl_TemplateSignature; ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0); Modified: vendor-sys/acpica/dist/source/compiler/asllisting.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asllisting.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/asllisting.c Fri Dec 18 18:35:46 2015 (r292447) @@ -277,6 +277,34 @@ LsTreeWriteWalk ( UtPrintFormattedName (Op->Asl.ParseOpcode, Level); + if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) + { + DbgPrint (ASL_TREE_OUTPUT, + "%10.4s ", Op->Asl.Value.Name); + } + else if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || + (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) + { + DbgPrint (ASL_TREE_OUTPUT, + "%10.32s ", Op->Asl.Value.String); + } + else if (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) + { + DbgPrint (ASL_TREE_OUTPUT, + "Open: %s\n", Op->Asl.Value.String); + return (AE_OK); + } + else if (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END) + { + DbgPrint (ASL_TREE_OUTPUT, + "Close: %s\n", Op->Asl.Filename); + return (AE_OK); + } + else + { + DbgPrint (ASL_TREE_OUTPUT, " "); + } + DbgPrint (ASL_TREE_OUTPUT, " (%.4X) Flags %8.8X", Op->Asl.ParseOpcode, Op->Asl.CompileFlags); TrPrintNodeCompileFlags (Op->Asl.CompileFlags); @@ -428,7 +456,7 @@ LsWriteNodeToListing ( /* Create a new listing node and push it */ - LsPushNode (Op->Asl.Child->Asl.Value.String); + LsPushNode (Op->Asl.Value.String); return; Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Fri Dec 18 18:35:46 2015 (r292447) @@ -127,7 +127,8 @@ Usage ( printf ("\nGeneral:\n"); ACPI_OPTION ("-@ ", "Specify command file"); ACPI_OPTION ("-I ", "Specify additional include directory"); - ACPI_OPTION ("-T |ALL|*", "Create table template file for ACPI "); + ACPI_OPTION ("-T |ALL", "Create ACPI table template/example files"); + ACPI_OPTION ("-T ", "Emit DSDT and SSDTs to same file"); ACPI_OPTION ("-p ", "Specify path/filename prefix for all output files"); ACPI_OPTION ("-v", "Display compiler version"); ACPI_OPTION ("-vo", "Enable optimization comments"); Modified: vendor-sys/acpica/dist/source/compiler/aslmap.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmap.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslmap.c Fri Dec 18 18:35:46 2015 (r292447) @@ -313,7 +313,7 @@ const ASL_MAPPING_ENTRY AslKeywordMa /* NOR */ OP_TABLE_ENTRY (AML_BIT_NOR_OP, 0, 0, ACPI_BTYPE_INTEGER), /* NOT */ OP_TABLE_ENTRY (AML_BIT_NOT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* NOTIFY */ OP_TABLE_ENTRY (AML_NOTIFY_OP, 0, 0, 0), -/* OBJECTTYPE */ OP_TABLE_ENTRY (AML_TYPE_OP, 0, 0, ACPI_BTYPE_INTEGER), +/* OBJECTTYPE */ OP_TABLE_ENTRY (AML_OBJECT_TYPE_OP, 0, 0, ACPI_BTYPE_INTEGER), /* OBJECTTYPE_BFF */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_BUFFER_FIELD, 0, 0), /* OBJECTTYPE_BUF */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_BUFFER, 0, 0), /* OBJECTTYPE_DDB */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_DDB_HANDLE, 0, 0), Modified: vendor-sys/acpica/dist/source/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Fri Dec 18 18:35:46 2015 (r292447) @@ -1510,7 +1510,6 @@ OpcGenerateAmlOpcode ( case PARSEOP_INCLUDE: - Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; Gbl_HasIncludeFiles = TRUE; break; Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloptions.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/asloptions.c Fri Dec 18 18:35:46 2015 (r292447) @@ -107,7 +107,7 @@ AslCommandLine ( if (Gbl_DoTemplates) { - Status = DtCreateTemplates (Gbl_TemplateSignature); + Status = DtCreateTemplates (argv); if (ACPI_FAILURE (Status)) { exit (-1); @@ -662,7 +662,6 @@ AslDoOptions ( case 'T': /* Create a ACPI table template file */ Gbl_DoTemplates = TRUE; - Gbl_TemplateSignature = AcpiGbl_Optarg; break; case 'v': /* Version and verbosity settings */ Modified: vendor-sys/acpica/dist/source/compiler/aslrules.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrules.y Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslrules.y Fri Dec 18 18:35:46 2015 (r292447) @@ -427,6 +427,7 @@ String CompilerDirective : IncludeTerm {} + | IncludeEndTerm {} | ExternalTerm {} ; @@ -1033,14 +1034,13 @@ IfTerm ; IncludeTerm - : PARSEOP_INCLUDE '(' {$$ = TrCreateLeafNode (PARSEOP_INCLUDE);} - String ')' {TrLinkChildren ($3,1,$4);FlOpenIncludeFile ($4);} - TermList - IncludeEndTerm {$$ = TrLinkPeerNodes (3,$3,$7,$8);} + : PARSEOP_INCLUDE '(' + String ')' {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); + FlOpenIncludeFile ($3);} ; IncludeEndTerm - : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} + : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END); TrSetCurrentFilename ($$);} ; IncTerm Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstartup.c Fri Dec 18 18:08:53 2015 (r292446) +++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Fri Dec 18 18:35:46 2015 (r292447) @@ -144,62 +144,63 @@ AslDetectSourceFileType ( ASL_FILE_INFO *Info) { char *FileChar; - UINT8 Type; + UINT8 Type = ASL_INPUT_TYPE_ASCII_DATA; /* default */ ACPI_STATUS Status; - /* Check for a valid binary ACPI table */ + /* Check for 100% ASCII source file (comments are ignored) */ - Status = FlCheckForAcpiTable (Info->Handle); + Status = FlIsFileAsciiSource (Info->Filename, FALSE); if (ACPI_SUCCESS (Status)) { - Type = ASL_INPUT_TYPE_ACPI_TABLE; - goto Cleanup; - } + /* + * File contains ASCII source code. Determine if this is an ASL + * file or an ACPI data table file. + */ + while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, Info->Handle)) + { + /* Uppercase the buffer for caseless compare */ - /* Check for 100% ASCII source file (comments are ignored) */ + FileChar = Gbl_CurrentLineBuffer; + while (*FileChar) + { + *FileChar = (char) toupper ((int) *FileChar); + FileChar++; + } - Status = FlCheckForAscii (Info->Filename, TRUE); - if (ACPI_FAILURE (Status)) - { - printf ("Invalid characters in input file - %s\n", Info->Filename); + /* Presence of "DefinitionBlock" indicates actual ASL code */ - if (!Gbl_IgnoreErrors) - { - Type = ASL_INPUT_TYPE_BINARY; - goto Cleanup; + if (strstr (Gbl_CurrentLineBuffer, "DEFINITIONBLOCK")) + { + /* Appears to be an ASL file */ + + Type = ASL_INPUT_TYPE_ASCII_ASL; + goto Cleanup; + } } - } - /* - * File is ASCII. Determine if this is an ASL file or an ACPI data - * table file. - */ - while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, Info->Handle)) - { - /* Uppercase the buffer for caseless compare */ + /* Appears to be an ASCII data table source file */ - FileChar = Gbl_CurrentLineBuffer; - while (*FileChar) - { - *FileChar = (char) toupper ((int) *FileChar); - FileChar++; - } + Type = ASL_INPUT_TYPE_ASCII_DATA; + goto Cleanup; + } - /* Presence of "DefinitionBlock" indicates actual ASL code */ + /* We have some sort of binary table, check for valid ACPI table */ - if (strstr (Gbl_CurrentLineBuffer, "DEFINITIONBLOCK")) - { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 18 18:36:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AC1A4BA6B; Fri, 18 Dec 2015 18:36:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F283A1F48; Fri, 18 Dec 2015 18:36:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIIaUWC082240; Fri, 18 Dec 2015 18:36:30 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIIaUbK082239; Fri, 18 Dec 2015 18:36:30 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201512181836.tBIIaUbK082239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 18 Dec 2015 18:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292448 - vendor-sys/acpica/20151218 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 18:36:31 -0000 Author: jkim Date: Fri Dec 18 18:36:29 2015 New Revision: 292448 URL: https://svnweb.freebsd.org/changeset/base/292448 Log: Tag ACPICA 20151218. Added: vendor-sys/acpica/20151218/ - copied from r292447, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Dec 18 19:15:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB6CA4B1B6; Fri, 18 Dec 2015 19:15:26 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 4325A178A; Fri, 18 Dec 2015 19:15:26 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 5AB8E56489; Fri, 18 Dec 2015 13:15:25 -0600 (CST) From: Eric van Gyzen Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk References: <201510261621.t9QGLuL2028872@repo.freebsd.org> <71109998-711D-4ECA-9B44-5A7B1F8705F3@FreeBSD.org> X-Enigmail-Draft-Status: N1110 To: David Chisnall Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-ID: <56745B49.6050903@FreeBSD.org> Date: Fri, 18 Dec 2015 13:15:21 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <71109998-711D-4ECA-9B44-5A7B1F8705F3@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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 19:15:26 -0000 David, I apologize for the slow reply. Your message went to my "stable" box, which I read less often. On 11/14/2015 12:30, David Chisnall wrote: > On 26 Oct 2015, at 16:21, Eric van Gyzen > wrote: >> >> One counter-argument to this change is that most applications >> already use SIMD, and the number of applications and amount of SIMD >> usage are only increasing. > > Note that SSE and SIMD are not the same thing. The x86-64 ABI uses > SSE registers for floating point arguments, so even a purely scalar > application that uses floating point will end up faulting in the SSE > state. I'm aware. Using the term "SIMD" was an admittedly weak attempt to be platform agnostic. > I believe that the no-sse option for clang is ABI-preserving, so will > not actually disable all SSE unless you also specify -msoft-float. I'm afraid that's not the case: $ cat square.c double square(double x) { return (x*x); } $ clang -mno-sse -c square.c fatal error: error in backend: SSE register return with SSE disabled clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) FreeBSD clang version 3.7.0 (tags/RELEASE_370/final 246257) 20150906 Target: x86_64-unknown-freebsd11.0 [snip] Shall I file the bug report, as it suggests? > I don’t think that libthr uses floating point anywhere, but libc does > and you only need to call one function that takes a floating point > argument in between context switches to lose this gain on x86-64. > With this change, we’re making the compiler emit less efficient code, > on the assumption that nothing will touch the fpu in the quantum > before the next context switch. I’d really like to see the set of > applications that you benchmarked the change with on x86-64 to reach > the conclusion that this is a net win overall. > > Or, to put it another way: How many applications are multithreaded > but don’t use any floating point code? If I showed you the applications that I care about the most, I would risk losing my job. When we updated from FreeBSD 9 to 10, we measured a significant loss in performance. This was due to multiple factors, one of which was that clang started using SSE widely. We were not yet using that version of clang for our own code, so most of the performance loss was due to the usage of SSE in libthr. Using -mno-sse restored the lost performance. It's possible that we lost performance due to SSE in other libraries; I haven't pursued this. These applications only use floating-point in some rare corners of management code, not in any performance-sensitive paths. They also don't use libc very much. On a recent head, I used this script https://people.freebsd.org/~vangyzen/thr_sse/thr_sse_file_line.sh to generate this list https://people.freebsd.org/~vangyzen/thr_sse/thr_sse_file_line.txt of line numbers in libthr that use SSE. I manually reviewed those to write this list: https://people.freebsd.org/~vangyzen/thr_sse/thr_sse_uses.txt The vast majority of these simply aren't interesting, because they would not be called in a performance-sensitive code path, or the code that uses SSE pales in comparison to the weight of the surrounding code. The only one that I find truly interesting is mutex_unlock_common(), which uses SSE to NULL two pointers in the "fast path", which is rather lightweight. So, I wrote this nanobenchmark https://people.freebsd.org/~vangyzen/thr_sse/movups/ to measure the effect of using SSE in such a way. I ran it on five machines and got these results: https://people.freebsd.org/~vangyzen/thr_sse/movups/summary.txt As you can see, most of them show no significant difference. One machine, however, showed a 16.7% improvement with SSE. I find this fascinating, and I honestly can't explain it. As always, I welcome feedback. I then wrote this /slightly/ more realistic microbenchmark https://people.freebsd.org/~vangyzen/thr_sse/mutex_bench/ which uses pthread_mutex_unlock and therefore mutex_unlock_common. I ran it on /that/ machine. I got these results: https://people.freebsd.org/~vangyzen/thr_sse/mutex_bench/summary.txt When libthr was compiled without SSE, the throughput was improved by 7.25%. Performance of a real-world application improved 3-5%. I honestly don't like the change any more than you do. I committed it just because it helped us measurably, it might help others, and I doubt it hurts anybody. If that last point is disproven, I'll be happy to revert it. Now, I look forward to a lively discussion. :) Eric From owner-svn-src-all@freebsd.org Fri Dec 18 19:50:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC7BA4A769; Fri, 18 Dec 2015 19:50:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7531A95; Fri, 18 Dec 2015 19:50:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27E5CB9B1; Fri, 18 Dec 2015 14:50:08 -0500 (EST) From: John Baldwin To: Hajimu UMEMOTO Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292444 - head/lib/libc/net Date: Fri, 18 Dec 2015 10:52:24 -0800 Message-ID: <1611462.93cE5rJSTP@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512181753.tBIHrJlb069987@repo.freebsd.org> References: <201512181753.tBIHrJlb069987@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Dec 2015 14:50:08 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 19:50:09 -0000 On Friday, December 18, 2015 05:53:19 PM Hajimu UMEMOTO wrote: > Author: ume > Date: Fri Dec 18 17:53:18 2015 > New Revision: 292444 > URL: https://svnweb.freebsd.org/changeset/base/292444 > > Log: > Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3). > > PR: 198092 > MFC after: 1 week Thanks! -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 18 19:50:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3386A4A78C; Fri, 18 Dec 2015 19:50:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A27F11B52; Fri, 18 Dec 2015 19:50:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A1C25B95B; Fri, 18 Dec 2015 14:50:10 -0500 (EST) From: John Baldwin To: araujo@freebsd.org Cc: Garrett Cooper , luke , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r292410 - head/usr.sbin/boot0cfg Date: Fri, 18 Dec 2015 09:50:25 -0800 Message-ID: <3897533.TozUtTrSHk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201512172042.tBHKg5bM091931@repo.freebsd.org> <30CD0290-06B9-4024-8EEE-F25090608D46@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Dec 2015 14:50:10 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 19:50:11 -0000 On Friday, December 18, 2015 02:17:16 PM Marcelo Araujo wrote: > 2015-12-18 13:53 GMT+08:00 Garrett Cooper : > > > > > > On Dec 17, 2015, at 21:36, luke wrote: > > > > > >> On Fri, Dec 18, 2015 at 4:42 AM, John Baldwin wrote: > > >> Author: jhb > > >> Date: Thu Dec 17 20:42:05 2015 > > >> New Revision: 292410 > > >> URL: https://svnweb.freebsd.org/changeset/base/292410 > > >> > > >> Log: > > >> Exit cleanly if malloc() fails to allocate a buffer for a copy of the > > >> current MBR. > > >> > > >> PR: 205322 > > >> Submitted by: Alexander Kuleshov > > >> MFC after: 1 week > > >> > > >> Modified: > > >> head/usr.sbin/boot0cfg/boot0cfg.c > > >> > > >> Modified: head/usr.sbin/boot0cfg/boot0cfg.c > > >> > > ============================================================================== > > >> --- head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:33:20 2015 > > (r292409) > > >> +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:42:05 2015 > > (r292410) > > >> @@ -337,6 +337,8 @@ read_mbr(const char *disk, u_int8_t **mb > > >> return (mbr_size); > > >> } > > >> *mbr = malloc(sizeof(buf)); > > >> + if (mbr == NULL) > > >> + errx(1, "%s: unable to allocate MBR buffer", disk); > > >> memcpy(*mbr, buf, sizeof(buf)); > > >> close(fd); > > > > > > > Hi, > > > > > > Should the check be against *mbr ? > > > + if (*mbr == NULL) > > > + errx(1, "%s: unable to allocate MBR buffer", disk); > > > > Yup! > > > > +1 > > Could be write as: > if ((*mbr = malloc(sizeof(buf))) == NULL) > errx(1, "%s: unable to allocate MBR buffer", disk); Yes, but I don't like side effects in conditionals. OTOH, changing away from that is how I fubar'd the original patch. :-/ -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 18 19:50:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F39A4A778; Fri, 18 Dec 2015 19:50:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50E841AD5; Fri, 18 Dec 2015 19:50:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 659CCB9BD; Fri, 18 Dec 2015 14:50:09 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292443 - head/usr.sbin/boot0cfg Date: Fri, 18 Dec 2015 10:52:03 -0800 Message-ID: <4551997.kZkP8Dg75z@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512181752.tBIHq9QN069909@repo.freebsd.org> References: <201512181752.tBIHq9QN069909@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Dec 2015 14:50:09 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 19:50:10 -0000 On Friday, December 18, 2015 05:52:09 PM John Baldwin wrote: > Author: jhb > Date: Fri Dec 18 17:52:08 2015 > New Revision: 292443 > URL: https://svnweb.freebsd.org/changeset/base/292443 > > Log: > Fix the precious change to check the pointer returned by malloc(). s/precious/previous/. The previous commit was clearly not very precious. :-/ -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 18 19:58:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17CF8A4AF0A; Fri, 18 Dec 2015 19:58:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDAE91602; Fri, 18 Dec 2015 19:58:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIJwZQh005825; Fri, 18 Dec 2015 19:58:35 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIJwZ6X005824; Fri, 18 Dec 2015 19:58:35 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512181958.tBIJwZ6X005824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 18 Dec 2015 19:58: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: r292450 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 19:58:36 -0000 Author: jilles Date: Fri Dec 18 19:58:34 2015 New Revision: 292450 URL: https://svnweb.freebsd.org/changeset/base/292450 Log: MFC r291770: rc.subr: Check for running daemons before a custom start_cmd is executed. Currently rc scripts implementing their own start_cmd do not enjoy the benefits of rc.subr's own check for rc_pid. This leads to around a third of ports with such a start_cmd not to check for the process at all and two thirds of ports to re-implement this check (sometimes wrongly). This patch moves the check for rc_pid to before ${rc_arg}_cmd is executed. Submitted by: Dirk Engling Reviewed by: feld Relnotes: yes Modified: stable/10/etc/rc.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.subr ============================================================================== --- stable/10/etc/rc.subr Fri Dec 18 19:29:58 2015 (r292449) +++ stable/10/etc/rc.subr Fri Dec 18 19:58:34 2015 (r292450) @@ -974,6 +974,14 @@ run_rc_command() fi fi + if [ $rc_arg = "start" -a -z "$rc_fast" -a -n "$rc_pid" ]; then + if [ -z "$rc_quiet" ]; then + echo 1>&2 "${name} already running? " \ + "(pid=$rc_pid)." + fi + return 1 + fi + # if there's a custom ${XXX_cmd}, # run that instead of the default # @@ -1002,14 +1010,6 @@ run_rc_command() ;; start) - if [ -z "$rc_fast" -a -n "$rc_pid" ]; then - if [ -z "$rc_quiet" ]; then - echo 1>&2 "${name} already running? " \ - "(pid=$rc_pid)." - fi - return 1 - fi - if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then warn "run_rc_command: cannot run $command" return 1 From owner-svn-src-all@freebsd.org Fri Dec 18 20:21:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E762DA4BD28; Fri, 18 Dec 2015 20:21:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7BDEF1340; Fri, 18 Dec 2015 20:21:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id D277A3C4D27; Sat, 19 Dec 2015 07:21:23 +1100 (AEDT) Date: Sat, 19 Dec 2015 07:21:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292443 - head/usr.sbin/boot0cfg In-Reply-To: <201512181752.tBIHq9QN069909@repo.freebsd.org> Message-ID: <20151219063208.M2407@besplex.bde.org> References: <201512181752.tBIHq9QN069909@repo.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=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=t5GoHRYVe5rdrHgZcJgA:9 a=MvHf3p7H2XhwkImM:21 a=84w2aD5DFUGud9fB:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 20:21:37 -0000 On Fri, 18 Dec 2015, John Baldwin wrote: > Log: > Fix the precious change to check the pointer returned by malloc(). > > Submitted by: luke > Pointy hat to: jhb Of course, malloc can't fail, especially for small utilities like boot0cfg, especially in -current. > Modified: head/usr.sbin/boot0cfg/boot0cfg.c > ============================================================================== > --- head/usr.sbin/boot0cfg/boot0cfg.c Fri Dec 18 17:39:54 2015 (r292442) > +++ head/usr.sbin/boot0cfg/boot0cfg.c Fri Dec 18 17:52:08 2015 (r292443) > @@ -337,7 +337,7 @@ read_mbr(const char *disk, u_int8_t **mb > return (mbr_size); > } > *mbr = malloc(sizeof(buf)); > - if (mbr == NULL) > + if (*mbr == NULL) > errx(1, "%s: unable to allocate MBR buffer", disk); Style bug. Someone suggested using the 'if ((*mbr = malloc(...)) == NULL)' style. That might be less clear, but it is what is used elswhere in the program, including for the old malloc check. Also, the error messages are too different. The other one calls the buffer a "read" buffer although it spells its variable name mbr. > memcpy(*mbr, buf, sizeof(buf)); > close(fd); Program for checking that malloc can't fail: X #define SIZE 16 X X #include X #include X #include X X int X main(void) X { X char *p; X size_t tot; X X tot = 0; X while ((p = malloc(SIZE)) != NULL) { X bzero(p, SIZE); X tot += SIZE; X if (tot > 4 * 1024 * 1024) X errx(1, "giving up after allocating %zu bytes", tot); X } X errx(1, "malloc failed after allocating %zu bytes", tot); X } It is hard to get this to fail in -current. ulimit -Sm 4096 no longer works for limiting data size (ulimit -m never worked). Virtual memory must be limited in -current. But ulimit -Sv 4096 prevents most programs from starting, due to bugs in dynamic linkage: pts/9:bde@freefall:~/zz> ulimit -Sv 4096 pts/9:bde@freefall:~/zz> ls /lib/libutil.so.9: mmap of entire address space failed: Cannot allocate memory pts/9:bde@freefall:~/zz> ./z /lib/libc.so.7: mmap of entire address space failed: Cannot allocate memory "./z" is this program. Linking the program statically makes it run in the measly 4096k of virtual and mallocable memory. It then allocates 4194320 bytes using the small allocation size. Of course, cc can't run in 4096k. However, it is not necessary to map the _entire_ address space like the error messages say. Dynamic "./z" runs in a measly 10000k. ls fails as above up to at least 12000k, but dumps core with 14000k. ls starts working with a measly 16000k. cc needs more still. I didn't find the exact requirement, and used 160000k to compile this little program. Not so measly. The program is careful to touch all the memory that it allocates. Without that, I think things are even more broken. Somehow the process virtual size doesn't grown above 6.2M. Apparently even the virtual memory is not completely allocated until it is used. So malloc() returns success, but failures may happen much later when the memory is used. Similarly with SIZE = 16MB but only the first byte of each allocation touched. OTOH, with size = 16MB all touched and no limits, the process grows very large and takes too long to respond to job control symbols, as if it is swapping. The -d and -m limits don't work for preventing growth of its real memory. ulimit -Sv should be used in testing since ulimit -v sets the hard limit and prevents restoring a usable soft limit. Setting -v to a low value (lower than 16000k for ls) is not useful except for testing malloc failure since it gives an unusable shell. Bruce From owner-svn-src-all@freebsd.org Fri Dec 18 20:54:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83D7EA4CEA6; Fri, 18 Dec 2015 20:54:07 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEAB112B; Fri, 18 Dec 2015 20:54:06 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from [IPv6:2a02:1811:2419:4e02:296a:ad0f:f23e:3458] (unknown [IPv6:2a02:1811:2419:4e02:296a:ad0f:f23e:3458]) by venus.codepro.be (Postfix) with ESMTPSA id C9D278BBE; Fri, 18 Dec 2015 21:54:04 +0100 (CET) Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=utf-8 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <201512160056.tBG0ujqA067178@repo.freebsd.org> Date: Fri, 18 Dec 2015 21:54:03 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3E097253-0E8E-4A50-B1BD-8C9A280E6CD0@sigsegv.be> References: <201512160056.tBG0ujqA067178@repo.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 20:54:07 -0000 > On 16 Dec 2015, at 01:56, Randall Stewart wrote: >=20 > Author: rrs > Date: Wed Dec 16 00:56:45 2015 > New Revision: 292309 > URL: https://svnweb.freebsd.org/changeset/base/292309 >=20 > Log: > First cut of the modularization of our TCP stack. Still > to do is to clean up the timer handling using the async-drain. > Other optimizations may be coming to go with this. Whats here > will allow differnet tcp implementations (one included). > Reviewed by: jtl, hiren, transports > Sponsored by: Netflix Inc. > Differential Revision: D4055 I suspect this commit broke my machine. I run VIMAGE jails, and see the = following panic as soon as the first jails starts: panic: lock "tcp_func_lock" 0xffffffff81d11dd0 already initialised #0 doadump (textdump=3D1) at pcpu.h:221 #1 0xffffffff80a25b55 in kern_reboot (howto=3D260) at = /usr/src/sys/kern/kern_shutdown.c:364 #2 0xffffffff80a2612b in vpanic (fmt=3D, ap=3D) at /usr/src/sys/kern/kern_shutdown.c:757 #3 0xffffffff80a25f66 in kassert_panic (fmt=3D) at = /usr/src/sys/kern/kern_shutdown.c:647 #4 0xffffffff80a64335 in lock_init (lock=3D0xffffffff81d11dd0, = class=3D0xffffffff8188eb40, name=3D0xffffffff813c4f54 "tcp_func_lock", = type=3D0x0, flags=3D2228224) at /usr/src/sys/kern/subr_lock.c:78 #5 0xffffffff80a231ed in _rw_init_flags (c=3D0xffffffff81d11de8, = name=3D0xffffffff813c4f54 "tcp_func_lock", opts=3D) = at /usr/src/sys/kern/kern_rwlock.c:209 #6 0xffffffff80bfa38f in tcp_init () at = /usr/src/sys/netinet/tcp_subr.c:598 #7 0xffffffff80aa15e8 in vnet_domain_init (arg=3D0xffffffff818ac898) at = /usr/src/sys/kern/uipc_domain.c:175 #8 0xffffffff80b207d7 in vnet_alloc () at /usr/src/sys/net/vnet.c:575 #9 0xffffffff809f1763 in kern_jail_set (td=3D0xfffff80011a244d0, = optuio=3D0xfffff800045d0600, flags=3D1) at = /usr/src/sys/kern/kern_jail.c:1353 #10 0xffffffff809f3151 in sys_jail_set (td=3D0xfffff80011a244d0, = uap=3D0xfffffe0239f02b80) at /usr/src/sys/kern/kern_jail.c:534 #11 0xffffffff80e8911b in amd64_syscall (td=3D0xfffff80011a244d0, = traced=3D0) at subr_syscall.c:135 #12 0xffffffff80e6908b in Xfast_syscall () at = /usr/src/sys/amd64/amd64/exception.S:394 #13 0x0000000800e9f8ca in ?? () That was with r292398, but I=E2=80=99ve just tested r292448 and it=E2=80=99= s still affected. Regards, Kristof From owner-svn-src-all@freebsd.org Fri Dec 18 21:34:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F3DA4C67E; Fri, 18 Dec 2015 21:34:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C63841F76; Fri, 18 Dec 2015 21:34:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBILYSKl034514; Fri, 18 Dec 2015 21:34:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBILYSBJ034509; Fri, 18 Dec 2015 21:34:28 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512182134.tBILYSBJ034509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 18 Dec 2015 21:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292453 - in head: share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 21:34:30 -0000 Author: bapt Date: Fri Dec 18 21:34:28 2015 New Revision: 292453 URL: https://svnweb.freebsd.org/changeset/base/292453 Log: Simplify the locale generated Makefiles by using bmake multi variables for loops Modified: head/share/colldef/Makefile head/share/ctypedef/Makefile head/share/monetdef/Makefile head/share/msgdef/Makefile head/share/numericdef/Makefile head/share/timedef/Makefile head/tools/tools/locale/tools/cldr2def.pl head/tools/tools/locale/tools/finalize (contents, props changed) Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Fri Dec 18 21:18:07 2015 (r292452) +++ head/share/colldef/Makefile Fri Dec 18 21:34:28 2015 (r292453) @@ -47,170 +47,170 @@ LOCALES+= uk_UA.UTF-8 LOCALES+= zh_Hans_CN.UTF-8 LOCALES+= zh_Hant_TW.UTF-8 -SAME+= af_ZA.UTF-8:af_ZA.ISO8859-15 -SAME+= af_ZA.UTF-8:af_ZA.ISO8859-1 -SAME+= ar_SA.UTF-8:ar_QA.UTF-8 -SAME+= ar_SA.UTF-8:ar_MA.UTF-8 -SAME+= ar_SA.UTF-8:ar_JO.UTF-8 -SAME+= ar_SA.UTF-8:ar_EG.UTF-8 -SAME+= ar_SA.UTF-8:ar_AE.UTF-8 -SAME+= be_BY.UTF-8:be_BY.ISO8859-5 -SAME+= be_BY.UTF-8:be_BY.CP1251 -SAME+= be_BY.UTF-8:be_BY.CP1131 -SAME+= ru_RU.UTF-8:sr_Cyrl_RS.UTF-8 -SAME+= ru_RU.UTF-8:sr_Cyrl_RS.ISO8859-5 -SAME+= ru_RU.UTF-8:ru_RU.KOI8-R -SAME+= ru_RU.UTF-8:ru_RU.ISO8859-5 -SAME+= ru_RU.UTF-8:ru_RU.CP866 -SAME+= ru_RU.UTF-8:ru_RU.CP1251 -SAME+= ru_RU.UTF-8:mn_Cyrl_MN.UTF-8 -SAME+= ru_RU.UTF-8:bg_BG.UTF-8 -SAME+= ru_RU.UTF-8:bg_BG.CP1251 -SAME+= ca_AD.UTF-8:ca_IT.UTF-8 -SAME+= ca_AD.UTF-8:ca_IT.ISO8859-15 -SAME+= ca_AD.UTF-8:ca_IT.ISO8859-1 -SAME+= ca_AD.UTF-8:ca_FR.UTF-8 -SAME+= ca_AD.UTF-8:ca_FR.ISO8859-15 -SAME+= ca_AD.UTF-8:ca_FR.ISO8859-1 -SAME+= ca_AD.UTF-8:ca_ES.UTF-8 -SAME+= ca_AD.UTF-8:ca_ES.ISO8859-15 -SAME+= ca_AD.UTF-8:ca_ES.ISO8859-1 -SAME+= ca_AD.UTF-8:ca_AD.ISO8859-15 -SAME+= ca_AD.UTF-8:ca_AD.ISO8859-1 -SAME+= cs_CZ.UTF-8:cs_CZ.ISO8859-2 -SAME+= da_DK.UTF-8:da_DK.ISO8859-15 -SAME+= da_DK.UTF-8:da_DK.ISO8859-1 -SAME+= en_US.UTF-8:sr_Latn_RS.UTF-8 -SAME+= en_US.UTF-8:sr_Latn_RS.ISO8859-2 -SAME+= en_US.UTF-8:pt_PT.UTF-8 -SAME+= en_US.UTF-8:pt_PT.ISO8859-15 -SAME+= en_US.UTF-8:pt_PT.ISO8859-1 -SAME+= en_US.UTF-8:pt_BR.UTF-8 -SAME+= en_US.UTF-8:pt_BR.ISO8859-1 -SAME+= en_US.UTF-8:nn_NO.UTF-8 -SAME+= en_US.UTF-8:nn_NO.ISO8859-15 -SAME+= en_US.UTF-8:nn_NO.ISO8859-1 -SAME+= en_US.UTF-8:nl_NL.UTF-8 -SAME+= en_US.UTF-8:nl_NL.ISO8859-15 -SAME+= en_US.UTF-8:nl_NL.ISO8859-1 -SAME+= en_US.UTF-8:nl_BE.UTF-8 -SAME+= en_US.UTF-8:nl_BE.ISO8859-15 -SAME+= en_US.UTF-8:nl_BE.ISO8859-1 -SAME+= en_US.UTF-8:it_IT.UTF-8 -SAME+= en_US.UTF-8:it_IT.ISO8859-15 -SAME+= en_US.UTF-8:it_IT.ISO8859-1 -SAME+= en_US.UTF-8:it_CH.UTF-8 -SAME+= en_US.UTF-8:it_CH.ISO8859-15 -SAME+= en_US.UTF-8:it_CH.ISO8859-1 -SAME+= en_US.UTF-8:fr_FR.UTF-8 -SAME+= en_US.UTF-8:fr_FR.ISO8859-15 -SAME+= en_US.UTF-8:fr_FR.ISO8859-1 -SAME+= en_US.UTF-8:fr_CH.UTF-8 -SAME+= en_US.UTF-8:fr_CH.ISO8859-15 -SAME+= en_US.UTF-8:fr_CH.ISO8859-1 -SAME+= en_US.UTF-8:fr_CA.UTF-8 -SAME+= en_US.UTF-8:fr_CA.ISO8859-15 -SAME+= en_US.UTF-8:fr_CA.ISO8859-1 -SAME+= en_US.UTF-8:fr_BE.UTF-8 -SAME+= en_US.UTF-8:fr_BE.ISO8859-15 -SAME+= en_US.UTF-8:fr_BE.ISO8859-1 -SAME+= en_US.UTF-8:eu_ES.UTF-8 -SAME+= en_US.UTF-8:eu_ES.ISO8859-15 -SAME+= en_US.UTF-8:eu_ES.ISO8859-1 -SAME+= en_US.UTF-8:en_ZA.UTF-8 -SAME+= en_US.UTF-8:en_ZA.US-ASCII -SAME+= en_US.UTF-8:en_ZA.ISO8859-15 -SAME+= en_US.UTF-8:en_ZA.ISO8859-1 -SAME+= en_US.UTF-8:en_US.US-ASCII -SAME+= en_US.UTF-8:en_US.ISO8859-15 -SAME+= en_US.UTF-8:en_US.ISO8859-1 -SAME+= en_US.UTF-8:en_SG.UTF-8 -SAME+= en_US.UTF-8:en_SG.ISO8859-1 -SAME+= en_US.UTF-8:en_PH.UTF-8 -SAME+= en_US.UTF-8:en_NZ.UTF-8 -SAME+= en_US.UTF-8:en_NZ.US-ASCII -SAME+= en_US.UTF-8:en_NZ.ISO8859-15 -SAME+= en_US.UTF-8:en_NZ.ISO8859-1 -SAME+= en_US.UTF-8:en_IE.UTF-8 -SAME+= en_US.UTF-8:en_IE.ISO8859-15 -SAME+= en_US.UTF-8:en_IE.ISO8859-1 -SAME+= en_US.UTF-8:en_HK.UTF-8 -SAME+= en_US.UTF-8:en_HK.ISO8859-1 -SAME+= en_US.UTF-8:en_GB.UTF-8 -SAME+= en_US.UTF-8:en_GB.US-ASCII -SAME+= en_US.UTF-8:en_GB.ISO8859-15 -SAME+= en_US.UTF-8:en_GB.ISO8859-1 -SAME+= en_US.UTF-8:en_CA.UTF-8 -SAME+= en_US.UTF-8:en_CA.US-ASCII -SAME+= en_US.UTF-8:en_CA.ISO8859-15 -SAME+= en_US.UTF-8:en_CA.ISO8859-1 -SAME+= en_US.UTF-8:en_AU.UTF-8 -SAME+= en_US.UTF-8:en_AU.US-ASCII -SAME+= en_US.UTF-8:en_AU.ISO8859-15 -SAME+= en_US.UTF-8:en_AU.ISO8859-1 -SAME+= en_US.UTF-8:de_DE.UTF-8 -SAME+= en_US.UTF-8:de_DE.ISO8859-15 -SAME+= en_US.UTF-8:de_DE.ISO8859-1 -SAME+= en_US.UTF-8:de_CH.UTF-8 -SAME+= en_US.UTF-8:de_CH.ISO8859-15 -SAME+= en_US.UTF-8:de_CH.ISO8859-1 -SAME+= en_US.UTF-8:de_AT.UTF-8 -SAME+= en_US.UTF-8:de_AT.ISO8859-15 -SAME+= en_US.UTF-8:de_AT.ISO8859-1 -SAME+= el_GR.UTF-8:el_GR.ISO8859-7 -SAME+= es_MX.UTF-8:es_MX.ISO8859-1 -SAME+= es_MX.UTF-8:es_ES.UTF-8 -SAME+= es_MX.UTF-8:es_ES.ISO8859-15 -SAME+= es_MX.UTF-8:es_ES.ISO8859-1 -SAME+= es_MX.UTF-8:es_CR.UTF-8 -SAME+= es_MX.UTF-8:es_AR.UTF-8 -SAME+= es_MX.UTF-8:es_AR.ISO8859-1 -SAME+= et_EE.UTF-8:et_EE.ISO8859-15 -SAME+= et_EE.UTF-8:et_EE.ISO8859-1 -SAME+= fi_FI.UTF-8:fi_FI.ISO8859-15 -SAME+= fi_FI.UTF-8:fi_FI.ISO8859-1 -SAME+= hi_IN.UTF-8:hi_IN.ISCII-DEV -SAME+= hr_HR.UTF-8:hr_HR.ISO8859-2 -SAME+= hu_HU.UTF-8:hu_HU.ISO8859-2 -SAME+= hy_AM.UTF-8:hy_AM.ARMSCII-8 -SAME+= is_IS.UTF-8:is_IS.ISO8859-15 -SAME+= is_IS.UTF-8:is_IS.ISO8859-1 -SAME+= ja_JP.UTF-8:ja_JP.SJIS -SAME+= ja_JP.UTF-8:ja_JP.eucJP -SAME+= ko_KR.UTF-8:ko_KR.eucKR -SAME+= lt_LT.UTF-8:lt_LT.ISO8859-13 -SAME+= lv_LV.UTF-8:lv_LV.ISO8859-13 -SAME+= nb_NO.UTF-8:nb_NO.ISO8859-15 -SAME+= nb_NO.UTF-8:nb_NO.ISO8859-1 -SAME+= pl_PL.UTF-8:pl_PL.ISO8859-2 -SAME+= ro_RO.UTF-8:ro_RO.ISO8859-2 -SAME+= se_NO.UTF-8:se_FI.UTF-8 -SAME+= sk_SK.UTF-8:sk_SK.ISO8859-2 -SAME+= sl_SI.UTF-8:sl_SI.ISO8859-2 -SAME+= sv_SE.UTF-8:sv_SE.ISO8859-15 -SAME+= sv_SE.UTF-8:sv_SE.ISO8859-1 -SAME+= sv_SE.UTF-8:sv_FI.UTF-8 -SAME+= sv_SE.UTF-8:sv_FI.ISO8859-15 -SAME+= sv_SE.UTF-8:sv_FI.ISO8859-1 -SAME+= tr_TR.UTF-8:tr_TR.ISO8859-9 -SAME+= uk_UA.UTF-8:uk_UA.KOI8-U -SAME+= uk_UA.UTF-8:uk_UA.ISO8859-5 -SAME+= uk_UA.UTF-8:uk_UA.CP1251 -SAME+= zh_Hans_CN.UTF-8:zh_Hans_CN.GBK -SAME+= zh_Hans_CN.UTF-8:zh_Hans_CN.GB2312 -SAME+= zh_Hans_CN.UTF-8:zh_Hans_CN.GB18030 -SAME+= zh_Hans_CN.UTF-8:zh_Hans_CN.eucCN -SAME+= zh_Hant_TW.UTF-8:zh_Hant_TW.Big5 -SAME+= zh_Hant_TW.UTF-8:zh_Hant_HK.UTF-8 -SAME+= zh_Hant_TW.UTF-8:zh_Hant_HK.Big5HKSCS -SAME+= ko_KR.eucKR:ko_KR.CP949 # legacy (same charset) +SAME+= af_ZA.UTF-8 af_ZA.ISO8859-15 +SAME+= af_ZA.UTF-8 af_ZA.ISO8859-1 +SAME+= ar_SA.UTF-8 ar_QA.UTF-8 +SAME+= ar_SA.UTF-8 ar_MA.UTF-8 +SAME+= ar_SA.UTF-8 ar_JO.UTF-8 +SAME+= ar_SA.UTF-8 ar_EG.UTF-8 +SAME+= ar_SA.UTF-8 ar_AE.UTF-8 +SAME+= be_BY.UTF-8 be_BY.ISO8859-5 +SAME+= be_BY.UTF-8 be_BY.CP1251 +SAME+= be_BY.UTF-8 be_BY.CP1131 +SAME+= ru_RU.UTF-8 sr_Cyrl_RS.UTF-8 +SAME+= ru_RU.UTF-8 sr_Cyrl_RS.ISO8859-5 +SAME+= ru_RU.UTF-8 ru_RU.KOI8-R +SAME+= ru_RU.UTF-8 ru_RU.ISO8859-5 +SAME+= ru_RU.UTF-8 ru_RU.CP866 +SAME+= ru_RU.UTF-8 ru_RU.CP1251 +SAME+= ru_RU.UTF-8 mn_Cyrl_MN.UTF-8 +SAME+= ru_RU.UTF-8 bg_BG.UTF-8 +SAME+= ru_RU.UTF-8 bg_BG.CP1251 +SAME+= ca_AD.UTF-8 ca_IT.UTF-8 +SAME+= ca_AD.UTF-8 ca_IT.ISO8859-15 +SAME+= ca_AD.UTF-8 ca_IT.ISO8859-1 +SAME+= ca_AD.UTF-8 ca_FR.UTF-8 +SAME+= ca_AD.UTF-8 ca_FR.ISO8859-15 +SAME+= ca_AD.UTF-8 ca_FR.ISO8859-1 +SAME+= ca_AD.UTF-8 ca_ES.UTF-8 +SAME+= ca_AD.UTF-8 ca_ES.ISO8859-15 +SAME+= ca_AD.UTF-8 ca_ES.ISO8859-1 +SAME+= ca_AD.UTF-8 ca_AD.ISO8859-15 +SAME+= ca_AD.UTF-8 ca_AD.ISO8859-1 +SAME+= cs_CZ.UTF-8 cs_CZ.ISO8859-2 +SAME+= da_DK.UTF-8 da_DK.ISO8859-15 +SAME+= da_DK.UTF-8 da_DK.ISO8859-1 +SAME+= en_US.UTF-8 sr_Latn_RS.UTF-8 +SAME+= en_US.UTF-8 sr_Latn_RS.ISO8859-2 +SAME+= en_US.UTF-8 pt_PT.UTF-8 +SAME+= en_US.UTF-8 pt_PT.ISO8859-15 +SAME+= en_US.UTF-8 pt_PT.ISO8859-1 +SAME+= en_US.UTF-8 pt_BR.UTF-8 +SAME+= en_US.UTF-8 pt_BR.ISO8859-1 +SAME+= en_US.UTF-8 nn_NO.UTF-8 +SAME+= en_US.UTF-8 nn_NO.ISO8859-15 +SAME+= en_US.UTF-8 nn_NO.ISO8859-1 +SAME+= en_US.UTF-8 nl_NL.UTF-8 +SAME+= en_US.UTF-8 nl_NL.ISO8859-15 +SAME+= en_US.UTF-8 nl_NL.ISO8859-1 +SAME+= en_US.UTF-8 nl_BE.UTF-8 +SAME+= en_US.UTF-8 nl_BE.ISO8859-15 +SAME+= en_US.UTF-8 nl_BE.ISO8859-1 +SAME+= en_US.UTF-8 it_IT.UTF-8 +SAME+= en_US.UTF-8 it_IT.ISO8859-15 +SAME+= en_US.UTF-8 it_IT.ISO8859-1 +SAME+= en_US.UTF-8 it_CH.UTF-8 +SAME+= en_US.UTF-8 it_CH.ISO8859-15 +SAME+= en_US.UTF-8 it_CH.ISO8859-1 +SAME+= en_US.UTF-8 fr_FR.UTF-8 +SAME+= en_US.UTF-8 fr_FR.ISO8859-15 +SAME+= en_US.UTF-8 fr_FR.ISO8859-1 +SAME+= en_US.UTF-8 fr_CH.UTF-8 +SAME+= en_US.UTF-8 fr_CH.ISO8859-15 +SAME+= en_US.UTF-8 fr_CH.ISO8859-1 +SAME+= en_US.UTF-8 fr_CA.UTF-8 +SAME+= en_US.UTF-8 fr_CA.ISO8859-15 +SAME+= en_US.UTF-8 fr_CA.ISO8859-1 +SAME+= en_US.UTF-8 fr_BE.UTF-8 +SAME+= en_US.UTF-8 fr_BE.ISO8859-15 +SAME+= en_US.UTF-8 fr_BE.ISO8859-1 +SAME+= en_US.UTF-8 eu_ES.UTF-8 +SAME+= en_US.UTF-8 eu_ES.ISO8859-15 +SAME+= en_US.UTF-8 eu_ES.ISO8859-1 +SAME+= en_US.UTF-8 en_ZA.UTF-8 +SAME+= en_US.UTF-8 en_ZA.US-ASCII +SAME+= en_US.UTF-8 en_ZA.ISO8859-15 +SAME+= en_US.UTF-8 en_ZA.ISO8859-1 +SAME+= en_US.UTF-8 en_US.US-ASCII +SAME+= en_US.UTF-8 en_US.ISO8859-15 +SAME+= en_US.UTF-8 en_US.ISO8859-1 +SAME+= en_US.UTF-8 en_SG.UTF-8 +SAME+= en_US.UTF-8 en_SG.ISO8859-1 +SAME+= en_US.UTF-8 en_PH.UTF-8 +SAME+= en_US.UTF-8 en_NZ.UTF-8 +SAME+= en_US.UTF-8 en_NZ.US-ASCII +SAME+= en_US.UTF-8 en_NZ.ISO8859-15 +SAME+= en_US.UTF-8 en_NZ.ISO8859-1 +SAME+= en_US.UTF-8 en_IE.UTF-8 +SAME+= en_US.UTF-8 en_IE.ISO8859-15 +SAME+= en_US.UTF-8 en_IE.ISO8859-1 +SAME+= en_US.UTF-8 en_HK.UTF-8 +SAME+= en_US.UTF-8 en_HK.ISO8859-1 +SAME+= en_US.UTF-8 en_GB.UTF-8 +SAME+= en_US.UTF-8 en_GB.US-ASCII +SAME+= en_US.UTF-8 en_GB.ISO8859-15 +SAME+= en_US.UTF-8 en_GB.ISO8859-1 +SAME+= en_US.UTF-8 en_CA.UTF-8 +SAME+= en_US.UTF-8 en_CA.US-ASCII +SAME+= en_US.UTF-8 en_CA.ISO8859-15 +SAME+= en_US.UTF-8 en_CA.ISO8859-1 +SAME+= en_US.UTF-8 en_AU.UTF-8 +SAME+= en_US.UTF-8 en_AU.US-ASCII +SAME+= en_US.UTF-8 en_AU.ISO8859-15 +SAME+= en_US.UTF-8 en_AU.ISO8859-1 +SAME+= en_US.UTF-8 de_DE.UTF-8 +SAME+= en_US.UTF-8 de_DE.ISO8859-15 +SAME+= en_US.UTF-8 de_DE.ISO8859-1 +SAME+= en_US.UTF-8 de_CH.UTF-8 +SAME+= en_US.UTF-8 de_CH.ISO8859-15 +SAME+= en_US.UTF-8 de_CH.ISO8859-1 +SAME+= en_US.UTF-8 de_AT.UTF-8 +SAME+= en_US.UTF-8 de_AT.ISO8859-15 +SAME+= en_US.UTF-8 de_AT.ISO8859-1 +SAME+= el_GR.UTF-8 el_GR.ISO8859-7 +SAME+= es_MX.UTF-8 es_MX.ISO8859-1 +SAME+= es_MX.UTF-8 es_ES.UTF-8 +SAME+= es_MX.UTF-8 es_ES.ISO8859-15 +SAME+= es_MX.UTF-8 es_ES.ISO8859-1 +SAME+= es_MX.UTF-8 es_CR.UTF-8 +SAME+= es_MX.UTF-8 es_AR.UTF-8 +SAME+= es_MX.UTF-8 es_AR.ISO8859-1 +SAME+= et_EE.UTF-8 et_EE.ISO8859-15 +SAME+= et_EE.UTF-8 et_EE.ISO8859-1 +SAME+= fi_FI.UTF-8 fi_FI.ISO8859-15 +SAME+= fi_FI.UTF-8 fi_FI.ISO8859-1 +SAME+= hi_IN.UTF-8 hi_IN.ISCII-DEV +SAME+= hr_HR.UTF-8 hr_HR.ISO8859-2 +SAME+= hu_HU.UTF-8 hu_HU.ISO8859-2 +SAME+= hy_AM.UTF-8 hy_AM.ARMSCII-8 +SAME+= is_IS.UTF-8 is_IS.ISO8859-15 +SAME+= is_IS.UTF-8 is_IS.ISO8859-1 +SAME+= ja_JP.UTF-8 ja_JP.SJIS +SAME+= ja_JP.UTF-8 ja_JP.eucJP +SAME+= ko_KR.UTF-8 ko_KR.eucKR +SAME+= lt_LT.UTF-8 lt_LT.ISO8859-13 +SAME+= lv_LV.UTF-8 lv_LV.ISO8859-13 +SAME+= nb_NO.UTF-8 nb_NO.ISO8859-15 +SAME+= nb_NO.UTF-8 nb_NO.ISO8859-1 +SAME+= pl_PL.UTF-8 pl_PL.ISO8859-2 +SAME+= ro_RO.UTF-8 ro_RO.ISO8859-2 +SAME+= se_NO.UTF-8 se_FI.UTF-8 +SAME+= sk_SK.UTF-8 sk_SK.ISO8859-2 +SAME+= sl_SI.UTF-8 sl_SI.ISO8859-2 +SAME+= sv_SE.UTF-8 sv_SE.ISO8859-15 +SAME+= sv_SE.UTF-8 sv_SE.ISO8859-1 +SAME+= sv_SE.UTF-8 sv_FI.UTF-8 +SAME+= sv_SE.UTF-8 sv_FI.ISO8859-15 +SAME+= sv_SE.UTF-8 sv_FI.ISO8859-1 +SAME+= tr_TR.UTF-8 tr_TR.ISO8859-9 +SAME+= uk_UA.UTF-8 uk_UA.KOI8-U +SAME+= uk_UA.UTF-8 uk_UA.ISO8859-5 +SAME+= uk_UA.UTF-8 uk_UA.CP1251 +SAME+= zh_Hans_CN.UTF-8 zh_Hans_CN.GBK +SAME+= zh_Hans_CN.UTF-8 zh_Hans_CN.GB2312 +SAME+= zh_Hans_CN.UTF-8 zh_Hans_CN.GB18030 +SAME+= zh_Hans_CN.UTF-8 zh_Hans_CN.eucCN +SAME+= zh_Hant_TW.UTF-8 zh_Hant_TW.Big5 +SAME+= zh_Hant_TW.UTF-8 zh_Hant_HK.UTF-8 +SAME+= zh_Hant_TW.UTF-8 zh_Hant_HK.Big5HKSCS +SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_COLLATE/} CLEANFILES= ${FILES} -.for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ - ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} +.for f t in ${SAME} +SYMLINKS+= ../$f/${FILESNAME} \ + ${LOCALEDIR}/$t/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/ctypedef/Makefile ============================================================================== --- head/share/ctypedef/Makefile Fri Dec 18 21:18:07 2015 (r292452) +++ head/share/ctypedef/Makefile Fri Dec 18 21:34:28 2015 (r292453) @@ -42,202 +42,202 @@ LOCALES+= zh_Hans_CN.eucCN LOCALES+= zh_Hant_HK.Big5HKSCS LOCALES+= zh_Hant_TW.Big5 -SAME+= en_US.UTF-8:ru_RU.UTF-8 -SAME+= en_US.UTF-8:zh_Hant_TW.UTF-8 -SAME+= en_US.UTF-8:zh_Hant_HK.UTF-8 -SAME+= en_US.UTF-8:zh_Hans_CN.UTF-8 -SAME+= en_US.UTF-8:uk_UA.UTF-8 -SAME+= en_US.UTF-8:tr_TR.UTF-8 -SAME+= en_US.UTF-8:sv_SE.UTF-8 -SAME+= en_US.UTF-8:sv_FI.UTF-8 -SAME+= en_US.UTF-8:sr_Latn_RS.UTF-8 -SAME+= en_US.UTF-8:sr_Cyrl_RS.UTF-8 -SAME+= en_US.UTF-8:sl_SI.UTF-8 -SAME+= en_US.UTF-8:sk_SK.UTF-8 -SAME+= en_US.UTF-8:se_NO.UTF-8 -SAME+= en_US.UTF-8:se_FI.UTF-8 -SAME+= en_US.UTF-8:ro_RO.UTF-8 -SAME+= en_US.UTF-8:pt_PT.UTF-8 -SAME+= en_US.UTF-8:pt_BR.UTF-8 -SAME+= en_US.UTF-8:pl_PL.UTF-8 -SAME+= en_US.UTF-8:nn_NO.UTF-8 -SAME+= en_US.UTF-8:nl_NL.UTF-8 -SAME+= en_US.UTF-8:nl_BE.UTF-8 -SAME+= en_US.UTF-8:nb_NO.UTF-8 -SAME+= en_US.UTF-8:mn_Cyrl_MN.UTF-8 -SAME+= en_US.UTF-8:lv_LV.UTF-8 -SAME+= en_US.UTF-8:lt_LT.UTF-8 -SAME+= en_US.UTF-8:ko_KR.UTF-8 -SAME+= en_US.UTF-8:kk_Cyrl_KZ.UTF-8 -SAME+= en_US.UTF-8:ja_JP.UTF-8 -SAME+= en_US.UTF-8:it_IT.UTF-8 -SAME+= en_US.UTF-8:it_CH.UTF-8 -SAME+= en_US.UTF-8:is_IS.UTF-8 -SAME+= en_US.UTF-8:hy_AM.UTF-8 -SAME+= en_US.UTF-8:hu_HU.UTF-8 -SAME+= en_US.UTF-8:hr_HR.UTF-8 -SAME+= en_US.UTF-8:hi_IN.UTF-8 -SAME+= en_US.UTF-8:he_IL.UTF-8 -SAME+= en_US.UTF-8:fr_FR.UTF-8 -SAME+= en_US.UTF-8:fr_CH.UTF-8 -SAME+= en_US.UTF-8:fr_CA.UTF-8 -SAME+= en_US.UTF-8:fr_BE.UTF-8 -SAME+= en_US.UTF-8:fi_FI.UTF-8 -SAME+= en_US.UTF-8:eu_ES.UTF-8 -SAME+= en_US.UTF-8:et_EE.UTF-8 -SAME+= en_US.UTF-8:es_MX.UTF-8 -SAME+= en_US.UTF-8:es_ES.UTF-8 -SAME+= en_US.UTF-8:es_CR.UTF-8 -SAME+= en_US.UTF-8:es_AR.UTF-8 -SAME+= en_US.UTF-8:en_ZA.UTF-8 -SAME+= en_US.UTF-8:en_SG.UTF-8 -SAME+= en_US.UTF-8:en_PH.UTF-8 -SAME+= en_US.UTF-8:en_NZ.UTF-8 -SAME+= en_US.UTF-8:en_IE.UTF-8 -SAME+= en_US.UTF-8:en_HK.UTF-8 -SAME+= en_US.UTF-8:en_GB.UTF-8 -SAME+= en_US.UTF-8:en_CA.UTF-8 -SAME+= en_US.UTF-8:en_AU.UTF-8 -SAME+= en_US.UTF-8:el_GR.UTF-8 -SAME+= en_US.UTF-8:de_DE.UTF-8 -SAME+= en_US.UTF-8:de_CH.UTF-8 -SAME+= en_US.UTF-8:de_AT.UTF-8 -SAME+= en_US.UTF-8:da_DK.UTF-8 -SAME+= en_US.UTF-8:cs_CZ.UTF-8 -SAME+= en_US.UTF-8:ca_IT.UTF-8 -SAME+= en_US.UTF-8:ca_FR.UTF-8 -SAME+= en_US.UTF-8:ca_ES.UTF-8 -SAME+= en_US.UTF-8:ca_AD.UTF-8 -SAME+= en_US.UTF-8:bg_BG.UTF-8 -SAME+= en_US.UTF-8:be_BY.UTF-8 -SAME+= en_US.UTF-8:ar_SA.UTF-8 -SAME+= en_US.UTF-8:ar_QA.UTF-8 -SAME+= en_US.UTF-8:ar_MA.UTF-8 -SAME+= en_US.UTF-8:ar_JO.UTF-8 -SAME+= en_US.UTF-8:ar_EG.UTF-8 -SAME+= en_US.UTF-8:ar_AE.UTF-8 -SAME+= en_US.UTF-8:am_ET.UTF-8 -SAME+= en_US.UTF-8:af_ZA.UTF-8 -SAME+= en_US.ISO8859-1:sv_SE.ISO8859-1 -SAME+= en_US.ISO8859-1:sv_FI.ISO8859-1 -SAME+= en_US.ISO8859-1:pt_PT.ISO8859-1 -SAME+= en_US.ISO8859-1:pt_BR.ISO8859-1 -SAME+= en_US.ISO8859-1:nn_NO.ISO8859-1 -SAME+= en_US.ISO8859-1:nl_NL.ISO8859-1 -SAME+= en_US.ISO8859-1:nl_BE.ISO8859-1 -SAME+= en_US.ISO8859-1:nb_NO.ISO8859-1 -SAME+= en_US.ISO8859-1:it_IT.ISO8859-1 -SAME+= en_US.ISO8859-1:it_CH.ISO8859-1 -SAME+= en_US.ISO8859-1:is_IS.ISO8859-1 -SAME+= en_US.ISO8859-1:fr_FR.ISO8859-1 -SAME+= en_US.ISO8859-1:fr_CH.ISO8859-1 -SAME+= en_US.ISO8859-1:fr_CA.ISO8859-1 -SAME+= en_US.ISO8859-1:fr_BE.ISO8859-1 -SAME+= en_US.ISO8859-1:fi_FI.ISO8859-1 -SAME+= en_US.ISO8859-1:eu_ES.ISO8859-1 -SAME+= en_US.ISO8859-1:et_EE.ISO8859-1 -SAME+= en_US.ISO8859-1:es_MX.ISO8859-1 -SAME+= en_US.ISO8859-1:es_ES.ISO8859-1 -SAME+= en_US.ISO8859-1:es_AR.ISO8859-1 -SAME+= en_US.ISO8859-1:en_ZA.ISO8859-1 -SAME+= en_US.ISO8859-1:en_SG.ISO8859-1 -SAME+= en_US.ISO8859-1:en_NZ.ISO8859-1 -SAME+= en_US.ISO8859-1:en_IE.ISO8859-1 -SAME+= en_US.ISO8859-1:en_HK.ISO8859-1 -SAME+= en_US.ISO8859-1:en_GB.ISO8859-1 -SAME+= en_US.ISO8859-1:en_CA.ISO8859-1 -SAME+= en_US.ISO8859-1:en_AU.ISO8859-1 -SAME+= en_US.ISO8859-1:de_DE.ISO8859-1 -SAME+= en_US.ISO8859-1:de_CH.ISO8859-1 -SAME+= en_US.ISO8859-1:de_AT.ISO8859-1 -SAME+= en_US.ISO8859-1:da_DK.ISO8859-1 -SAME+= en_US.ISO8859-1:af_ZA.ISO8859-1 -SAME+= en_US.ISO8859-15:en_GB.ISO8859-15 -SAME+= en_US.ISO8859-15:sv_SE.ISO8859-15 -SAME+= en_US.ISO8859-15:sv_FI.ISO8859-15 -SAME+= en_US.ISO8859-15:pt_PT.ISO8859-15 -SAME+= en_US.ISO8859-15:nn_NO.ISO8859-15 -SAME+= en_US.ISO8859-15:nl_NL.ISO8859-15 -SAME+= en_US.ISO8859-15:nl_BE.ISO8859-15 -SAME+= en_US.ISO8859-15:nb_NO.ISO8859-15 -SAME+= en_US.ISO8859-15:it_IT.ISO8859-15 -SAME+= en_US.ISO8859-15:it_CH.ISO8859-15 -SAME+= en_US.ISO8859-15:is_IS.ISO8859-15 -SAME+= en_US.ISO8859-15:fr_FR.ISO8859-15 -SAME+= en_US.ISO8859-15:fr_CH.ISO8859-15 -SAME+= en_US.ISO8859-15:fr_CA.ISO8859-15 -SAME+= en_US.ISO8859-15:fr_BE.ISO8859-15 -SAME+= en_US.ISO8859-15:fi_FI.ISO8859-15 -SAME+= en_US.ISO8859-15:eu_ES.ISO8859-15 -SAME+= en_US.ISO8859-15:et_EE.ISO8859-15 -SAME+= en_US.ISO8859-15:es_ES.ISO8859-15 -SAME+= en_US.ISO8859-15:en_ZA.ISO8859-15 -SAME+= en_US.ISO8859-15:en_NZ.ISO8859-15 -SAME+= en_US.ISO8859-15:en_IE.ISO8859-15 -SAME+= en_US.ISO8859-15:en_CA.ISO8859-15 -SAME+= en_US.ISO8859-15:en_AU.ISO8859-15 -SAME+= en_US.ISO8859-15:de_DE.ISO8859-15 -SAME+= en_US.ISO8859-15:de_CH.ISO8859-15 -SAME+= en_US.ISO8859-15:de_AT.ISO8859-15 -SAME+= en_US.ISO8859-15:da_DK.ISO8859-15 -SAME+= en_US.ISO8859-15:af_ZA.ISO8859-15 -SAME+= ru_RU.CP1251:bg_BG.CP1251 -SAME+= ru_RU.CP1251:be_BY.CP1251 -SAME+= ru_RU.ISO8859-5:sr_Cyrl_RS.ISO8859-5 -SAME+= ru_RU.ISO8859-5:be_BY.ISO8859-5 -SAME+= ca_IT.ISO8859-1:ca_FR.ISO8859-1 -SAME+= ca_IT.ISO8859-1:ca_ES.ISO8859-1 -SAME+= ca_IT.ISO8859-1:ca_AD.ISO8859-1 -SAME+= ca_IT.ISO8859-15:ca_FR.ISO8859-15 -SAME+= ca_IT.ISO8859-15:ca_ES.ISO8859-15 -SAME+= ca_IT.ISO8859-15:ca_AD.ISO8859-15 -SAME+= sr_Latn_RS.ISO8859-2:sl_SI.ISO8859-2 -SAME+= sr_Latn_RS.ISO8859-2:sk_SK.ISO8859-2 -SAME+= sr_Latn_RS.ISO8859-2:ro_RO.ISO8859-2 -SAME+= sr_Latn_RS.ISO8859-2:pl_PL.ISO8859-2 -SAME+= sr_Latn_RS.ISO8859-2:hu_HU.ISO8859-2 -SAME+= sr_Latn_RS.ISO8859-2:hr_HR.ISO8859-2 -SAME+= sr_Latn_RS.ISO8859-2:cs_CZ.ISO8859-2 -SAME+= en_US.US-ASCII:en_ZA.US-ASCII -SAME+= en_US.US-ASCII:en_NZ.US-ASCII -SAME+= en_US.US-ASCII:en_GB.US-ASCII -SAME+= en_US.US-ASCII:en_CA.US-ASCII -SAME+= en_US.US-ASCII:en_AU.US-ASCII -SAME+= lv_LV.ISO8859-13:lt_LT.ISO8859-13 -SAME+= ko_KR.eucKR:ko_KR.CP949 # legacy (same charset) +SAME+= en_US.UTF-8 ru_RU.UTF-8 +SAME+= en_US.UTF-8 zh_Hant_TW.UTF-8 +SAME+= en_US.UTF-8 zh_Hant_HK.UTF-8 +SAME+= en_US.UTF-8 zh_Hans_CN.UTF-8 +SAME+= en_US.UTF-8 uk_UA.UTF-8 +SAME+= en_US.UTF-8 tr_TR.UTF-8 +SAME+= en_US.UTF-8 sv_SE.UTF-8 +SAME+= en_US.UTF-8 sv_FI.UTF-8 +SAME+= en_US.UTF-8 sr_Latn_RS.UTF-8 +SAME+= en_US.UTF-8 sr_Cyrl_RS.UTF-8 +SAME+= en_US.UTF-8 sl_SI.UTF-8 +SAME+= en_US.UTF-8 sk_SK.UTF-8 +SAME+= en_US.UTF-8 se_NO.UTF-8 +SAME+= en_US.UTF-8 se_FI.UTF-8 +SAME+= en_US.UTF-8 ro_RO.UTF-8 +SAME+= en_US.UTF-8 pt_PT.UTF-8 +SAME+= en_US.UTF-8 pt_BR.UTF-8 +SAME+= en_US.UTF-8 pl_PL.UTF-8 +SAME+= en_US.UTF-8 nn_NO.UTF-8 +SAME+= en_US.UTF-8 nl_NL.UTF-8 +SAME+= en_US.UTF-8 nl_BE.UTF-8 +SAME+= en_US.UTF-8 nb_NO.UTF-8 +SAME+= en_US.UTF-8 mn_Cyrl_MN.UTF-8 +SAME+= en_US.UTF-8 lv_LV.UTF-8 +SAME+= en_US.UTF-8 lt_LT.UTF-8 +SAME+= en_US.UTF-8 ko_KR.UTF-8 +SAME+= en_US.UTF-8 kk_Cyrl_KZ.UTF-8 +SAME+= en_US.UTF-8 ja_JP.UTF-8 +SAME+= en_US.UTF-8 it_IT.UTF-8 +SAME+= en_US.UTF-8 it_CH.UTF-8 +SAME+= en_US.UTF-8 is_IS.UTF-8 +SAME+= en_US.UTF-8 hy_AM.UTF-8 +SAME+= en_US.UTF-8 hu_HU.UTF-8 +SAME+= en_US.UTF-8 hr_HR.UTF-8 +SAME+= en_US.UTF-8 hi_IN.UTF-8 +SAME+= en_US.UTF-8 he_IL.UTF-8 +SAME+= en_US.UTF-8 fr_FR.UTF-8 +SAME+= en_US.UTF-8 fr_CH.UTF-8 +SAME+= en_US.UTF-8 fr_CA.UTF-8 +SAME+= en_US.UTF-8 fr_BE.UTF-8 +SAME+= en_US.UTF-8 fi_FI.UTF-8 +SAME+= en_US.UTF-8 eu_ES.UTF-8 +SAME+= en_US.UTF-8 et_EE.UTF-8 +SAME+= en_US.UTF-8 es_MX.UTF-8 +SAME+= en_US.UTF-8 es_ES.UTF-8 +SAME+= en_US.UTF-8 es_CR.UTF-8 +SAME+= en_US.UTF-8 es_AR.UTF-8 +SAME+= en_US.UTF-8 en_ZA.UTF-8 +SAME+= en_US.UTF-8 en_SG.UTF-8 +SAME+= en_US.UTF-8 en_PH.UTF-8 +SAME+= en_US.UTF-8 en_NZ.UTF-8 +SAME+= en_US.UTF-8 en_IE.UTF-8 +SAME+= en_US.UTF-8 en_HK.UTF-8 +SAME+= en_US.UTF-8 en_GB.UTF-8 +SAME+= en_US.UTF-8 en_CA.UTF-8 +SAME+= en_US.UTF-8 en_AU.UTF-8 +SAME+= en_US.UTF-8 el_GR.UTF-8 +SAME+= en_US.UTF-8 de_DE.UTF-8 +SAME+= en_US.UTF-8 de_CH.UTF-8 +SAME+= en_US.UTF-8 de_AT.UTF-8 +SAME+= en_US.UTF-8 da_DK.UTF-8 +SAME+= en_US.UTF-8 cs_CZ.UTF-8 +SAME+= en_US.UTF-8 ca_IT.UTF-8 +SAME+= en_US.UTF-8 ca_FR.UTF-8 +SAME+= en_US.UTF-8 ca_ES.UTF-8 +SAME+= en_US.UTF-8 ca_AD.UTF-8 +SAME+= en_US.UTF-8 bg_BG.UTF-8 +SAME+= en_US.UTF-8 be_BY.UTF-8 +SAME+= en_US.UTF-8 ar_SA.UTF-8 +SAME+= en_US.UTF-8 ar_QA.UTF-8 +SAME+= en_US.UTF-8 ar_MA.UTF-8 +SAME+= en_US.UTF-8 ar_JO.UTF-8 +SAME+= en_US.UTF-8 ar_EG.UTF-8 +SAME+= en_US.UTF-8 ar_AE.UTF-8 +SAME+= en_US.UTF-8 am_ET.UTF-8 +SAME+= en_US.UTF-8 af_ZA.UTF-8 +SAME+= en_US.ISO8859-1 sv_SE.ISO8859-1 +SAME+= en_US.ISO8859-1 sv_FI.ISO8859-1 +SAME+= en_US.ISO8859-1 pt_PT.ISO8859-1 +SAME+= en_US.ISO8859-1 pt_BR.ISO8859-1 +SAME+= en_US.ISO8859-1 nn_NO.ISO8859-1 +SAME+= en_US.ISO8859-1 nl_NL.ISO8859-1 +SAME+= en_US.ISO8859-1 nl_BE.ISO8859-1 +SAME+= en_US.ISO8859-1 nb_NO.ISO8859-1 +SAME+= en_US.ISO8859-1 it_IT.ISO8859-1 +SAME+= en_US.ISO8859-1 it_CH.ISO8859-1 +SAME+= en_US.ISO8859-1 is_IS.ISO8859-1 +SAME+= en_US.ISO8859-1 fr_FR.ISO8859-1 +SAME+= en_US.ISO8859-1 fr_CH.ISO8859-1 +SAME+= en_US.ISO8859-1 fr_CA.ISO8859-1 +SAME+= en_US.ISO8859-1 fr_BE.ISO8859-1 +SAME+= en_US.ISO8859-1 fi_FI.ISO8859-1 +SAME+= en_US.ISO8859-1 eu_ES.ISO8859-1 +SAME+= en_US.ISO8859-1 et_EE.ISO8859-1 +SAME+= en_US.ISO8859-1 es_MX.ISO8859-1 +SAME+= en_US.ISO8859-1 es_ES.ISO8859-1 +SAME+= en_US.ISO8859-1 es_AR.ISO8859-1 +SAME+= en_US.ISO8859-1 en_ZA.ISO8859-1 +SAME+= en_US.ISO8859-1 en_SG.ISO8859-1 +SAME+= en_US.ISO8859-1 en_NZ.ISO8859-1 +SAME+= en_US.ISO8859-1 en_IE.ISO8859-1 +SAME+= en_US.ISO8859-1 en_HK.ISO8859-1 +SAME+= en_US.ISO8859-1 en_GB.ISO8859-1 +SAME+= en_US.ISO8859-1 en_CA.ISO8859-1 +SAME+= en_US.ISO8859-1 en_AU.ISO8859-1 +SAME+= en_US.ISO8859-1 de_DE.ISO8859-1 +SAME+= en_US.ISO8859-1 de_CH.ISO8859-1 +SAME+= en_US.ISO8859-1 de_AT.ISO8859-1 +SAME+= en_US.ISO8859-1 da_DK.ISO8859-1 +SAME+= en_US.ISO8859-1 af_ZA.ISO8859-1 +SAME+= en_US.ISO8859-15 en_GB.ISO8859-15 +SAME+= en_US.ISO8859-15 sv_SE.ISO8859-15 +SAME+= en_US.ISO8859-15 sv_FI.ISO8859-15 +SAME+= en_US.ISO8859-15 pt_PT.ISO8859-15 +SAME+= en_US.ISO8859-15 nn_NO.ISO8859-15 +SAME+= en_US.ISO8859-15 nl_NL.ISO8859-15 +SAME+= en_US.ISO8859-15 nl_BE.ISO8859-15 +SAME+= en_US.ISO8859-15 nb_NO.ISO8859-15 +SAME+= en_US.ISO8859-15 it_IT.ISO8859-15 +SAME+= en_US.ISO8859-15 it_CH.ISO8859-15 +SAME+= en_US.ISO8859-15 is_IS.ISO8859-15 +SAME+= en_US.ISO8859-15 fr_FR.ISO8859-15 +SAME+= en_US.ISO8859-15 fr_CH.ISO8859-15 +SAME+= en_US.ISO8859-15 fr_CA.ISO8859-15 +SAME+= en_US.ISO8859-15 fr_BE.ISO8859-15 +SAME+= en_US.ISO8859-15 fi_FI.ISO8859-15 +SAME+= en_US.ISO8859-15 eu_ES.ISO8859-15 +SAME+= en_US.ISO8859-15 et_EE.ISO8859-15 +SAME+= en_US.ISO8859-15 es_ES.ISO8859-15 +SAME+= en_US.ISO8859-15 en_ZA.ISO8859-15 +SAME+= en_US.ISO8859-15 en_NZ.ISO8859-15 +SAME+= en_US.ISO8859-15 en_IE.ISO8859-15 +SAME+= en_US.ISO8859-15 en_CA.ISO8859-15 +SAME+= en_US.ISO8859-15 en_AU.ISO8859-15 +SAME+= en_US.ISO8859-15 de_DE.ISO8859-15 +SAME+= en_US.ISO8859-15 de_CH.ISO8859-15 +SAME+= en_US.ISO8859-15 de_AT.ISO8859-15 +SAME+= en_US.ISO8859-15 da_DK.ISO8859-15 +SAME+= en_US.ISO8859-15 af_ZA.ISO8859-15 +SAME+= ru_RU.CP1251 bg_BG.CP1251 +SAME+= ru_RU.CP1251 be_BY.CP1251 +SAME+= ru_RU.ISO8859-5 sr_Cyrl_RS.ISO8859-5 +SAME+= ru_RU.ISO8859-5 be_BY.ISO8859-5 +SAME+= ca_IT.ISO8859-1 ca_FR.ISO8859-1 +SAME+= ca_IT.ISO8859-1 ca_ES.ISO8859-1 +SAME+= ca_IT.ISO8859-1 ca_AD.ISO8859-1 +SAME+= ca_IT.ISO8859-15 ca_FR.ISO8859-15 +SAME+= ca_IT.ISO8859-15 ca_ES.ISO8859-15 +SAME+= ca_IT.ISO8859-15 ca_AD.ISO8859-15 +SAME+= sr_Latn_RS.ISO8859-2 sl_SI.ISO8859-2 +SAME+= sr_Latn_RS.ISO8859-2 sk_SK.ISO8859-2 +SAME+= sr_Latn_RS.ISO8859-2 ro_RO.ISO8859-2 +SAME+= sr_Latn_RS.ISO8859-2 pl_PL.ISO8859-2 +SAME+= sr_Latn_RS.ISO8859-2 hu_HU.ISO8859-2 +SAME+= sr_Latn_RS.ISO8859-2 hr_HR.ISO8859-2 +SAME+= sr_Latn_RS.ISO8859-2 cs_CZ.ISO8859-2 +SAME+= en_US.US-ASCII en_ZA.US-ASCII +SAME+= en_US.US-ASCII en_NZ.US-ASCII +SAME+= en_US.US-ASCII en_GB.US-ASCII +SAME+= en_US.US-ASCII en_CA.US-ASCII +SAME+= en_US.US-ASCII en_AU.US-ASCII +SAME+= lv_LV.ISO8859-13 lt_LT.ISO8859-13 +SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_CTYPE/} CLEANFILES= ${FILES} -.for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ - ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} +.for f t in ${SAME} +SYMLINKS+= ../$f/${FILESNAME} \ + ${LOCALEDIR}/$t/${FILESNAME} .endfor .for f in ${LOCALES} FILESDIR_${f}.LC_CTYPE= ${LOCALEDIR}/${f} .endfor -SYMPAIRS+= ca_IT.ISO8859-1.src:ca_IT.ISO8859-15.src -SYMPAIRS+= be_BY.CP1131.src:ru_RU.CP1251.src -SYMPAIRS+= be_BY.CP1131.src:ru_RU.CP866.src -SYMPAIRS+= be_BY.CP1131.src:ru_RU.ISO8859-5.src -SYMPAIRS+= be_BY.CP1131.src:ru_RU.KOI8-R.src -SYMPAIRS+= uk_UA.CP1251.src:uk_UA.ISO8859-5.src -SYMPAIRS+= uk_UA.CP1251.src:uk_UA.KOI8-U.src -SYMPAIRS+= zh_Hans_CN.eucCN.src:zh_Hans_CN.GB18030.src -SYMPAIRS+= zh_Hans_CN.eucCN.src:zh_Hans_CN.GB2312.src -SYMPAIRS+= zh_Hans_CN.eucCN.src:zh_Hans_CN.GBK.src -SYMPAIRS+= zh_Hant_HK.Big5HKSCS.src:zh_Hant_TW.Big5.src -SYMPAIRS+= en_US.ISO8859-1.src:en_US.ISO8859-15.src -SYMPAIRS+= en_US.ISO8859-1.src:en_US.US-ASCII.src -SYMPAIRS+= en_US.ISO8859-1.src:lv_LV.ISO8859-13.src -SYMPAIRS+= en_US.ISO8859-1.src:sr_Latn_RS.ISO8859-2.src -SYMPAIRS+= en_US.ISO8859-1.src:tr_TR.ISO8859-9.src -SYMPAIRS+= ja_JP.eucJP.src:ja_JP.SJIS.src +SYMPAIRS+= ca_IT.ISO8859-1.src ca_IT.ISO8859-15.src +SYMPAIRS+= be_BY.CP1131.src ru_RU.CP1251.src +SYMPAIRS+= be_BY.CP1131.src ru_RU.CP866.src +SYMPAIRS+= be_BY.CP1131.src ru_RU.ISO8859-5.src +SYMPAIRS+= be_BY.CP1131.src ru_RU.KOI8-R.src +SYMPAIRS+= uk_UA.CP1251.src uk_UA.ISO8859-5.src +SYMPAIRS+= uk_UA.CP1251.src uk_UA.KOI8-U.src +SYMPAIRS+= zh_Hans_CN.eucCN.src zh_Hans_CN.GB18030.src +SYMPAIRS+= zh_Hans_CN.eucCN.src zh_Hans_CN.GB2312.src +SYMPAIRS+= zh_Hans_CN.eucCN.src zh_Hans_CN.GBK.src +SYMPAIRS+= zh_Hant_HK.Big5HKSCS.src zh_Hant_TW.Big5.src +SYMPAIRS+= en_US.ISO8859-1.src en_US.ISO8859-15.src +SYMPAIRS+= en_US.ISO8859-1.src en_US.US-ASCII.src +SYMPAIRS+= en_US.ISO8859-1.src lv_LV.ISO8859-13.src +SYMPAIRS+= en_US.ISO8859-1.src sr_Latn_RS.ISO8859-2.src +SYMPAIRS+= en_US.ISO8859-1.src tr_TR.ISO8859-9.src +SYMPAIRS+= ja_JP.eucJP.src ja_JP.SJIS.src -.for PAIR in ${SYMPAIRS} -${PAIR:C/^.*://:S/src$/LC_CTYPE/}: ${PAIR:C/:.*//} +.for s t in ${SYMPAIRS} +${t:S/src$/LC_CTYPE/}: $s localedef -D -U -c -w ${MAPLOC}/widths.txt \ -f ${MAPLOC}/map.${.TARGET:T:R:C/^.*\.//} \ -i ${.ALLSRC} ${.OBJDIR}/${.TARGET:T:R} || true Modified: head/share/monetdef/Makefile ============================================================================== --- head/share/monetdef/Makefile Fri Dec 18 21:18:07 2015 (r292452) +++ head/share/monetdef/Makefile Fri Dec 18 21:34:28 2015 (r292453) @@ -109,106 +109,106 @@ LOCALES+= zh_Hant_HK.UTF-8 LOCALES+= zh_Hant_TW.Big5 LOCALES+= zh_Hant_TW.UTF-8 -SAME+= en_ZA.ISO8859-15:en_ZA.ISO8859-1 -SAME+= en_ZA.ISO8859-15:af_ZA.ISO8859-15 -SAME+= en_ZA.ISO8859-15:af_ZA.ISO8859-1 -SAME+= en_ZA.UTF-8:af_ZA.UTF-8 -SAME+= sl_SI.ISO8859-2:nl_BE.ISO8859-1 -SAME+= sl_SI.ISO8859-2:it_IT.ISO8859-1 -SAME+= sl_SI.ISO8859-2:fr_BE.ISO8859-1 -SAME+= sl_SI.ISO8859-2:eu_ES.ISO8859-1 -SAME+= sl_SI.ISO8859-2:es_ES.ISO8859-1 -SAME+= sl_SI.ISO8859-2:de_DE.ISO8859-1 -SAME+= sl_SI.ISO8859-2:ca_IT.ISO8859-1 -SAME+= sl_SI.ISO8859-2:ca_FR.ISO8859-1 -SAME+= sl_SI.ISO8859-2:ca_ES.ISO8859-1 -SAME+= sl_SI.ISO8859-2:ca_AD.ISO8859-1 -SAME+= nl_BE.ISO8859-15:it_IT.ISO8859-15 -SAME+= nl_BE.ISO8859-15:fr_BE.ISO8859-15 -SAME+= nl_BE.ISO8859-15:eu_ES.ISO8859-15 -SAME+= nl_BE.ISO8859-15:es_ES.ISO8859-15 -SAME+= nl_BE.ISO8859-15:el_GR.ISO8859-7 -SAME+= nl_BE.ISO8859-15:de_DE.ISO8859-15 -SAME+= nl_BE.ISO8859-15:ca_IT.ISO8859-15 -SAME+= nl_BE.ISO8859-15:ca_FR.ISO8859-15 -SAME+= nl_BE.ISO8859-15:ca_ES.ISO8859-15 -SAME+= nl_BE.ISO8859-15:ca_AD.ISO8859-15 -SAME+= sl_SI.UTF-8:nl_BE.UTF-8 -SAME+= sl_SI.UTF-8:it_IT.UTF-8 -SAME+= sl_SI.UTF-8:fr_BE.UTF-8 -SAME+= sl_SI.UTF-8:eu_ES.UTF-8 -SAME+= sl_SI.UTF-8:es_ES.UTF-8 -SAME+= sl_SI.UTF-8:el_GR.UTF-8 -SAME+= sl_SI.UTF-8:de_DE.UTF-8 -SAME+= sl_SI.UTF-8:ca_IT.UTF-8 -SAME+= sl_SI.UTF-8:ca_FR.UTF-8 -SAME+= sl_SI.UTF-8:ca_ES.UTF-8 -SAME+= sl_SI.UTF-8:ca_AD.UTF-8 -SAME+= da_DK.UTF-8:da_DK.ISO8859-15 -SAME+= da_DK.UTF-8:da_DK.ISO8859-1 -SAME+= it_CH.UTF-8:it_CH.ISO8859-15 -SAME+= it_CH.UTF-8:it_CH.ISO8859-1 -SAME+= it_CH.UTF-8:de_CH.UTF-8 -SAME+= it_CH.UTF-8:de_CH.ISO8859-15 -SAME+= it_CH.UTF-8:de_CH.ISO8859-1 -SAME+= en_AU.UTF-8:en_AU.US-ASCII -SAME+= en_AU.UTF-8:en_AU.ISO8859-15 -SAME+= en_AU.UTF-8:en_AU.ISO8859-1 -SAME+= en_CA.UTF-8:en_CA.US-ASCII -SAME+= en_CA.UTF-8:en_CA.ISO8859-15 -SAME+= en_CA.UTF-8:en_CA.ISO8859-1 -SAME+= en_GB.ISO8859-15:en_GB.ISO8859-1 -SAME+= zh_Hant_HK.UTF-8:zh_Hant_HK.Big5HKSCS -SAME+= zh_Hant_HK.UTF-8:en_HK.UTF-8 -SAME+= zh_Hant_HK.UTF-8:en_HK.ISO8859-1 -SAME+= en_NZ.UTF-8:en_NZ.US-ASCII -SAME+= en_NZ.UTF-8:en_NZ.ISO8859-15 -SAME+= en_NZ.UTF-8:en_NZ.ISO8859-1 -SAME+= en_SG.UTF-8:en_SG.ISO8859-1 -SAME+= en_US.UTF-8:en_US.US-ASCII -SAME+= en_US.UTF-8:en_US.ISO8859-15 -SAME+= en_US.UTF-8:en_US.ISO8859-1 -SAME+= es_AR.UTF-8:es_AR.ISO8859-1 -SAME+= es_MX.UTF-8:es_MX.ISO8859-1 -SAME+= sv_FI.ISO8859-1:sk_SK.ISO8859-2 -SAME+= sv_FI.ISO8859-1:pt_PT.ISO8859-1 -SAME+= sv_FI.ISO8859-1:lt_LT.ISO8859-13 -SAME+= sv_FI.ISO8859-1:fr_FR.ISO8859-1 -SAME+= sv_FI.ISO8859-1:fi_FI.ISO8859-1 -SAME+= sv_FI.ISO8859-1:et_EE.ISO8859-1 -SAME+= sv_FI.ISO8859-15:pt_PT.ISO8859-15 -SAME+= sv_FI.ISO8859-15:fr_FR.ISO8859-15 -SAME+= sv_FI.ISO8859-15:fi_FI.ISO8859-15 -SAME+= sv_FI.ISO8859-15:et_EE.ISO8859-15 -SAME+= sk_SK.UTF-8:pt_PT.UTF-8 -SAME+= sk_SK.UTF-8:fr_FR.UTF-8 -SAME+= sk_SK.UTF-8:et_EE.UTF-8 -SAME+= sv_FI.UTF-8:se_FI.UTF-8 -SAME+= sv_FI.UTF-8:lt_LT.UTF-8 -SAME+= sv_FI.UTF-8:fi_FI.UTF-8 -SAME+= fr_CA.ISO8859-15:fr_CA.ISO8859-1 -SAME+= fr_CH.ISO8859-15:fr_CH.ISO8859-1 -SAME+= hr_HR.UTF-8:hr_HR.ISO8859-2 -SAME+= is_IS.UTF-8:is_IS.ISO8859-15 -SAME+= is_IS.UTF-8:is_IS.ISO8859-1 -SAME+= nb_NO.ISO8859-15:nb_NO.ISO8859-1 -SAME+= nn_NO.ISO8859-15:nn_NO.ISO8859-1 -SAME+= se_NO.UTF-8:nn_NO.UTF-8 -SAME+= pt_BR.UTF-8:pt_BR.ISO8859-1 -SAME+= ro_RO.UTF-8:ro_RO.ISO8859-2 -SAME+= sr_Latn_RS.UTF-8:sr_Latn_RS.ISO8859-2 -SAME+= sr_Latn_RS.UTF-8:sr_Cyrl_RS.UTF-8 -SAME+= sr_Latn_RS.UTF-8:sr_Cyrl_RS.ISO8859-5 -SAME+= sv_SE.ISO8859-15:sv_SE.ISO8859-1 -SAME+= zh_Hans_CN.GBK:zh_Hans_CN.GB18030 -SAME+= ko_KR.eucKR:ko_KR.CP949 # legacy (same charset) +SAME+= en_ZA.ISO8859-15 en_ZA.ISO8859-1 +SAME+= en_ZA.ISO8859-15 af_ZA.ISO8859-15 +SAME+= en_ZA.ISO8859-15 af_ZA.ISO8859-1 +SAME+= en_ZA.UTF-8 af_ZA.UTF-8 +SAME+= sl_SI.ISO8859-2 nl_BE.ISO8859-1 +SAME+= sl_SI.ISO8859-2 it_IT.ISO8859-1 +SAME+= sl_SI.ISO8859-2 fr_BE.ISO8859-1 +SAME+= sl_SI.ISO8859-2 eu_ES.ISO8859-1 +SAME+= sl_SI.ISO8859-2 es_ES.ISO8859-1 +SAME+= sl_SI.ISO8859-2 de_DE.ISO8859-1 +SAME+= sl_SI.ISO8859-2 ca_IT.ISO8859-1 +SAME+= sl_SI.ISO8859-2 ca_FR.ISO8859-1 +SAME+= sl_SI.ISO8859-2 ca_ES.ISO8859-1 +SAME+= sl_SI.ISO8859-2 ca_AD.ISO8859-1 +SAME+= nl_BE.ISO8859-15 it_IT.ISO8859-15 +SAME+= nl_BE.ISO8859-15 fr_BE.ISO8859-15 +SAME+= nl_BE.ISO8859-15 eu_ES.ISO8859-15 +SAME+= nl_BE.ISO8859-15 es_ES.ISO8859-15 +SAME+= nl_BE.ISO8859-15 el_GR.ISO8859-7 +SAME+= nl_BE.ISO8859-15 de_DE.ISO8859-15 +SAME+= nl_BE.ISO8859-15 ca_IT.ISO8859-15 +SAME+= nl_BE.ISO8859-15 ca_FR.ISO8859-15 +SAME+= nl_BE.ISO8859-15 ca_ES.ISO8859-15 +SAME+= nl_BE.ISO8859-15 ca_AD.ISO8859-15 +SAME+= sl_SI.UTF-8 nl_BE.UTF-8 +SAME+= sl_SI.UTF-8 it_IT.UTF-8 +SAME+= sl_SI.UTF-8 fr_BE.UTF-8 +SAME+= sl_SI.UTF-8 eu_ES.UTF-8 +SAME+= sl_SI.UTF-8 es_ES.UTF-8 +SAME+= sl_SI.UTF-8 el_GR.UTF-8 +SAME+= sl_SI.UTF-8 de_DE.UTF-8 +SAME+= sl_SI.UTF-8 ca_IT.UTF-8 +SAME+= sl_SI.UTF-8 ca_FR.UTF-8 +SAME+= sl_SI.UTF-8 ca_ES.UTF-8 +SAME+= sl_SI.UTF-8 ca_AD.UTF-8 +SAME+= da_DK.UTF-8 da_DK.ISO8859-15 +SAME+= da_DK.UTF-8 da_DK.ISO8859-1 +SAME+= it_CH.UTF-8 it_CH.ISO8859-15 +SAME+= it_CH.UTF-8 it_CH.ISO8859-1 +SAME+= it_CH.UTF-8 de_CH.UTF-8 +SAME+= it_CH.UTF-8 de_CH.ISO8859-15 +SAME+= it_CH.UTF-8 de_CH.ISO8859-1 +SAME+= en_AU.UTF-8 en_AU.US-ASCII +SAME+= en_AU.UTF-8 en_AU.ISO8859-15 +SAME+= en_AU.UTF-8 en_AU.ISO8859-1 +SAME+= en_CA.UTF-8 en_CA.US-ASCII +SAME+= en_CA.UTF-8 en_CA.ISO8859-15 +SAME+= en_CA.UTF-8 en_CA.ISO8859-1 +SAME+= en_GB.ISO8859-15 en_GB.ISO8859-1 +SAME+= zh_Hant_HK.UTF-8 zh_Hant_HK.Big5HKSCS +SAME+= zh_Hant_HK.UTF-8 en_HK.UTF-8 +SAME+= zh_Hant_HK.UTF-8 en_HK.ISO8859-1 +SAME+= en_NZ.UTF-8 en_NZ.US-ASCII +SAME+= en_NZ.UTF-8 en_NZ.ISO8859-15 +SAME+= en_NZ.UTF-8 en_NZ.ISO8859-1 +SAME+= en_SG.UTF-8 en_SG.ISO8859-1 +SAME+= en_US.UTF-8 en_US.US-ASCII +SAME+= en_US.UTF-8 en_US.ISO8859-15 +SAME+= en_US.UTF-8 en_US.ISO8859-1 +SAME+= es_AR.UTF-8 es_AR.ISO8859-1 +SAME+= es_MX.UTF-8 es_MX.ISO8859-1 +SAME+= sv_FI.ISO8859-1 sk_SK.ISO8859-2 +SAME+= sv_FI.ISO8859-1 pt_PT.ISO8859-1 +SAME+= sv_FI.ISO8859-1 lt_LT.ISO8859-13 +SAME+= sv_FI.ISO8859-1 fr_FR.ISO8859-1 +SAME+= sv_FI.ISO8859-1 fi_FI.ISO8859-1 +SAME+= sv_FI.ISO8859-1 et_EE.ISO8859-1 +SAME+= sv_FI.ISO8859-15 pt_PT.ISO8859-15 +SAME+= sv_FI.ISO8859-15 fr_FR.ISO8859-15 +SAME+= sv_FI.ISO8859-15 fi_FI.ISO8859-15 +SAME+= sv_FI.ISO8859-15 et_EE.ISO8859-15 +SAME+= sk_SK.UTF-8 pt_PT.UTF-8 +SAME+= sk_SK.UTF-8 fr_FR.UTF-8 +SAME+= sk_SK.UTF-8 et_EE.UTF-8 +SAME+= sv_FI.UTF-8 se_FI.UTF-8 +SAME+= sv_FI.UTF-8 lt_LT.UTF-8 +SAME+= sv_FI.UTF-8 fi_FI.UTF-8 +SAME+= fr_CA.ISO8859-15 fr_CA.ISO8859-1 +SAME+= fr_CH.ISO8859-15 fr_CH.ISO8859-1 +SAME+= hr_HR.UTF-8 hr_HR.ISO8859-2 +SAME+= is_IS.UTF-8 is_IS.ISO8859-15 +SAME+= is_IS.UTF-8 is_IS.ISO8859-1 +SAME+= nb_NO.ISO8859-15 nb_NO.ISO8859-1 +SAME+= nn_NO.ISO8859-15 nn_NO.ISO8859-1 +SAME+= se_NO.UTF-8 nn_NO.UTF-8 +SAME+= pt_BR.UTF-8 pt_BR.ISO8859-1 +SAME+= ro_RO.UTF-8 ro_RO.ISO8859-2 +SAME+= sr_Latn_RS.UTF-8 sr_Latn_RS.ISO8859-2 +SAME+= sr_Latn_RS.UTF-8 sr_Cyrl_RS.UTF-8 +SAME+= sr_Latn_RS.UTF-8 sr_Cyrl_RS.ISO8859-5 +SAME+= sv_SE.ISO8859-15 sv_SE.ISO8859-1 +SAME+= zh_Hans_CN.GBK zh_Hans_CN.GB18030 +SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -.for f in ${SAME} -SYMLINKS+= ../${f:C/:.*$//}/${FILESNAME} \ - ${LOCALEDIR}/${f:C/^.*://}/${FILESNAME} +.for f t in ${SAME} +SYMLINKS+= ../$f/${FILESNAME} \ + ${LOCALEDIR}/$t/${FILESNAME} .endfor .for f in ${LOCALES} Modified: head/share/msgdef/Makefile ============================================================================== --- head/share/msgdef/Makefile Fri Dec 18 21:18:07 2015 (r292452) +++ head/share/msgdef/Makefile Fri Dec 18 21:34:28 2015 (r292453) @@ -83,132 +83,132 @@ LOCALES+= zh_Hant_HK.UTF-8 LOCALES+= zh_Hant_TW.Big5 LOCALES+= zh_Hant_TW.UTF-8 -SAME+= nl_NL.UTF-8:nl_NL.ISO8859-15 -SAME+= nl_NL.UTF-8:nl_NL.ISO8859-1 -SAME+= nl_NL.UTF-8:nl_BE.UTF-8 -SAME+= nl_NL.UTF-8:nl_BE.ISO8859-15 -SAME+= nl_NL.UTF-8:nl_BE.ISO8859-1 -SAME+= nl_NL.UTF-8:af_ZA.UTF-8 -SAME+= nl_NL.UTF-8:af_ZA.ISO8859-15 -SAME+= nl_NL.UTF-8:af_ZA.ISO8859-1 -SAME+= ar_SA.UTF-8:ar_QA.UTF-8 -SAME+= ar_SA.UTF-8:ar_MA.UTF-8 -SAME+= ar_SA.UTF-8:ar_JO.UTF-8 -SAME+= ar_SA.UTF-8:ar_EG.UTF-8 -SAME+= ar_SA.UTF-8:ar_AE.UTF-8 -SAME+= es_MX.ISO8859-1:es_ES.ISO8859-15 -SAME+= es_MX.ISO8859-1:es_ES.ISO8859-1 -SAME+= es_MX.ISO8859-1:es_AR.ISO8859-1 -SAME+= es_MX.ISO8859-1:ca_IT.ISO8859-15 -SAME+= es_MX.ISO8859-1:ca_IT.ISO8859-1 -SAME+= es_MX.ISO8859-1:ca_FR.ISO8859-15 -SAME+= es_MX.ISO8859-1:ca_FR.ISO8859-1 -SAME+= es_MX.ISO8859-1:ca_ES.ISO8859-15 -SAME+= es_MX.ISO8859-1:ca_ES.ISO8859-1 -SAME+= es_MX.ISO8859-1:ca_AD.ISO8859-15 -SAME+= es_MX.ISO8859-1:ca_AD.ISO8859-1 -SAME+= es_MX.UTF-8:es_ES.UTF-8 -SAME+= es_MX.UTF-8:es_CR.UTF-8 -SAME+= es_MX.UTF-8:es_AR.UTF-8 -SAME+= es_MX.UTF-8:ca_IT.UTF-8 -SAME+= es_MX.UTF-8:ca_FR.UTF-8 -SAME+= es_MX.UTF-8:ca_ES.UTF-8 -SAME+= es_MX.UTF-8:ca_AD.UTF-8 -SAME+= cs_CZ.UTF-8:cs_CZ.ISO8859-2 -SAME+= sv_SE.UTF-8:sv_SE.ISO8859-15 -SAME+= sv_SE.UTF-8:sv_SE.ISO8859-1 -SAME+= sv_SE.UTF-8:sv_FI.UTF-8 -SAME+= sv_SE.UTF-8:sv_FI.ISO8859-15 -SAME+= sv_SE.UTF-8:sv_FI.ISO8859-1 -SAME+= sv_SE.UTF-8:da_DK.UTF-8 -SAME+= sv_SE.UTF-8:da_DK.ISO8859-15 -SAME+= sv_SE.UTF-8:da_DK.ISO8859-1 -SAME+= de_DE.UTF-8:de_DE.ISO8859-15 -SAME+= de_DE.UTF-8:de_DE.ISO8859-1 -SAME+= de_DE.UTF-8:de_CH.UTF-8 -SAME+= de_DE.UTF-8:de_CH.ISO8859-15 -SAME+= de_DE.UTF-8:de_CH.ISO8859-1 -SAME+= de_DE.UTF-8:de_AT.UTF-8 -SAME+= de_DE.UTF-8:de_AT.ISO8859-15 -SAME+= de_DE.UTF-8:de_AT.ISO8859-1 -SAME+= en_US.UTF-8:en_ZA.UTF-8 -SAME+= en_US.UTF-8:en_ZA.US-ASCII -SAME+= en_US.UTF-8:en_ZA.ISO8859-15 -SAME+= en_US.UTF-8:en_ZA.ISO8859-1 -SAME+= en_US.UTF-8:en_US.US-ASCII -SAME+= en_US.UTF-8:en_US.ISO8859-15 -SAME+= en_US.UTF-8:en_US.ISO8859-1 -SAME+= en_US.UTF-8:en_SG.UTF-8 -SAME+= en_US.UTF-8:en_SG.ISO8859-1 -SAME+= en_US.UTF-8:en_PH.UTF-8 -SAME+= en_US.UTF-8:en_NZ.UTF-8 -SAME+= en_US.UTF-8:en_NZ.US-ASCII -SAME+= en_US.UTF-8:en_NZ.ISO8859-15 -SAME+= en_US.UTF-8:en_NZ.ISO8859-1 -SAME+= en_US.UTF-8:en_IE.UTF-8 -SAME+= en_US.UTF-8:en_IE.ISO8859-15 -SAME+= en_US.UTF-8:en_IE.ISO8859-1 -SAME+= en_US.UTF-8:en_HK.UTF-8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 18 21:58:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A9BA4B453; Fri, 18 Dec 2015 21:58:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA141B68; Fri, 18 Dec 2015 21:58:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBILwh5Q040584; Fri, 18 Dec 2015 21:58:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBILwhRB040583; Fri, 18 Dec 2015 21:58:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512182158.tBILwhRB040583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 18 Dec 2015 21:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292454 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 21:58:44 -0000 Author: pfg Date: Fri Dec 18 21:58:42 2015 New Revision: 292454 URL: https://svnweb.freebsd.org/changeset/base/292454 Log: ed(1): Prevent possible string overflows CID: 1007252 MFC after: 2 weeks Modified: head/bin/ed/main.c Modified: head/bin/ed/main.c ============================================================================== --- head/bin/ed/main.c Fri Dec 18 21:34:28 2015 (r292453) +++ head/bin/ed/main.c Fri Dec 18 21:58:42 2015 (r292454) @@ -505,7 +505,8 @@ exec_command(void) return ERR; else if (open_sbuf() < 0) return FATAL; - if (*fnp && *fnp != '!') strcpy(old_filename, fnp); + if (*fnp && *fnp != '!') + strncpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -532,7 +533,8 @@ exec_command(void) return ERR; } GET_COMMAND_SUFFIX(); - if (*fnp) strcpy(old_filename, fnp); + if (*fnp) + strncpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -663,7 +665,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strncpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -797,7 +799,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strncpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; From owner-svn-src-all@freebsd.org Fri Dec 18 22:01:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EECEA4B5C4 for ; Fri, 18 Dec 2015 22:01:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFEEE1E86 for ; Fri, 18 Dec 2015 22:01:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-pa0-x232.google.com with SMTP id ur14so66386298pab.0 for ; Fri, 18 Dec 2015 14:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=n9svhTMdl8iz4s0Bd5JDpBOjDbaDwgAhLkUYSlDDESs=; b=W3TKli4oTt+NRRWgDevraQsbkHjDcZJ1drw3AfLVVhjpzGa216Pt//T/hDXfEOoAui yzrWvIMANH0oPeRrjV6duY53pVxwW8F4UKg7bCVy6HvXVCYZqvxFP9vOHR1DBGPx0cc/ ea53BxTLR/33qvVImFDGvRdsjFi5v9lEPDR5f39Hwj5YZeM0XyS1C4T7YHvXye470JmZ ErmJKs01zNu+jSlSnjEYV73/GQ41EbPPUVeoLSq6MyNZaMCVFzzozvM1aGFTN3r595+c DqHEiBVV/cDIDkdPwAoS0Ca98uDpNE5jg2KE1PxECLckFgOcQ566ca4+7mCXIQ9zpfmL K4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=n9svhTMdl8iz4s0Bd5JDpBOjDbaDwgAhLkUYSlDDESs=; b=TJjiPQEg5m3vxUNnNXXS+L0bd+pp/i/EXPIXHEaajZb/wh7tiyI/zN6JY7+ZAYb2qP yLAdZCkjajjXp69hwwYdUFaxij2FbPB5GW2K8jsbpqNVnNXBBwNSZK9/ajhQBsUl+6md zleGECCINKvvxbE8tWPNjXgbFe6Nr/7MSN+8AMprkfTqV73vKVTkanCE1ww53Nu+mIO2 0jIv496p0dfB+svvJXr/r59pylPhQOhJtGwozul4o14VvbBN6HMAmj0Glk3kKpPGKFV+ 9rOQeSzR5HPeqSelJpClVYyvAo/JpsgydmquJaNHRa6305IRbK2oAIXBnX6HzrvIp6nP UYjw== X-Gm-Message-State: ALoCoQkxBKLCqXtioIx/uQyJmsZDdUvjykpYCUZQJcnwkNcfUpRpCtFbxZM0AyHSVo7rvYQmUVc+U4rFGjoW3OuXhsf7dfe5Pg== X-Received: by 10.66.118.135 with SMTP id km7mr8628005pab.159.1450476101484; Fri, 18 Dec 2015 14:01:41 -0800 (PST) Received: from [100.127.128.44] ([69.53.245.4]) by smtp.gmail.com with ESMTPSA id s90sm14723652pfi.72.2015.12.18.14.01.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 14:01:40 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r292454 - head/bin/ed Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2ABCFC0F-4C08-4801-BFE5-1B8B17CD29D9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <201512182158.tBILwhRB040583@repo.freebsd.org> Date: Fri, 18 Dec 2015 15:01:38 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> References: <201512182158.tBILwhRB040583@repo.freebsd.org> To: "Pedro F. Giffuni" X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 22:01:42 -0000 --Apple-Mail=_2ABCFC0F-4C08-4801-BFE5-1B8B17CD29D9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Isn=E2=80=99t strlcpy() the more appropriate interface? strncpy = doesn=E2=80=99t guarantee NUL termination. Warner > On Dec 18, 2015, at 2:58 PM, Pedro F. Giffuni wrote: >=20 > Author: pfg > Date: Fri Dec 18 21:58:42 2015 > New Revision: 292454 > URL: https://svnweb.freebsd.org/changeset/base/292454 >=20 > Log: > ed(1): Prevent possible string overflows >=20 > CID: 1007252 > MFC after: 2 weeks >=20 > Modified: > head/bin/ed/main.c >=20 > Modified: head/bin/ed/main.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/bin/ed/main.c Fri Dec 18 21:34:28 2015 = (r292453) > +++ head/bin/ed/main.c Fri Dec 18 21:58:42 2015 = (r292454) > @@ -505,7 +505,8 @@ exec_command(void) > return ERR; > else if (open_sbuf() < 0) > return FATAL; > - if (*fnp && *fnp !=3D '!') strcpy(old_filename, fnp); > + if (*fnp && *fnp !=3D '!') > + strncpy(old_filename, fnp, PATH_MAX); > #ifdef BACKWARDS > if (*fnp =3D=3D '\0' && *old_filename =3D=3D '\0') { > errmsg =3D "no current filename"; > @@ -532,7 +533,8 @@ exec_command(void) > return ERR; > } > GET_COMMAND_SUFFIX(); > - if (*fnp) strcpy(old_filename, fnp); > + if (*fnp) > + strncpy(old_filename, fnp, PATH_MAX); > printf("%s\n", strip_escapes(old_filename)); > break; > case 'g': > @@ -663,7 +665,7 @@ exec_command(void) > GET_COMMAND_SUFFIX(); > if (!isglobal) clear_undo_stack(); > if (*old_filename =3D=3D '\0' && *fnp !=3D '!') > - strcpy(old_filename, fnp); > + strncpy(old_filename, fnp, PATH_MAX); > #ifdef BACKWARDS > if (*fnp =3D=3D '\0' && *old_filename =3D=3D '\0') { > errmsg =3D "no current filename"; > @@ -797,7 +799,7 @@ exec_command(void) > return ERR; > GET_COMMAND_SUFFIX(); > if (*old_filename =3D=3D '\0' && *fnp !=3D '!') > - strcpy(old_filename, fnp); > + strncpy(old_filename, fnp, PATH_MAX); > #ifdef BACKWARDS > if (*fnp =3D=3D '\0' && *old_filename =3D=3D '\0') { > errmsg =3D "no current filename"; >=20 --Apple-Mail=_2ABCFC0F-4C08-4801-BFE5-1B8B17CD29D9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJWdIJCAAoJEGwc0Sh9sBEAApIQAMhqBCqdCLu17RXWsvLLsXZF u5AWMtSUoJBPkJmQrBf8Pl6CX+U4Qudy3atCj9N0yEAiLEwE3U9JBwqhMP3Tedsz +LDHx5uSqYLo9DSHMUeVze6gBn6eOEeLV2/s+5aUQGcWV1X32XT7XT6Zv5KsyX22 6JvJZmmJVWbspIf3EWb1eX92z4qnZxPFYN38OzhNT+69BbIt506sRXi0a/Q/lnYP tZoP+8EQ78ZLcEECcZZFOFOOKEf57vty0afRmlesjc809cwa8UgbD4XK6yhgDEjR BZMJ9sCKK9XbvDW3RRLdrg42v2nGilyoeCrc84+47hzK0hlY1bikcYcMLP8l/HoM 9W6h0YAaLNort46ANaLoXlP3MFpSf1D0lLv+YKWXNbjucXqKToVU82tL1lKvkT4Y 1kSZDP5yXuBHSTMhMAJjDJIt7mbcBJsph5U+AO0aMxAgMhZaYdN6Y3xE+rg0sj66 AFoQpINJ0RYJv1PqWzDvKQEuaLbETgzZVnyXyXSMxLFRwxoRaMT93NelWScNPLUl XVuZ++1vjLKKVrIdAoJlgkeY23O3ngHTfKrazJjTOky9LSgHjVinvfkZu2O0HmzZ JzB5eLgZMtAbgQXjbhTi5j77La/4yYwQpaBMhv+gL7wllvTzs191AwqQlcHTaxr2 /M5xNHuiUxR+1txV5eTC =U0cR -----END PGP SIGNATURE----- --Apple-Mail=_2ABCFC0F-4C08-4801-BFE5-1B8B17CD29D9-- From owner-svn-src-all@freebsd.org Fri Dec 18 22:44:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47AC8A4B193 for ; Fri, 18 Dec 2015 22:44:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 286A41E15 for ; Fri, 18 Dec 2015 22:44:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: (qmail 808 invoked by uid 99); 18 Dec 2015 22:44:37 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2015 22:44:37 +0000 Received: from [192.168.0.103] (unknown [181.55.232.163]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 0076A1A05B0; Fri, 18 Dec 2015 22:44:34 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r292454 - head/bin/ed From: Pedro Giffuni In-Reply-To: <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> Date: Fri, 18 Dec 2015 17:44:31 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201512182158.tBILwhRB040583@repo.freebsd.org> <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 22:44:39 -0000 Hi Warner; > Il giorno 18/dic/2015, alle ore 17:01, Warner Losh ha = scritto: >=20 > Isn=E2=80=99t strlcpy() the more appropriate interface? strncpy = doesn=E2=80=99t guarantee NUL termination. >=20 Maybe, but we were using strcpy() which doesn=E2=80=99t guarantee NULL = termination either and things have been working. I also thought that portability may be = specially important for the stuff in bin/. Pedro. > Warner >=20 >> On Dec 18, 2015, at 2:58 PM, Pedro F. Giffuni = wrote: >>=20 >> Author: pfg >> Date: Fri Dec 18 21:58:42 2015 >> New Revision: 292454 >> URL: https://svnweb.freebsd.org/changeset/base/292454 >>=20 >> Log: >> ed(1): Prevent possible string overflows >>=20 >> CID: 1007252 >> MFC after: 2 weeks >>=20 >> Modified: >> head/bin/ed/main.c >>=20 >> Modified: head/bin/ed/main.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/bin/ed/main.c Fri Dec 18 21:34:28 2015 = (r292453) >> +++ head/bin/ed/main.c Fri Dec 18 21:58:42 2015 = (r292454) >> @@ -505,7 +505,8 @@ exec_command(void) >> return ERR; >> else if (open_sbuf() < 0) >> return FATAL; >> - if (*fnp && *fnp !=3D '!') strcpy(old_filename, fnp); >> + if (*fnp && *fnp !=3D '!') >> + strncpy(old_filename, fnp, PATH_MAX); >> #ifdef BACKWARDS >> if (*fnp =3D=3D '\0' && *old_filename =3D=3D '\0') { >> errmsg =3D "no current filename"; >> @@ -532,7 +533,8 @@ exec_command(void) >> return ERR; >> } >> GET_COMMAND_SUFFIX(); >> - if (*fnp) strcpy(old_filename, fnp); >> + if (*fnp) >> + strncpy(old_filename, fnp, PATH_MAX); >> printf("%s\n", strip_escapes(old_filename)); >> break; >> case 'g': >> @@ -663,7 +665,7 @@ exec_command(void) >> GET_COMMAND_SUFFIX(); >> if (!isglobal) clear_undo_stack(); >> if (*old_filename =3D=3D '\0' && *fnp !=3D '!') >> - strcpy(old_filename, fnp); >> + strncpy(old_filename, fnp, PATH_MAX); >> #ifdef BACKWARDS >> if (*fnp =3D=3D '\0' && *old_filename =3D=3D '\0') { >> errmsg =3D "no current filename"; >> @@ -797,7 +799,7 @@ exec_command(void) >> return ERR; >> GET_COMMAND_SUFFIX(); >> if (*old_filename =3D=3D '\0' && *fnp !=3D '!') >> - strcpy(old_filename, fnp); >> + strncpy(old_filename, fnp, PATH_MAX); >> #ifdef BACKWARDS >> if (*fnp =3D=3D '\0' && *old_filename =3D=3D '\0') { >> errmsg =3D "no current filename"; >>=20 >=20 From owner-svn-src-all@freebsd.org Fri Dec 18 23:05:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B67F5A4BF45; Fri, 18 Dec 2015 23:05:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A54812F6; Fri, 18 Dec 2015 23:05:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIN5as6060924; Fri, 18 Dec 2015 23:05:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIN5aY1060923; Fri, 18 Dec 2015 23:05:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512182305.tBIN5aY1060923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 18 Dec 2015 23:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292455 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 18 Dec 2015 23:05:37 -0000 Author: pfg Date: Fri Dec 18 23:05:36 2015 New Revision: 292455 URL: https://svnweb.freebsd.org/changeset/base/292455 Log: ed(1): Prevent possible string overflows Use strlcpy instead of strncpy to guarantee NULL termination. Pointed out by: imp CID: 1007252 X-MFC with: r292454 Modified: head/bin/ed/main.c Modified: head/bin/ed/main.c ============================================================================== --- head/bin/ed/main.c Fri Dec 18 21:58:42 2015 (r292454) +++ head/bin/ed/main.c Fri Dec 18 23:05:36 2015 (r292455) @@ -506,7 +506,7 @@ exec_command(void) else if (open_sbuf() < 0) return FATAL; if (*fnp && *fnp != '!') - strncpy(old_filename, fnp, PATH_MAX); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -534,7 +534,7 @@ exec_command(void) } GET_COMMAND_SUFFIX(); if (*fnp) - strncpy(old_filename, fnp, PATH_MAX); + strlcpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -665,7 +665,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strncpy(old_filename, fnp, PATH_MAX); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -799,7 +799,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strncpy(old_filename, fnp, PATH_MAX); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; From owner-svn-src-all@freebsd.org Sat Dec 19 00:45:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B8B3A4BF5D; Sat, 19 Dec 2015 00:45:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f170.google.com (mail-yk0-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03F951AE0; Sat, 19 Dec 2015 00:45:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f170.google.com with SMTP id x184so77981904yka.3; Fri, 18 Dec 2015 16:45:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=iTF8y+7o2xunfkbOsYg3tjNyx8L84Cc/HNhmc1DjKTQ=; b=OZW+9HmXlCw6moLDCGLUJsV7XKcWsPWI7hsWykmcMDQ5+bsYWVSr5NoQp8vEVMbbJQ fv2VNVJ0JxgSnGtMWXMK/vz4/p0unNLQ6EI10sZBMPs0RB/XF2YEUu5N19HBOyzHWE8b Ppo2NRD4gvP2WSPhN5krlJ2Ibx1T4NDZ5odPehIcicIOx9RK/HgoTun4bD6hT59XZ2b3 qS4kq551UUJac+gEELE8Um8dHzZqmmzo7YsSkA4cEpC8elE2xFEERNYmSEf0tR4/0nsd Yke+SBLoOsdKcKMii+rcC4EFxRZj7Hlq3R7GMGJUGzlyL0Mkf3nptpi0/YLu3HLnypvz 10Zg== X-Received: by 10.129.44.4 with SMTP id s4mr5495142yws.114.1450482411273; Fri, 18 Dec 2015 15:46:51 -0800 (PST) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com. [209.85.160.176]) by smtp.gmail.com with ESMTPSA id h130sm18405993ywb.24.2015.12.18.15.46.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Dec 2015 15:46:51 -0800 (PST) Received: by mail-yk0-f176.google.com with SMTP id 140so76360771ykp.0; Fri, 18 Dec 2015 15:46:50 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.57.69 with SMTP id g66mr5272099ywa.267.1450482410739; Fri, 18 Dec 2015 15:46:50 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Fri, 18 Dec 2015 15:46:50 -0800 (PST) In-Reply-To: References: <201512182158.tBILwhRB040583@repo.freebsd.org> <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> Date: Fri, 18 Dec 2015 15:46:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r292454 - head/bin/ed From: Conrad Meyer To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 00:45:21 -0000 On Fri, Dec 18, 2015 at 2:44 PM, Pedro Giffuni wrote: > Hi Warner; > >> Il giorno 18/dic/2015, alle ore 17:01, Warner Losh ha s= critto: >> >> Isn=E2=80=99t strlcpy() the more appropriate interface? strncpy doesn=E2= =80=99t guarantee NUL termination. >> > > Maybe, but we were using strcpy() which doesn=E2=80=99t guarantee NULL te= rmination either > and things have been working. I also thought that portability may be spec= ially important > for the stuff in bin/. strcpy() does guarantee NUL termination. Otherwise it would be useless. DESCRIPTION The stpcpy() and strcpy() functions copy the string src to dst (includ= ing the terminating =E2=80=98\0=E2=80=99 character.) Best, Conrad From owner-svn-src-all@freebsd.org Sat Dec 19 01:21:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D843A4B471; Sat, 19 Dec 2015 01:21:30 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E24751D71; Sat, 19 Dec 2015 01:21:29 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ1LTE6001410; Sat, 19 Dec 2015 01:21:29 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ1LTn8001409; Sat, 19 Dec 2015 01:21:29 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512190121.tBJ1LTn8001409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sat, 19 Dec 2015 01: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: r292456 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 01:21:30 -0000 Author: ume Date: Sat Dec 19 01:21:28 2015 New Revision: 292456 URL: https://svnweb.freebsd.org/changeset/base/292456 Log: MFC r292129: RFC 3493 requires ignoring the loopback address for AI_ADDRCONFIG. Since it breaks certain jail setup, we ignore just 127.0.0.1 instead of whole loopback address range. PR: 192014 Reviewed by: hrs Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Fri Dec 18 23:05:36 2015 (r292455) +++ stable/10/lib/libc/net/getaddrinfo.c Sat Dec 19 01:21:28 2015 (r292456) @@ -1562,7 +1562,7 @@ addrconfig(struct addrinfo *pai) if (seen_inet) continue; sin = (struct sockaddr_in *)(ifa->ifa_addr); - if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr))) + if (htonl(sin->sin_addr.s_addr) == INADDR_LOOPBACK) continue; seen_inet = 1; break; From owner-svn-src-all@freebsd.org Sat Dec 19 01:24:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32ACEA4B612; Sat, 19 Dec 2015 01:24:09 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 006FA1F99; Sat, 19 Dec 2015 01:24:08 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ1O8hk002191; Sat, 19 Dec 2015 01:24:08 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ1O8ua002189; Sat, 19 Dec 2015 01:24:08 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512190124.tBJ1O8ua002189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sat, 19 Dec 2015 01:24:08 +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: r292457 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 01:24:09 -0000 Author: ume Date: Sat Dec 19 01:24:07 2015 New Revision: 292457 URL: https://svnweb.freebsd.org/changeset/base/292457 Log: MFC r292129: RFC 3493 requires ignoring the loopback address for AI_ADDRCONFIG. Since it breaks certain jail setup, we ignore just 127.0.0.1 instead of whole loopback address range. PR: 192014 Reviewed by: hrs Modified: stable/9/lib/libc/net/getaddrinfo.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Sat Dec 19 01:21:28 2015 (r292456) +++ stable/9/lib/libc/net/getaddrinfo.c Sat Dec 19 01:24:07 2015 (r292457) @@ -1557,7 +1557,7 @@ addrconfig(struct addrinfo *pai) if (seen_inet) continue; sin = (struct sockaddr_in *)(ifa->ifa_addr); - if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr))) + if (htonl(sin->sin_addr.s_addr) == INADDR_LOOPBACK) continue; seen_inet = 1; break; From owner-svn-src-all@freebsd.org Sat Dec 19 01:27:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A821A4B888; Sat, 19 Dec 2015 01:27:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1253A1198; Sat, 19 Dec 2015 01:27:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22c.google.com with SMTP id ur14so68409074pab.0; Fri, 18 Dec 2015 17:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pCR2GDu35VcC4ZsIddgGfBJOd/OrYWJygKj6WxxE99c=; b=AuHk8GEnyZyIEZN3AwreqFpb7TwqYswkCvBth9QQzfupM6EIbittuKG2L7xJmcE6rY edF2bptpJrtu939A5qSGba3HcJQtjndy2bz1XoZFvh5HpmLdgqjL0axBCG1Ewu1RAZe7 xgFPSWRrn69VzhDB7ddgkglG1sH7Gw5JgYLQ0j1+AuBvWvB9BCHRnclHdRIEzXy7w37q qlPXkO+o8bb4wYcOVF6PhJwmILLz0OjX9Bad4DVHeJ++yZ4m6yV4+faFkirpG4zPg3DT qnGQlUvQKcT6Ypz2dy3eqHZCe9s548ShtGnCM9PBGQu28b50AkWI4jmk0seuwtbn+2SB Bpdw== X-Received: by 10.66.140.79 with SMTP id re15mr9495629pab.127.1450488477545; Fri, 18 Dec 2015 17:27:57 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:7494:dafc:c8fd:bb12? ([2601:601:800:126d:7494:dafc:c8fd:bb12]) by smtp.gmail.com with ESMTPSA id w26sm20256338pfi.78.2015.12.18.17.27.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Dec 2015 17:27:56 -0800 (PST) Content-Type: text/plain; charset=cp932 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r292454 - head/bin/ed From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: Date: Fri, 18 Dec 2015 17:27:55 -0800 Cc: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201512182158.tBILwhRB040583@repo.freebsd.org> <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> To: cem@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 01:27:58 -0000 > On Dec 18, 2015, at 15:46, Conrad Meyer wrote: >=20 >> On Fri, Dec 18, 2015 at 2:44 PM, Pedro Giffuni wrote: >> Hi Warner; >>=20 >>> Il giorno 18/dic/2015, alle ore 17:01, Warner Losh ha s= critto: >>>=20 >>> Isn=81ft strlcpy() the more appropriate interface? strncpy doesn=81ft gu= arantee NUL termination. >>=20 >> Maybe, but we were using strcpy() which doesn=81ft guarantee NULL termina= tion either >> and things have been working. I also thought that portability may be spec= ially important >> for the stuff in bin/. >=20 > strcpy() does guarantee NUL termination. Otherwise it would be useless. >=20 > DESCRIPTION > The stpcpy() and strcpy() functions copy the string src to dst (includ= ing > the terminating =81e\0=81f character.) +1 to using strlcpy instead of strcpy/strncpy. Thanks!= From owner-svn-src-all@freebsd.org Sat Dec 19 01:47:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E61D7A4C72D; Sat, 19 Dec 2015 01:47:01 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC0AE13C2; Sat, 19 Dec 2015 01:47:01 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id n128so39802754pfn.0; Fri, 18 Dec 2015 17:47:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=XUjp1OLELA4/F4Wyxk+MktcWJQsy3hIkWBfIZvG8YfM=; b=CmZ+Mi7zr18soTKIRUtEw020br1essqLsQ8lsYKRUlTzN4cNRfm2lGqFlS81PWe0Th fo4Ji66RVgK9eh2suv8TfpcYpLoK9eRTQeyFkh5sOCj2IS9mLpY9+NGiQ6n5qu99c9GC FYbLYBCBbaIK5UkAfwjeK2k1nSJJ7uX0+uBI704kXUAI9K7SyT32PgSmOGWBTyZc5vI3 zHHTbyD2TpZHGRBdXY2pCv0IZtaOdmMcw4dtqi+Dvp7YiqLPsw9UsvqSnRU6slg8/lXo RWo6Gyk+i8NJ33eL6DFlT3P3JcnRwxeyakvbp2G5BrmBOioOuuiHsqodmjjZbIk1T+Wg xW6w== X-Received: by 10.98.8.132 with SMTP id 4mr9894412pfi.128.1450489621408; Fri, 18 Dec 2015 17:47:01 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:c825:be55:88ec:f9f1? (2001-44b8-31ae-7b01-c825-be55-88ec-f9f1.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:c825:be55:88ec:f9f1]) by smtp.gmail.com with ESMTPSA id q193sm5066413pfq.28.2015.12.18.17.46.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Dec 2015 17:47:01 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r292379 - in head/sys: netinet netinet6 References: <201512162226.tBGMQSvs098886@repo.freebsd.org> <20151217003824.GG42340@FreeBSD.org> <5672C6AE.7070407@freebsd.org> <20151217192051.GM42340@FreeBSD.org> <56733D49.8040103@multiplay.co.uk> To: Steven Hartland , Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Kubilay Kocak X-Enigmail-Draft-Status: N1110 Message-ID: <5674B709.2070605@FreeBSD.org> Date: Sat, 19 Dec 2015 12:46:49 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <56733D49.8040103@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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 01:47:02 -0000 On 18/12/2015 9:55 AM, Steven Hartland wrote: > On 17/12/2015 19:20, Gleb Smirnoff wrote: >> Steven, >> >> another feasible solution for the design described in the 156226 >> would be to run STP on the switches, and if_bridge(4) instead of >> if_lagg(4) on FreeBSD, also with STP enabled. Would work perfectly. >> >> Of course, if switches are dumb and cheap, and can't do STP, >> then a tiny bpf-writer is the right solution. >> >> P.S. When I was running network in my university dormitory, we >> used a lot of cheap solutions, and a lot of dirty workarounds, >> but none of the latter made its way to FreeBSD kernel. You can >> also ask Eugene Grosbein, he also has huge experience of living >> on not so pleasant workarounds, but not pushing them agrressively >> into the kernel. >> > Last time I heard STP is a bad word in networking, so I'm sure they > network team > would have me crucified for even suggesting it and start shouting MLAG > for the > rest of the day ;-) > > Regards > Steve FWIW, during my testing at $lastjob, STP-enabled switches didn't provide optimial failback times, even with portfast enabled. This was for two FreeBSD machines providing HA network management services for multiple backends configured with dual-port bge/em NIC's configured with lagg(4) (bge0/em0, bge1,em1) in failover mode (no aggregation), with multiple carp(4) interfaces for public service IP's on top. From owner-svn-src-all@freebsd.org Sat Dec 19 01:52:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804E3A4CAF6 for ; Sat, 19 Dec 2015 01:52:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 33BB319AE for ; Sat, 19 Dec 2015 01:52:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: (qmail 20713 invoked by uid 99); 19 Dec 2015 01:52:21 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Dec 2015 01:52:21 +0000 Received: from [192.168.0.103] (unknown [181.55.232.163]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id BA7A61A0453; Sat, 19 Dec 2015 01:52:20 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r292454 - head/bin/ed From: Pedro Giffuni In-Reply-To: Date: Fri, 18 Dec 2015 20:52:17 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3C185FD1-F245-4B75-9CE6-CD217AF94B28@FreeBSD.org> References: <201512182158.tBILwhRB040583@repo.freebsd.org> <44E9BE06-1883-4AF8-816D-D699CF733EEB@bsdimp.com> To: cem@FreeBSD.org X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 01:52:23 -0000 > Il giorno 18/dic/2015, alle ore 18:46, Conrad Meyer = ha scritto: >=20 > On Fri, Dec 18, 2015 at 2:44 PM, Pedro Giffuni = wrote: >> Hi Warner; >>=20 >>> Il giorno 18/dic/2015, alle ore 17:01, Warner Losh = ha scritto: >>>=20 >>> Isn=E2=80=99t strlcpy() the more appropriate interface? strncpy = doesn=E2=80=99t guarantee NUL termination. >>>=20 >>=20 >> Maybe, but we were using strcpy() which doesn=E2=80=99t guarantee = NULL termination either >> and things have been working. I also thought that portability may be = specially important >> for the stuff in bin/. >=20 > strcpy() does guarantee NUL termination. Otherwise it would be = useless. >=20 Yes , my bad. I come from a non-C background and sometimes tend to (erronously) think = the C library designers would keep some consistency :-/. I changed it to strlcpy() a while ago. Pedro. From owner-svn-src-all@freebsd.org Sat Dec 19 02:16:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56172A4BC4B; Sat, 19 Dec 2015 02:16:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17A9C1809; Sat, 19 Dec 2015 02:16:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2GceA017184; Sat, 19 Dec 2015 02:16:38 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2Gclo017183; Sat, 19 Dec 2015 02:16:38 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201512190216.tBJ2Gclo017183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 19 Dec 2015 02:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292460 - head/sys/powerpc/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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 02:16:39 -0000 Author: nwhitehorn Date: Sat Dec 19 02:16:38 2015 New Revision: 292460 URL: https://svnweb.freebsd.org/changeset/base/292460 Log: Provide link state reporting so that ifconfig_llan0="DHCP" works. The reported link state is fictional (always up) since the hypervisor does not provide this information. MFC after: 1 week Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Sat Dec 19 01:45:50 2015 (r292459) +++ head/sys/powerpc/pseries/phyp_llan.c Sat Dec 19 02:16:38 2015 (r292460) @@ -87,6 +87,8 @@ struct llan_softc { cell_t unit; uint8_t mac_address[8]; + struct ifmedia media; + int irqid; struct resource *irq; void *irq_cookie; @@ -116,6 +118,8 @@ static void llan_intr(void *xsc); static void llan_init(void *xsc); static void llan_start(struct ifnet *ifp); static int llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); +static void llan_media_status(struct ifnet *ifp, struct ifmediareq *ifmr); +static int llan_media_change(struct ifnet *ifp); static void llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int err); static int llan_add_rxbuf(struct llan_softc *sc, struct llan_xfer *rx); @@ -220,16 +224,46 @@ llan_attach(device_t dev) sc->ifp->if_ioctl = llan_ioctl; sc->ifp->if_init = llan_init; + ifmedia_init(&sc->media, IFM_IMASK, llan_media_change, + llan_media_status); + ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_AUTO); + IFQ_SET_MAXLEN(&sc->ifp->if_snd, LLAN_MAX_TX_PACKETS); sc->ifp->if_snd.ifq_drv_maxlen = LLAN_MAX_TX_PACKETS; IFQ_SET_READY(&sc->ifp->if_snd); ether_ifattach(sc->ifp, &sc->mac_address[2]); + /* We don't have link state reporting, so make it always up */ + if_link_state_change(sc->ifp, LINK_STATE_UP); + + return (0); +} + +static int +llan_media_change(struct ifnet *ifp) +{ + struct llan_softc *sc = ifp->if_softc; + + if (IFM_TYPE(sc->media.ifm_media) != IFM_ETHER) + return (EINVAL); + + if (IFM_SUBTYPE(sc->media.ifm_media) != IFM_AUTO) + return (EINVAL); + return (0); } static void +llan_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + + ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE | IFM_UNKNOWN | IFM_FDX; + ifmr->ifm_active = IFM_ETHER; +} + +static void llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int err) { struct llan_softc *sc = xsc; @@ -501,6 +535,10 @@ llan_ioctl(struct ifnet *ifp, u_long cmd llan_set_multicast(sc); mtx_unlock(&sc->io_lock); break; + case SIOCGIFMEDIA: + case SIOCSIFMEDIA: + err = ifmedia_ioctl(ifp, (struct ifreq *)data, &sc->media, cmd); + break; case SIOCSIFFLAGS: default: err = ether_ioctl(ifp, cmd, data); From owner-svn-src-all@freebsd.org Sat Dec 19 02:35:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A47AA4C7B8; Sat, 19 Dec 2015 02:35:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1DE11BC; Sat, 19 Dec 2015 02:35:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2ZW6G022985; Sat, 19 Dec 2015 02:35:32 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2ZWmC022984; Sat, 19 Dec 2015 02:35:32 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512190235.tBJ2ZWmC022984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 19 Dec 2015 02:35:32 +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: r292461 - stable/10/lib/libc/resolv 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 02:35:33 -0000 Author: vangyzen Date: Sat Dec 19 02:35:32 2015 New Revision: 292461 URL: https://svnweb.freebsd.org/changeset/base/292461 Log: MFC r289837 resolver: abuse _res a little less In the past, _res was a global variable. Now, it's multiple function calls. Several functions in the resolver use _res multiple times and therefore call the function(s) far more than necessary. Fix those callers to store the result of _res in a local variable. Add __noinline to the definition of res_init() to avoid the code bloat that these changes would have otherwise incurred. Thanks to jilles for noticing this. Sponsored by: Dell Inc. Modified: stable/10/lib/libc/resolv/res_data.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_data.c ============================================================================== --- stable/10/lib/libc/resolv/res_data.c Sat Dec 19 02:16:38 2015 (r292460) +++ stable/10/lib/libc/resolv/res_data.c Sat Dec 19 02:35:32 2015 (r292461) @@ -77,9 +77,10 @@ const char *_res_sectioncodes[] = { int res_ourserver_p(const res_state, const struct sockaddr_in *); -int +__noinline int res_init(void) { extern int __res_vinit(res_state, int); + res_state statp = &_res; /* * These three fields used to be statically initialized. This made @@ -100,14 +101,14 @@ res_init(void) { * set in RES_DEFAULT). Our solution is to declare such applications * "broken". They could fool us by setting RES_INIT but none do (yet). */ - if (!_res.retrans) - _res.retrans = RES_TIMEOUT; - if (!_res.retry) - _res.retry = RES_DFLRETRY; - if (!(_res.options & RES_INIT)) - _res.options = RES_DEFAULT; + if (!statp->retrans) + statp->retrans = RES_TIMEOUT; + if (!statp->retry) + statp->retry = RES_DFLRETRY; + if (!(statp->options & RES_INIT)) + statp->options = RES_DEFAULT; - return (__res_vinit(&_res, 1)); + return (__res_vinit(statp, 1)); } void @@ -122,10 +123,11 @@ fp_query(const u_char *msg, FILE *file) void fp_nquery(const u_char *msg, int len, FILE *file) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) return; - res_pquery(&_res, msg, len, file); + res_pquery(statp, msg, len, file); } int @@ -138,23 +140,25 @@ res_mkquery(int op, /*!< opcode of que u_char *buf, /*!< buffer to put query */ int buflen) /*!< size of buffer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nmkquery(&_res, op, dname, class, type, + return (res_nmkquery(statp, op, dname, class, type, data, datalen, newrr_in, buf, buflen)); } int res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nmkupdate(&_res, rrecp_in, buf, buflen)); + return (res_nmkupdate(statp, rrecp_in, buf, buflen)); } int @@ -163,11 +167,12 @@ res_query(const char *name, /*!< domain u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer buffer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nquery(&_res, name, class, type, answer, anslen)); + return (res_nquery(statp, name, class, type, answer, anslen)); } #ifndef _LIBC @@ -189,12 +194,13 @@ res_isourserver(const struct sockaddr_in int res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { /* errno should have been set by res_init() in this case. */ return (-1); } - return (res_nsend(&_res, buf, buflen, ans, anssiz)); + return (res_nsend(statp, buf, buflen, ans, anssiz)); } #ifndef _LIBC @@ -202,12 +208,13 @@ int res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key, u_char *ans, int anssiz) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { /* errno should have been set by res_init() in this case. */ return (-1); } - return (res_nsendsigned(&_res, buf, buflen, key, ans, anssiz)); + return (res_nsendsigned(statp, buf, buflen, key, ans, anssiz)); } #endif @@ -218,12 +225,13 @@ res_close(void) { int res_update(ns_updrec *rrecp_in) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nupdate(&_res, rrecp_in, NULL)); + return (res_nupdate(statp, rrecp_in, NULL)); } int @@ -232,12 +240,13 @@ res_search(const char *name, /*!< domain u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nsearch(&_res, name, class, type, answer, anslen)); + return (res_nsearch(statp, name, class, type, answer, anslen)); } int @@ -247,24 +256,26 @@ res_querydomain(const char *name, u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nquerydomain(&_res, name, domain, + return (res_nquerydomain(statp, name, domain, class, type, answer, anslen)); } u_int res_randomid(void) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nrandomid(&_res)); + return (res_nrandomid(statp)); } int @@ -284,13 +295,15 @@ hostalias(const char *name) { int local_hostname_length(const char *hostname) { int len_host, len_domain; + res_state statp; - if (!*_res.defdname) + statp = &_res; + if (!*statp->defdname) res_init(); len_host = strlen(hostname); - len_domain = strlen(_res.defdname); + len_domain = strlen(statp->defdname); if (len_host > len_domain && - !strcasecmp(hostname + len_host - len_domain, _res.defdname) && + !strcasecmp(hostname + len_host - len_domain, statp->defdname) && hostname[len_host - len_domain - 1] == '.') return (len_host - len_domain - 1); return (0); From owner-svn-src-all@freebsd.org Sat Dec 19 02:41:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D619A4CAA9; Sat, 19 Dec 2015 02:41:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC7514E5; Sat, 19 Dec 2015 02:41:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2fWrZ025207; Sat, 19 Dec 2015 02:41:32 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2fW2d025203; Sat, 19 Dec 2015 02:41:32 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512190241.tBJ2fW2d025203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 19 Dec 2015 02:41:32 +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: r292462 - in stable/10: lib/libc/resolv share/man/man5 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 02:41:33 -0000 Author: vangyzen Date: Sat Dec 19 02:41:31 2015 New Revision: 292462 URL: https://svnweb.freebsd.org/changeset/base/292462 Log: MFC r289315, r292216 resolver: automatically reload /etc/resolv.conf On each resolver query, use stat(2) to see if the modification time of /etc/resolv.conf has changed. If so, reload the file and reinitialize the resolver library. However, only call stat(2) if at least two seconds have passed since the last call to stat(2), since calling it on every query could kill performance. This new behavior is enabled by default. Add a "reload-period" option to disable it or change the period of the test. Document this behavior and option in resolv.conf(5). Polish the man page just enough to appease igor. Relnotes: yes Sponsored by: Dell Inc. Modified: stable/10/lib/libc/resolv/res_init.c stable/10/lib/libc/resolv/res_private.h stable/10/lib/libc/resolv/res_state.c stable/10/share/man/man5/resolver.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_init.c ============================================================================== --- stable/10/lib/libc/resolv/res_init.c Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/lib/libc/resolv/res_init.c Sat Dec 19 02:41:31 2015 (r292462) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -238,6 +239,7 @@ __res_vinit(res_state statp, int preinit statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr; strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa"); strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int"); + statp->_u._ext.ext->reload_period = 2; } else { /* * Historically res_init() rarely, if at all, failed. @@ -323,6 +325,18 @@ __res_vinit(res_state statp, int preinit nserv = 0; if ((fp = fopen(_PATH_RESCONF, "re")) != NULL) { + struct stat sb; + struct timespec now; + + if (statp->_u._ext.ext != NULL) { + if (_fstat(fileno(fp), &sb) == 0) { + statp->_u._ext.ext->conf_mtim = sb.st_mtim; + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) == 0) { + statp->_u._ext.ext->conf_stat = now.tv_sec; + } + } + } + /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { /* skip comments */ @@ -583,9 +597,7 @@ res_setoptions(res_state statp, const ch { const char *cp = options; int i; -#ifndef _LIBC struct __res_state_ext *ext = statp->_u._ext.ext; -#endif #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -668,6 +680,12 @@ res_setoptions(res_state statp, const ch } else if (!strncmp(cp, "no-check-names", sizeof("no-check-names") - 1)) { statp->options |= RES_NOCHECKNAME; + } else if (!strncmp(cp, "reload-period:", + sizeof("reload-period:") - 1)) { + if (ext != NULL) { + ext->reload_period = (u_short) + atoi(cp + sizeof("reload-period:") - 1); + } } #ifdef RES_USE_EDNS0 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { Modified: stable/10/lib/libc/resolv/res_private.h ============================================================================== --- stable/10/lib/libc/resolv/res_private.h Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/lib/libc/resolv/res_private.h Sat Dec 19 02:41:31 2015 (r292462) @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + #ifndef res_private_h #define res_private_h @@ -12,6 +14,9 @@ struct __res_state_ext { } sort_list[MAXRESOLVSORT]; char nsuffix[64]; char nsuffix2[64]; + struct timespec conf_mtim; /* mod time of loaded resolv.conf */ + time_t conf_stat; /* time of last stat(resolv.conf) */ + u_short reload_period; /* seconds between stat(resolv.conf) */ }; extern int Modified: stable/10/lib/libc/resolv/res_state.c ============================================================================== --- stable/10/lib/libc/resolv/res_state.c Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/lib/libc/resolv/res_state.c Sat Dec 19 02:41:31 2015 (r292462) @@ -26,6 +26,8 @@ */ #include +#include +#include #include #include #include @@ -35,6 +37,8 @@ #include "reentrant.h" #include "un-namespace.h" +#include "res_private.h" + #undef _res struct __res_state _res; @@ -59,13 +63,44 @@ res_keycreate(void) res_thr_keycreated = thr_keycreate(&res_key, free_res) == 0; } +static res_state +res_check_reload(res_state statp) +{ + struct timespec now; + struct stat sb; + struct __res_state_ext *ext; + + if ((statp->options & RES_INIT) == 0) { + return (statp); + } + + ext = statp->_u._ext.ext; + if (ext == NULL || ext->reload_period == 0) { + return (statp); + } + + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) != 0 || + (now.tv_sec - ext->conf_stat) < ext->reload_period) { + return (statp); + } + + ext->conf_stat = now.tv_sec; + if (stat(_PATH_RESCONF, &sb) == 0 && + (sb.st_mtim.tv_sec != ext->conf_mtim.tv_sec || + sb.st_mtim.tv_nsec != ext->conf_mtim.tv_nsec)) { + statp->options &= ~RES_INIT; + } + + return (statp); +} + res_state __res_state(void) { res_state statp; if (thr_main() != 0) - return (&_res); + return res_check_reload(&_res); if (thr_once(&res_init_once, res_keycreate) != 0 || !res_thr_keycreated) @@ -73,7 +108,7 @@ __res_state(void) statp = thr_getspecific(res_key); if (statp != NULL) - return (statp); + return res_check_reload(statp); statp = calloc(1, sizeof(*statp)); if (statp == NULL) return (&_res); Modified: stable/10/share/man/man5/resolver.5 ============================================================================== --- stable/10/share/man/man5/resolver.5 Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/share/man/man5/resolver.5 Sat Dec 19 02:41:31 2015 (r292462) @@ -32,7 +32,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd October 12, 2015 .Dt RESOLVER 5 .Os .Sh NAME @@ -179,6 +179,19 @@ the resolver from obeying the standard and .Sy search rules with the given name. +.It Sy reload-period: Ns Ar n +The resolver checks the modification time of +.Pa /etc/resolv.conf +every +.Ar n +seconds. +If +.Pa /etc/resolv.conf +has changed, it is automatically reloaded. +The default for +.Ar n +is two seconds. +Setting it to zero disables the file check. .El .Pp Options may also be specified as a space or tab separated list using the @@ -195,8 +208,7 @@ If more than one instance of these keywo the last instance will override. .Pp The keyword and value must appear on a single line, and the keyword -(e.g.\& -.Sy nameserver ) +.Pq for example, Sy nameserver must start the line. The value follows the keyword, separated by white space. .Sh FILES From owner-svn-src-all@freebsd.org Sat Dec 19 02:47:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CB6CA4CD8A; Sat, 19 Dec 2015 02:47:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E256B1967; Sat, 19 Dec 2015 02:47:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2l6Sp026072; Sat, 19 Dec 2015 02:47:06 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2l6Ot026071; Sat, 19 Dec 2015 02:47:06 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512190247.tBJ2l6Ot026071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 19 Dec 2015 02:47: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: r292463 - stable/9/lib/libc/resolv 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 02:47:07 -0000 Author: vangyzen Date: Sat Dec 19 02:47:05 2015 New Revision: 292463 URL: https://svnweb.freebsd.org/changeset/base/292463 Log: MFC r289837 resolver: abuse _res a little less In the past, _res was a global variable. Now, it's multiple function calls. Several functions in the resolver use _res multiple times and therefore call the function(s) far more than necessary. Fix those callers to store the result of _res in a local variable. Add __noinline to the definition of res_init() to avoid the code bloat that these changes would have otherwise incurred. Thanks to jilles for noticing this. Sponsored by: Dell Inc. Modified: stable/9/lib/libc/resolv/res_data.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/resolv/res_data.c ============================================================================== --- stable/9/lib/libc/resolv/res_data.c Sat Dec 19 02:41:31 2015 (r292462) +++ stable/9/lib/libc/resolv/res_data.c Sat Dec 19 02:47:05 2015 (r292463) @@ -77,9 +77,10 @@ const char *_res_sectioncodes[] = { int res_ourserver_p(const res_state, const struct sockaddr_in *); -int +__noinline int res_init(void) { extern int __res_vinit(res_state, int); + res_state statp = &_res; /* * These three fields used to be statically initialized. This made @@ -100,14 +101,14 @@ res_init(void) { * set in RES_DEFAULT). Our solution is to declare such applications * "broken". They could fool us by setting RES_INIT but none do (yet). */ - if (!_res.retrans) - _res.retrans = RES_TIMEOUT; - if (!_res.retry) - _res.retry = RES_DFLRETRY; - if (!(_res.options & RES_INIT)) - _res.options = RES_DEFAULT; + if (!statp->retrans) + statp->retrans = RES_TIMEOUT; + if (!statp->retry) + statp->retry = RES_DFLRETRY; + if (!(statp->options & RES_INIT)) + statp->options = RES_DEFAULT; - return (__res_vinit(&_res, 1)); + return (__res_vinit(statp, 1)); } void @@ -122,10 +123,11 @@ fp_query(const u_char *msg, FILE *file) void fp_nquery(const u_char *msg, int len, FILE *file) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) return; - res_pquery(&_res, msg, len, file); + res_pquery(statp, msg, len, file); } int @@ -138,23 +140,25 @@ res_mkquery(int op, /*!< opcode of que u_char *buf, /*!< buffer to put query */ int buflen) /*!< size of buffer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nmkquery(&_res, op, dname, class, type, + return (res_nmkquery(statp, op, dname, class, type, data, datalen, newrr_in, buf, buflen)); } int res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nmkupdate(&_res, rrecp_in, buf, buflen)); + return (res_nmkupdate(statp, rrecp_in, buf, buflen)); } int @@ -163,11 +167,12 @@ res_query(const char *name, /*!< domain u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer buffer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nquery(&_res, name, class, type, answer, anslen)); + return (res_nquery(statp, name, class, type, answer, anslen)); } #ifndef _LIBC @@ -189,12 +194,13 @@ res_isourserver(const struct sockaddr_in int res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { /* errno should have been set by res_init() in this case. */ return (-1); } - return (res_nsend(&_res, buf, buflen, ans, anssiz)); + return (res_nsend(statp, buf, buflen, ans, anssiz)); } #ifndef _LIBC @@ -202,12 +208,13 @@ int res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key, u_char *ans, int anssiz) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { /* errno should have been set by res_init() in this case. */ return (-1); } - return (res_nsendsigned(&_res, buf, buflen, key, ans, anssiz)); + return (res_nsendsigned(statp, buf, buflen, key, ans, anssiz)); } #endif @@ -218,12 +225,13 @@ res_close(void) { int res_update(ns_updrec *rrecp_in) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nupdate(&_res, rrecp_in, NULL)); + return (res_nupdate(statp, rrecp_in, NULL)); } int @@ -232,12 +240,13 @@ res_search(const char *name, /*!< domain u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nsearch(&_res, name, class, type, answer, anslen)); + return (res_nsearch(statp, name, class, type, answer, anslen)); } int @@ -247,24 +256,26 @@ res_querydomain(const char *name, u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nquerydomain(&_res, name, domain, + return (res_nquerydomain(statp, name, domain, class, type, answer, anslen)); } u_int res_randomid(void) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nrandomid(&_res)); + return (res_nrandomid(statp)); } int @@ -284,13 +295,15 @@ hostalias(const char *name) { int local_hostname_length(const char *hostname) { int len_host, len_domain; + res_state statp; - if (!*_res.defdname) + statp = &_res; + if (!*statp->defdname) res_init(); len_host = strlen(hostname); - len_domain = strlen(_res.defdname); + len_domain = strlen(statp->defdname); if (len_host > len_domain && - !strcasecmp(hostname + len_host - len_domain, _res.defdname) && + !strcasecmp(hostname + len_host - len_domain, statp->defdname) && hostname[len_host - len_domain - 1] == '.') return (len_host - len_domain - 1); return (0); From owner-svn-src-all@freebsd.org Sat Dec 19 02:50:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 132DFA4CF36; Sat, 19 Dec 2015 02:50:01 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C824C1AE6; Sat, 19 Dec 2015 02:50:00 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2nxwS026234; Sat, 19 Dec 2015 02:49:59 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2nx27026231; Sat, 19 Dec 2015 02:49:59 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512190249.tBJ2nx27026231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 19 Dec 2015 02:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292464 - stable/9/lib/libc/resolv 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 02:50:01 -0000 Author: vangyzen Date: Sat Dec 19 02:49:59 2015 New Revision: 292464 URL: https://svnweb.freebsd.org/changeset/base/292464 Log: MFC r289315,r292216 resolver: automatically reload /etc/resolv.conf On each resolver query, use stat(2) to see if the modification time of /etc/resolv.conf has changed. If so, reload the file and reinitialize the resolver library. However, only call stat(2) if at least two seconds have passed since the last call to stat(2), since calling it on every query could kill performance. This new behavior is enabled by default. Add a "reload-period" option to disable it or change the period of the test. Document this behavior and option in resolv.conf(5). Polish the man page just enough to appease igor. Relnotes: yes Sponsored by: Dell Inc. Modified: stable/9/lib/libc/resolv/res_init.c stable/9/lib/libc/resolv/res_private.h stable/9/lib/libc/resolv/res_state.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/resolv/res_init.c ============================================================================== --- stable/9/lib/libc/resolv/res_init.c Sat Dec 19 02:47:05 2015 (r292463) +++ stable/9/lib/libc/resolv/res_init.c Sat Dec 19 02:49:59 2015 (r292464) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -238,6 +239,7 @@ __res_vinit(res_state statp, int preinit statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr; strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa"); strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int"); + statp->_u._ext.ext->reload_period = 2; } else { /* * Historically res_init() rarely, if at all, failed. @@ -323,6 +325,18 @@ __res_vinit(res_state statp, int preinit nserv = 0; if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) { + struct stat sb; + struct timespec now; + + if (statp->_u._ext.ext != NULL) { + if (_fstat(fileno(fp), &sb) == 0) { + statp->_u._ext.ext->conf_mtim = sb.st_mtim; + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) == 0) { + statp->_u._ext.ext->conf_stat = now.tv_sec; + } + } + } + /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { /* skip comments */ @@ -583,9 +597,7 @@ res_setoptions(res_state statp, const ch { const char *cp = options; int i; -#ifndef _LIBC struct __res_state_ext *ext = statp->_u._ext.ext; -#endif #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -668,6 +680,12 @@ res_setoptions(res_state statp, const ch } else if (!strncmp(cp, "no-check-names", sizeof("no-check-names") - 1)) { statp->options |= RES_NOCHECKNAME; + } else if (!strncmp(cp, "reload-period:", + sizeof("reload-period:") - 1)) { + if (ext != NULL) { + ext->reload_period = (u_short) + atoi(cp + sizeof("reload-period:") - 1); + } } #ifdef RES_USE_EDNS0 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { Modified: stable/9/lib/libc/resolv/res_private.h ============================================================================== --- stable/9/lib/libc/resolv/res_private.h Sat Dec 19 02:47:05 2015 (r292463) +++ stable/9/lib/libc/resolv/res_private.h Sat Dec 19 02:49:59 2015 (r292464) @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + #ifndef res_private_h #define res_private_h @@ -12,6 +14,9 @@ struct __res_state_ext { } sort_list[MAXRESOLVSORT]; char nsuffix[64]; char nsuffix2[64]; + struct timespec conf_mtim; /* mod time of loaded resolv.conf */ + time_t conf_stat; /* time of last stat(resolv.conf) */ + u_short reload_period; /* seconds between stat(resolv.conf) */ }; extern int Modified: stable/9/lib/libc/resolv/res_state.c ============================================================================== --- stable/9/lib/libc/resolv/res_state.c Sat Dec 19 02:47:05 2015 (r292463) +++ stable/9/lib/libc/resolv/res_state.c Sat Dec 19 02:49:59 2015 (r292464) @@ -26,6 +26,8 @@ */ #include +#include +#include #include #include #include @@ -35,6 +37,8 @@ #include "reentrant.h" #include "un-namespace.h" +#include "res_private.h" + #undef _res struct __res_state _res; @@ -59,13 +63,44 @@ res_keycreate(void) res_thr_keycreated = thr_keycreate(&res_key, free_res) == 0; } +static res_state +res_check_reload(res_state statp) +{ + struct timespec now; + struct stat sb; + struct __res_state_ext *ext; + + if ((statp->options & RES_INIT) == 0) { + return (statp); + } + + ext = statp->_u._ext.ext; + if (ext == NULL || ext->reload_period == 0) { + return (statp); + } + + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) != 0 || + (now.tv_sec - ext->conf_stat) < ext->reload_period) { + return (statp); + } + + ext->conf_stat = now.tv_sec; + if (stat(_PATH_RESCONF, &sb) == 0 && + (sb.st_mtim.tv_sec != ext->conf_mtim.tv_sec || + sb.st_mtim.tv_nsec != ext->conf_mtim.tv_nsec)) { + statp->options &= ~RES_INIT; + } + + return (statp); +} + res_state __res_state(void) { res_state statp; if (thr_main() != 0) - return (&_res); + return res_check_reload(&_res); if (thr_once(&res_init_once, res_keycreate) != 0 || !res_thr_keycreated) @@ -73,7 +108,7 @@ __res_state(void) statp = thr_getspecific(res_key); if (statp != NULL) - return (statp); + return res_check_reload(statp); statp = calloc(1, sizeof(*statp)); if (statp == NULL) return (&_res); From owner-svn-src-all@freebsd.org Sat Dec 19 09:18:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74541A4CC51; Sat, 19 Dec 2015 09:18:02 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45A8915C4; Sat, 19 Dec 2015 09:18:02 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ9I1LO044601; Sat, 19 Dec 2015 09:18:01 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ9I13P044600; Sat, 19 Dec 2015 09:18:01 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512190918.tBJ9I13P044600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sat, 19 Dec 2015 09:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292465 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 09:18:02 -0000 Author: ume Date: Sat Dec 19 09:18:01 2015 New Revision: 292465 URL: https://svnweb.freebsd.org/changeset/base/292465 Log: Fix indent after r292333. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Sat Dec 19 02:49:59 2015 (r292464) +++ head/usr.sbin/ndp/ndp.c Sat Dec 19 09:18:01 2015 (r292465) @@ -686,31 +686,31 @@ again:; switch (rtm->rtm_rmx.rmx_state) { case ND6_LLINFO_NOSTATE: - printf(" N"); - break; + printf(" N"); + break; #ifdef ND6_LLINFO_WAITDELETE case ND6_LLINFO_WAITDELETE: - printf(" W"); - break; + printf(" W"); + break; #endif case ND6_LLINFO_INCOMPLETE: - printf(" I"); - break; + printf(" I"); + break; case ND6_LLINFO_REACHABLE: - printf(" R"); - break; + printf(" R"); + break; case ND6_LLINFO_STALE: - printf(" S"); - break; + printf(" S"); + break; case ND6_LLINFO_DELAY: - printf(" D"); - break; + printf(" D"); + break; case ND6_LLINFO_PROBE: - printf(" P"); - break; + printf(" P"); + break; default: - printf(" ?"); - break; + printf(" ?"); + break; } isrouter = rtm->rtm_flags & RTF_GATEWAY; From owner-svn-src-all@freebsd.org Sat Dec 19 12:26:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD53A4B44D; Sat, 19 Dec 2015 12:26:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A6B91D18; Sat, 19 Dec 2015 12:26:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJCQ1js000551; Sat, 19 Dec 2015 12:26:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJCQ1N2000549; Sat, 19 Dec 2015 12:26:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512191226.tBJCQ1N2000549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Dec 2015 12:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292466 - in head: share/ctypedef tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 12:26:02 -0000 Author: bapt Date: Sat Dec 19 12:26:01 2015 New Revision: 292466 URL: https://svnweb.freebsd.org/changeset/base/292466 Log: Use :E instead of regex in ctypedef Makefiles Modified: head/share/ctypedef/Makefile head/tools/tools/locale/tools/cldr2def.pl Modified: head/share/ctypedef/Makefile ============================================================================== --- head/share/ctypedef/Makefile Sat Dec 19 09:18:01 2015 (r292465) +++ head/share/ctypedef/Makefile Sat Dec 19 12:26:01 2015 (r292466) @@ -9,7 +9,7 @@ MAPLOC= ${.CURDIR}/../../tools/tools/lo .src.LC_CTYPE: localedef -D -U -c -w ${MAPLOC}/widths.txt \ - -f ${MAPLOC}/map.${.IMPSRC:T:R:C/^.*\.//} \ + -f ${MAPLOC}/map.${.IMPSRC:T:R:E} \ -i ${.IMPSRC} ${.OBJDIR}/${.IMPSRC:T:R} || true LOCALES+= be_BY.CP1131 Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sat Dec 19 09:18:01 2015 (r292465) +++ head/tools/tools/locale/tools/cldr2def.pl Sat Dec 19 12:26:01 2015 (r292466) @@ -808,7 +808,7 @@ sub make_makefile { } elsif ($TYPE eq "ctypedef") { $SRCOUT = "localedef -D -U -c -w \${MAPLOC}/widths.txt \\\n" . - "\t-f \${MAPLOC}/map.\${.IMPSRC:T:R:C/^.*\\.//} " . + "\t-f \${MAPLOC}/map.\${.IMPSRC:T:R:E} " . "\\\n\t-i \${.IMPSRC} \${.OBJDIR}/\${.IMPSRC:T:R} " . " || true"; $SRCOUT2 = "LC_CTYPE"; From owner-svn-src-all@freebsd.org Sat Dec 19 12:28:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF82A4B60E; Sat, 19 Dec 2015 12:28:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7401EAA; Sat, 19 Dec 2015 12:28:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJCSMuB000667; Sat, 19 Dec 2015 12:28:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJCSMd2000666; Sat, 19 Dec 2015 12:28:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512191228.tBJCSMd2000666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Dec 2015 12:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292467 - head/tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 12:28:24 -0000 Author: bapt Date: Sat Dec 19 12:28:22 2015 New Revision: 292467 URL: https://svnweb.freebsd.org/changeset/base/292467 Log: Initialize SRCOUT3 as it may be used unitilizard for certains types of locales Modified: head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sat Dec 19 12:26:01 2015 (r292466) +++ head/tools/tools/locale/tools/cldr2def.pl Sat Dec 19 12:28:22 2015 (r292467) @@ -796,7 +796,7 @@ sub make_makefile { print "Creating Makefile for $TYPE\n"; my $SRCOUT; my $SRCOUT2; - my $SRCOUT3; + my $SRCOUT3 = ""; my $MAPLOC; if ($TYPE eq "colldef") { $SRCOUT = "localedef -D -U -i \${.IMPSRC} \\\n" . From owner-svn-src-all@freebsd.org Sat Dec 19 13:19:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8612A4C92E; Sat, 19 Dec 2015 13:19:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A184115F7; Sat, 19 Dec 2015 13:19:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJDJdqb015300; Sat, 19 Dec 2015 13:19:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJDJdlw015299; Sat, 19 Dec 2015 13:19:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512191319.tBJDJdlw015299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Dec 2015 13:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292468 - head/tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 13:19:41 -0000 Author: bapt Date: Sat Dec 19 13:19:39 2015 New Revision: 292468 URL: https://svnweb.freebsd.org/changeset/base/292468 Log: Fix indentation to make the script more readable Modified: head/tools/tools/locale/tools/finalize Modified: head/tools/tools/locale/tools/finalize ============================================================================== --- head/tools/tools/locale/tools/finalize Sat Dec 19 12:28:22 2015 (r292467) +++ head/tools/tools/locale/tools/finalize Sat Dec 19 13:19:39 2015 (r292468) @@ -10,9 +10,9 @@ usage () { - echo "finalize ' to package standard localization" - echo "type must be one of { monetdef, msgdef, numericdef, timedef, colldef, ctypedef }" - exit 1 + echo "finalize ' to package standard localization" + echo "type must be one of { monetdef, msgdef, numericdef, timedef, colldef, ctypedef }" + exit 1 } [ $# -ne 1 ] && usage @@ -38,48 +38,48 @@ grep '^LOCALES+' ${old}/Makefile > ${TEM if [ $1 = "ctypedef" ] then -keep=$(cat ${TEMP} | awk '{ print $2 ".src" }') -(cd ${old} && md5 -r ${keep} | sort) > ${TEMP2} -keep=$(awk '{ if ($1 != last1) print $2; last1 = $1; }' ${TEMP2}) -for original in ${keep} -do - cp ${old}/${original} ${new}/ -done -awk '{ if ($1 == last1) { print "SYMPAIRS+=\t" last2 " " $2 } \ -else {last1 = $1; last2 = $2}}' ${TEMP2} > ${TEMP3} -rm -f ${TEMP2} + keep=$(cat ${TEMP} | awk '{ print $2 ".src" }') + (cd ${old} && md5 -r ${keep} | sort) > ${TEMP2} + keep=$(awk '{ if ($1 != last1) print $2; last1 = $1; }' ${TEMP2}) + for original in ${keep} + do + cp ${old}/${original} ${new}/ + done + awk '{ if ($1 == last1) { print "SYMPAIRS+=\t" last2 " " $2 } \ + else {last1 = $1; last2 = $2}}' ${TEMP2} > ${TEMP3} + rm -f ${TEMP2} /usr/bin/sed -E -e 's/[ ]+/ /g' \ ${CLDRDIR}/posix/UTF-8.cm \ > ${base}/../etc/final-maps/map.UTF-8 -CHARMAPS="ARMSCII-8 Big5 Big5HKSCS CP1131 CP1251 \ - CP866 GB2312 GBK ISCII-DEV ISO8859-1 \ - ISO8859-13 ISO8859-15 ISO8859-2 ISO8859-4 \ - ISO8859-5 ISO8859-7 ISO8859-9 KOI8-R KOI8-U \ - PT154 SJIS US-ASCII eucCN eucJP eucKR" - -# GB18030 blows up, use pre-generate Illumos version - -for map in ${CHARMAPS} -do -encoding=${map} -if [ ${map} = "Big5HKSCS" ] -then -encoding="Big5" -fi -/usr/local/bin/perl ${base}/convert_map.pl \ - ${base}/../etc/charmaps/${map}.TXT ${encoding} \ - | /usr/bin/sed -E -e 's/ +/ /g' \ - > ${base}/../etc/final-maps/map.${map} - echo map ${map} converted. -done + CHARMAPS="ARMSCII-8 Big5 Big5HKSCS CP1131 CP1251 \ + CP866 GB2312 GBK ISCII-DEV ISO8859-1 \ + ISO8859-13 ISO8859-15 ISO8859-2 ISO8859-4 \ + ISO8859-5 ISO8859-7 ISO8859-9 KOI8-R KOI8-U \ + PT154 SJIS US-ASCII eucCN eucJP eucKR" + + # GB18030 blows up, use pre-generate Illumos version + + for map in ${CHARMAPS} + do + encoding=${map} + if [ ${map} = "Big5HKSCS" ] + then + encoding="Big5" + fi + /usr/local/bin/perl ${base}/convert_map.pl \ + ${base}/../etc/charmaps/${map}.TXT ${encoding} \ + | /usr/bin/sed -E -e 's/ +/ /g' \ + > ${base}/../etc/final-maps/map.${map} + echo map ${map} converted. + done else # below is everything but ctypedef -keep=$(cat ${TEMP} | awk '{ print $2 }') -for original in ${keep} -do - cp ${old}/${original}.src ${new}/ -done + keep=$(cat ${TEMP} | awk '{ print $2 }') + for original in ${keep} + do + cp ${old}/${original}.src ${new}/ + done fi From owner-svn-src-all@freebsd.org Sat Dec 19 18:42:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABC30A4BDA7; Sat, 19 Dec 2015 18:42:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E3E81E9D; Sat, 19 Dec 2015 18:42:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJIgpXL010550; Sat, 19 Dec 2015 18:42:51 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJIgohI010539; Sat, 19 Dec 2015 18:42:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201512191842.tBJIgohI010539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 19 Dec 2015 18:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 18:42:52 -0000 Author: alc Date: Sat Dec 19 18:42:50 2015 New Revision: 292469 URL: https://svnweb.freebsd.org/changeset/base/292469 Log: Introduce a new mechanism for relocating virtual pages to a new physical address and use this mechanism when: 1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical memory allocator's free page lists. This replaces the long-standing approach of scanning the inactive and inactive queues, converting clean pages into PG_CACHED pages and laundering dirty pages. In contrast, the new mechanism does not use PG_CACHED pages nor does it trigger a large number of I/O operations. 2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find free pages in the physical memory allocator's free page lists that are covered by the direct map. Tested by: adrian 3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable free pages in the physical memory allocator's free page lists. In the coming months, I expect that this new mechanism will be applied in other places. For example, balloon drivers should use relocation to minimize fragmentation of the guest physical address space. Make vm_phys_alloc_contig() a little smarter (and more efficient in some cases). Specifically, use vm_phys_segs[] earlier to avoid scanning free page lists that can't possibly contain suitable pages. Reviewed by: kib, markj Glanced at: jhb Discussed with: jeff Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4444 Modified: head/sys/dev/drm2/ttm/ttm_bo.c head/sys/dev/drm2/ttm/ttm_page_alloc.c head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c head/sys/mips/mips/uma_machdep.c head/sys/vm/vm_kern.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h Modified: head/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/dev/drm2/ttm/ttm_bo.c Sat Dec 19 18:42:50 2015 (r292469) @@ -1488,21 +1488,21 @@ int ttm_bo_global_init(struct drm_global struct ttm_bo_global_ref *bo_ref = container_of(ref, struct ttm_bo_global_ref, ref); struct ttm_bo_global *glob = ref->object; - int ret; + int req, ret; int tries; sx_init(&glob->device_list_mutex, "ttmdlm"); mtx_init(&glob->lru_lock, "ttmlru", NULL, MTX_DEF); glob->mem_glob = bo_ref->mem_glob; + req = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ; tries = 0; retry: - glob->dummy_read_page = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ, + glob->dummy_read_page = vm_page_alloc_contig(NULL, 0, req, 1, 0, VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); if (unlikely(glob->dummy_read_page == NULL)) { - if (tries < 1) { - vm_pageout_grow_cache(tries, 0, VM_MAX_ADDRESS); + if (tries < 1 && vm_page_reclaim_contig(req, 1, + 0, VM_MAX_ADDRESS, PAGE_SIZE, 0)) { tries++; goto retry; } Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_page_alloc.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/dev/drm2/ttm/ttm_page_alloc.c Sat Dec 19 18:42:50 2015 (r292469) @@ -166,13 +166,9 @@ ttm_vm_page_alloc_dma32(int req, vm_mema PAGE_SIZE, 0, memattr); if (p != NULL || tries > 2) return (p); - - /* - * Before growing the cache see if this is just a normal - * memory shortage. - */ - VM_WAIT; - vm_pageout_grow_cache(tries, 0, 0xffffffff); + if (!vm_page_reclaim_contig(req, 1, 0, 0xffffffff, + PAGE_SIZE, 0)) + VM_WAIT; } } Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/mips/include/pmap.h Sat Dec 19 18:42:50 2015 (r292469) @@ -178,7 +178,6 @@ void *pmap_kenter_temporary(vm_paddr_t p void pmap_kenter_temporary_free(vm_paddr_t pa); void pmap_flush_pvcache(vm_page_t m); int pmap_emulate_modified(pmap_t pmap, vm_offset_t va); -void pmap_grow_direct_page_cache(void); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); #endif /* _KERNEL */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/mips/mips/pmap.c Sat Dec 19 18:42:50 2015 (r292469) @@ -166,6 +166,7 @@ static pv_entry_t pmap_pvh_remove(struct static vm_page_t pmap_alloc_direct_page(unsigned int index, int req); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte); +static void pmap_grow_direct_page(int req); static int pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va, pd_entry_t pde); static void pmap_remove_page(struct pmap *pmap, vm_offset_t va); @@ -1040,14 +1041,16 @@ pmap_pinit0(pmap_t pmap) bzero(&pmap->pm_stats, sizeof pmap->pm_stats); } -void -pmap_grow_direct_page_cache() +static void +pmap_grow_direct_page(int req) { #ifdef __mips_n64 VM_WAIT; #else - vm_pageout_grow_cache(3, 0, MIPS_KSEG0_LARGEST_PHYS); + if (!vm_page_reclaim_contig(req, 1, 0, MIPS_KSEG0_LARGEST_PHYS, + PAGE_SIZE, 0)) + VM_WAIT; #endif } @@ -1077,13 +1080,15 @@ pmap_pinit(pmap_t pmap) { vm_offset_t ptdva; vm_page_t ptdpg; - int i; + int i, req_class; /* * allocate the page directory page */ - while ((ptdpg = pmap_alloc_direct_page(NUSERPGTBLS, VM_ALLOC_NORMAL)) == NULL) - pmap_grow_direct_page_cache(); + req_class = VM_ALLOC_NORMAL; + while ((ptdpg = pmap_alloc_direct_page(NUSERPGTBLS, req_class)) == + NULL) + pmap_grow_direct_page(req_class); ptdva = MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(ptdpg)); pmap->pm_segtab = (pd_entry_t *)ptdva; @@ -1107,15 +1112,17 @@ _pmap_allocpte(pmap_t pmap, unsigned pte { vm_offset_t pageva; vm_page_t m; + int req_class; /* * Find or fabricate a new pagetable page */ - if ((m = pmap_alloc_direct_page(ptepindex, VM_ALLOC_NORMAL)) == NULL) { + req_class = VM_ALLOC_NORMAL; + if ((m = pmap_alloc_direct_page(ptepindex, req_class)) == NULL) { if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); - pmap_grow_direct_page_cache(); + pmap_grow_direct_page(req_class); rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -1241,9 +1248,10 @@ pmap_growkernel(vm_offset_t addr) vm_page_t nkpg; pd_entry_t *pde, *pdpe; pt_entry_t *pte; - int i; + int i, req_class; mtx_assert(&kernel_map->system_mtx, MA_OWNED); + req_class = VM_ALLOC_INTERRUPT; addr = roundup2(addr, NBSEG); if (addr - 1 >= kernel_map->max_offset) addr = kernel_map->max_offset; @@ -1252,7 +1260,7 @@ pmap_growkernel(vm_offset_t addr) #ifdef __mips_n64 if (*pdpe == 0) { /* new intermediate page table entry */ - nkpg = pmap_alloc_direct_page(nkpt, VM_ALLOC_INTERRUPT); + nkpg = pmap_alloc_direct_page(nkpt, req_class); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); *pdpe = (pd_entry_t)MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(nkpg)); @@ -1272,8 +1280,13 @@ pmap_growkernel(vm_offset_t addr) /* * This index is bogus, but out of the way */ - nkpg = pmap_alloc_direct_page(nkpt, VM_ALLOC_INTERRUPT); - if (!nkpg) + nkpg = pmap_alloc_direct_page(nkpt, req_class); +#ifndef __mips_n64 + if (nkpg == NULL && vm_page_reclaim_contig(req_class, 1, + 0, MIPS_KSEG0_LARGEST_PHYS, PAGE_SIZE, 0)) + nkpg = pmap_alloc_direct_page(nkpt, req_class); +#endif + if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); nkpt++; *pde = (pd_entry_t)MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(nkpg)); Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/mips/mips/uma_machdep.c Sat Dec 19 18:42:50 2015 (r292469) @@ -53,11 +53,16 @@ uma_small_alloc(uma_zone_t zone, vm_size for (;;) { m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, pflags); +#ifndef __mips_n64 + if (m == NULL && vm_page_reclaim_contig(pflags, 1, + 0, MIPS_KSEG0_LARGEST_PHYS, PAGE_SIZE, 0)) + continue; +#endif if (m == NULL) { if (wait & M_NOWAIT) return (NULL); else - pmap_grow_direct_page_cache(); + VM_WAIT; } else break; } Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/vm/vm_kern.c Sat Dec 19 18:42:50 2015 (r292469) @@ -181,7 +181,10 @@ retry: if (m == NULL) { VM_OBJECT_WUNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - vm_pageout_grow_cache(tries, low, high); + if (!vm_page_reclaim_contig(pflags, 1, + low, high, PAGE_SIZE, 0) && + (flags & M_WAITOK) != 0) + VM_WAIT; VM_OBJECT_WLOCK(object); tries++; goto retry; @@ -217,6 +220,7 @@ kmem_alloc_contig(struct vmem *vmem, vm_ vm_offset_t addr, tmp; vm_ooffset_t offset; vm_page_t end_m, m; + u_long npages; int pflags, tries; size = round_page(size); @@ -224,15 +228,18 @@ kmem_alloc_contig(struct vmem *vmem, vm_ return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + npages = atop(size); VM_OBJECT_WLOCK(object); tries = 0; retry: m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, - atop(size), low, high, alignment, boundary, memattr); + npages, low, high, alignment, boundary, memattr); if (m == NULL) { VM_OBJECT_WUNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - vm_pageout_grow_cache(tries, low, high); + if (!vm_page_reclaim_contig(pflags, npages, low, high, + alignment, boundary) && (flags & M_WAITOK) != 0) + VM_WAIT; VM_OBJECT_WLOCK(object); tries++; goto retry; @@ -240,7 +247,7 @@ retry: vmem_free(vmem, addr, size); return (0); } - end_m = m + atop(size); + end_m = m + npages; tmp = addr; for (; m < end_m; m++) { if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/vm/vm_page.c Sat Dec 19 18:42:50 2015 (r292469) @@ -158,11 +158,14 @@ static struct vnode *vm_page_alloc_init( static void vm_page_cache_turn_free(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); static void vm_page_enqueue(uint8_t queue, vm_page_t m); +static void vm_page_free_wakeup(void); static void vm_page_init_fakepg(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object, vm_page_t mpred); +static int vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, + vm_paddr_t high); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init_fakepg, NULL); @@ -2093,6 +2096,592 @@ vm_page_alloc_freelist(int flind, int re return (m); } +#define VPSC_ANY 0 /* No restrictions. */ +#define VPSC_NORESERV 1 /* Skip reservations; implies VPSC_NOSUPER. */ +#define VPSC_NOSUPER 2 /* Skip superpages. */ + +/* + * vm_page_scan_contig: + * + * Scan vm_page_array[] between the specified entries "m_start" and + * "m_end" for a run of contiguous physical pages that satisfy the + * specified conditions, and return the lowest page in the run. The + * specified "alignment" determines the alignment of the lowest physical + * page in the run. If the specified "boundary" is non-zero, then the + * run of physical pages cannot span a physical address that is a + * multiple of "boundary". + * + * "m_end" is never dereferenced, so it need not point to a vm_page + * structure within vm_page_array[]. + * + * "npages" must be greater than zero. "m_start" and "m_end" must not + * span a hole (or discontiguity) in the physical address space. Both + * "alignment" and "boundary" must be a power of two. + */ +vm_page_t +vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end, + u_long alignment, vm_paddr_t boundary, int options) +{ + struct mtx *m_mtx, *new_mtx; + vm_object_t object; + vm_paddr_t pa; + vm_page_t m, m_run; +#if VM_NRESERVLEVEL > 0 + int level; +#endif + int m_inc, order, run_ext, run_len; + + KASSERT(npages > 0, ("npages is 0")); + KASSERT(powerof2(alignment), ("alignment is not a power of 2")); + KASSERT(powerof2(boundary), ("boundary is not a power of 2")); + m_run = NULL; + run_len = 0; + m_mtx = NULL; + for (m = m_start; m < m_end && run_len < npages; m += m_inc) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_MARKER)) == 0, + ("page %p is PG_FICTITIOUS or PG_MARKER", m)); + + /* + * If the current page would be the start of a run, check its + * physical address against the end, alignment, and boundary + * conditions. If it doesn't satisfy these conditions, either + * terminate the scan or advance to the next page that + * satisfies the failed condition. + */ + if (run_len == 0) { + KASSERT(m_run == NULL, ("m_run != NULL")); + if (m + npages > m_end) + break; + pa = VM_PAGE_TO_PHYS(m); + if ((pa & (alignment - 1)) != 0) { + m_inc = atop(roundup2(pa, alignment) - pa); + continue; + } + if (((pa ^ (pa + ptoa(npages) - 1)) & ~(boundary - + 1)) != 0) { + m_inc = atop(roundup2(pa, boundary) - pa); + continue; + } + } else + KASSERT(m_run != NULL, ("m_run == NULL")); + + /* + * Avoid releasing and reacquiring the same page lock. + */ + new_mtx = vm_page_lockptr(m); + if (m_mtx != new_mtx) { + if (m_mtx != NULL) + mtx_unlock(m_mtx); + m_mtx = new_mtx; + mtx_lock(m_mtx); + } + m_inc = 1; +retry: + if (m->wire_count != 0 || m->hold_count != 0) + run_ext = 0; +#if VM_NRESERVLEVEL > 0 + else if ((level = vm_reserv_level(m)) >= 0 && + (options & VPSC_NORESERV) != 0) { + run_ext = 0; + /* Advance to the end of the reservation. */ + pa = VM_PAGE_TO_PHYS(m); + m_inc = atop(roundup2(pa + 1, vm_reserv_size(level)) - + pa); + } +#endif + else if ((object = m->object) != NULL) { + /* + * The page is considered eligible for relocation if + * and only if it could be laundered or reclaimed by + * the page daemon. + */ + if (!VM_OBJECT_TRYRLOCK(object)) { + mtx_unlock(m_mtx); + VM_OBJECT_RLOCK(object); + mtx_lock(m_mtx); + if (m->object != object) { + /* + * The page may have been freed. + */ + VM_OBJECT_RUNLOCK(object); + goto retry; + } else if (m->wire_count != 0 || + m->hold_count != 0) { + run_ext = 0; + goto unlock; + } + } + KASSERT((m->flags & PG_UNHOLDFREE) == 0, + ("page %p is PG_UNHOLDFREE", m)); + /* Don't care: PG_NODUMP, PG_WINATCFLS, PG_ZERO. */ + if (object->type != OBJT_DEFAULT && + object->type != OBJT_SWAP && + object->type != OBJT_VNODE) + run_ext = 0; + else if ((m->flags & PG_CACHED) != 0 || + m != vm_page_lookup(object, m->pindex)) { + /* + * The page is cached or recently converted + * from cached to free. + */ +#if VM_NRESERVLEVEL > 0 + if (level >= 0) { + /* + * The page is reserved. Extend the + * current run by one page. + */ + run_ext = 1; + } else +#endif + if ((order = m->order) < VM_NFREEORDER) { + /* + * The page is enqueued in the + * physical memory allocator's cache/ + * free page queues. Moreover, it is + * the first page in a power-of-two- + * sized run of contiguous cache/free + * pages. Add these pages to the end + * of the current run, and jump + * ahead. + */ + run_ext = 1 << order; + m_inc = 1 << order; + } else + run_ext = 0; +#if VM_NRESERVLEVEL > 0 + } else if ((options & VPSC_NOSUPER) != 0 && + (level = vm_reserv_level_iffullpop(m)) >= 0) { + run_ext = 0; + /* Advance to the end of the superpage. */ + pa = VM_PAGE_TO_PHYS(m); + m_inc = atop(roundup2(pa + 1, + vm_reserv_size(level)) - pa); +#endif + } else if (object->memattr == VM_MEMATTR_DEFAULT && + m->queue != PQ_NONE && !vm_page_busied(m)) { + /* + * The page is allocated but eligible for + * relocation. Extend the current run by one + * page. + */ + KASSERT(pmap_page_get_memattr(m) == + VM_MEMATTR_DEFAULT, + ("page %p has an unexpected memattr", m)); + KASSERT((m->oflags & (VPO_SWAPINPROG | + VPO_SWAPSLEEP | VPO_UNMANAGED)) == 0, + ("page %p has unexpected oflags", m)); + /* Don't care: VPO_NOSYNC. */ + run_ext = 1; + } else + run_ext = 0; +unlock: + VM_OBJECT_RUNLOCK(object); +#if VM_NRESERVLEVEL > 0 + } else if (level >= 0) { + /* + * The page is reserved but not yet allocated. In + * other words, it is still cached or free. Extend + * the current run by one page. + */ + run_ext = 1; +#endif + } else if ((order = m->order) < VM_NFREEORDER) { + /* + * The page is enqueued in the physical memory + * allocator's cache/free page queues. Moreover, it + * is the first page in a power-of-two-sized run of + * contiguous cache/free pages. Add these pages to + * the end of the current run, and jump ahead. + */ + run_ext = 1 << order; + m_inc = 1 << order; + } else { + /* + * Skip the page for one of the following reasons: (1) + * It is enqueued in the physical memory allocator's + * cache/free page queues. However, it is not the + * first page in a run of contiguous cache/free pages. + * (This case rarely occurs because the scan is + * performed in ascending order.) (2) It is not + * reserved, and it is transitioning from free to + * allocated. (Conversely, the transition from + * allocated to free for managed pages is blocked by + * the page lock.) (3) It is allocated but not + * contained by an object and not wired, e.g., + * allocated by Xen's balloon driver. + */ + run_ext = 0; + } + + /* + * Extend or reset the current run of pages. + */ + if (run_ext > 0) { + if (run_len == 0) + m_run = m; + run_len += run_ext; + } else { + if (run_len > 0) { + m_run = NULL; + run_len = 0; + } + } + } + if (m_mtx != NULL) + mtx_unlock(m_mtx); + if (run_len >= npages) + return (m_run); + return (NULL); +} + +/* + * vm_page_reclaim_run: + * + * Try to relocate each of the allocated virtual pages within the + * specified run of physical pages to a new physical address. Free the + * physical pages underlying the relocated virtual pages. A virtual page + * is relocatable if and only if it could be laundered or reclaimed by + * the page daemon. Whenever possible, a virtual page is relocated to a + * physical address above "high". + * + * Returns 0 if every physical page within the run was already free or + * just freed by a successful relocation. Otherwise, returns a non-zero + * value indicating why the last attempt to relocate a virtual page was + * unsuccessful. + * + * "req_class" must be an allocation class. + */ +static int +vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, + vm_paddr_t high) +{ + struct mtx *m_mtx, *new_mtx; + struct spglist free; + vm_object_t object; + vm_paddr_t pa; + vm_page_t m, m_end, m_new; + int error, order, req; + + KASSERT((req_class & VM_ALLOC_CLASS_MASK) == req_class, + ("req_class is not an allocation class")); + SLIST_INIT(&free); + error = 0; + m = m_run; + m_end = m_run + npages; + m_mtx = NULL; + for (; error == 0 && m < m_end; m++) { + KASSERT((m->flags & (PG_FICTITIOUS | PG_MARKER)) == 0, + ("page %p is PG_FICTITIOUS or PG_MARKER", m)); + + /* + * Avoid releasing and reacquiring the same page lock. + */ + new_mtx = vm_page_lockptr(m); + if (m_mtx != new_mtx) { + if (m_mtx != NULL) + mtx_unlock(m_mtx); + m_mtx = new_mtx; + mtx_lock(m_mtx); + } +retry: + if (m->wire_count != 0 || m->hold_count != 0) + error = EBUSY; + else if ((object = m->object) != NULL) { + /* + * The page is relocated if and only if it could be + * laundered or reclaimed by the page daemon. + */ + if (!VM_OBJECT_TRYWLOCK(object)) { + mtx_unlock(m_mtx); + VM_OBJECT_WLOCK(object); + mtx_lock(m_mtx); + if (m->object != object) { + /* + * The page may have been freed. + */ + VM_OBJECT_WUNLOCK(object); + goto retry; + } else if (m->wire_count != 0 || + m->hold_count != 0) { + error = EBUSY; + goto unlock; + } + } + KASSERT((m->flags & PG_UNHOLDFREE) == 0, + ("page %p is PG_UNHOLDFREE", m)); + /* Don't care: PG_NODUMP, PG_WINATCFLS, PG_ZERO. */ + if (object->type != OBJT_DEFAULT && + object->type != OBJT_SWAP && + object->type != OBJT_VNODE) + error = EINVAL; + else if ((m->flags & PG_CACHED) != 0 || + m != vm_page_lookup(object, m->pindex)) { + /* + * The page is cached or recently converted + * from cached to free. + */ + VM_OBJECT_WUNLOCK(object); + goto cached; + } else if (object->memattr != VM_MEMATTR_DEFAULT) + error = EINVAL; + else if (m->queue != PQ_NONE && !vm_page_busied(m)) { + KASSERT(pmap_page_get_memattr(m) == + VM_MEMATTR_DEFAULT, + ("page %p has an unexpected memattr", m)); + KASSERT((m->oflags & (VPO_SWAPINPROG | + VPO_SWAPSLEEP | VPO_UNMANAGED)) == 0, + ("page %p has unexpected oflags", m)); + /* Don't care: VPO_NOSYNC. */ + if (m->valid != 0) { + /* + * First, try to allocate a new page + * that is above "high". Failing + * that, try to allocate a new page + * that is below "m_run". Allocate + * the new page between the end of + * "m_run" and "high" only as a last + * resort. + */ + req = req_class | VM_ALLOC_NOOBJ; + if ((m->flags & PG_NODUMP) != 0) + req |= VM_ALLOC_NODUMP; + if (trunc_page(high) != + ~(vm_paddr_t)PAGE_MASK) { + m_new = vm_page_alloc_contig( + NULL, 0, req, 1, + round_page(high), + ~(vm_paddr_t)0, + PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + } else + m_new = NULL; + if (m_new == NULL) { + pa = VM_PAGE_TO_PHYS(m_run); + m_new = vm_page_alloc_contig( + NULL, 0, req, 1, + 0, pa - 1, PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + } + if (m_new == NULL) { + pa += ptoa(npages); + m_new = vm_page_alloc_contig( + NULL, 0, req, 1, + pa, high, PAGE_SIZE, 0, + VM_MEMATTR_DEFAULT); + } + if (m_new == NULL) { + error = ENOMEM; + goto unlock; + } + KASSERT(m_new->wire_count == 0, + ("page %p is wired", m)); + + /* + * Replace "m" with the new page. For + * vm_page_replace(), "m" must be busy + * and dequeued. Finally, change "m" + * as if vm_page_free() was called. + */ + if (object->ref_count != 0) + pmap_remove_all(m); + m_new->aflags = m->aflags; + KASSERT(m_new->oflags == VPO_UNMANAGED, + ("page %p is managed", m)); + m_new->oflags = m->oflags & VPO_NOSYNC; + pmap_copy_page(m, m_new); + m_new->valid = m->valid; + m_new->dirty = m->dirty; + m->flags &= ~PG_ZERO; + vm_page_xbusy(m); + vm_page_remque(m); + vm_page_replace_checked(m_new, object, + m->pindex, m); + m->valid = 0; + vm_page_undirty(m); + + /* + * The new page must be deactivated + * before the object is unlocked. + */ + new_mtx = vm_page_lockptr(m_new); + if (m_mtx != new_mtx) { + mtx_unlock(m_mtx); + m_mtx = new_mtx; + mtx_lock(m_mtx); + } + vm_page_deactivate(m_new); + } else { + m->flags &= ~PG_ZERO; + vm_page_remque(m); + vm_page_remove(m); + KASSERT(m->dirty == 0, + ("page %p is dirty", m)); + } + SLIST_INSERT_HEAD(&free, m, plinks.s.ss); + } else + error = EBUSY; +unlock: + VM_OBJECT_WUNLOCK(object); + } else { +cached: + mtx_lock(&vm_page_queue_free_mtx); + order = m->order; + if (order < VM_NFREEORDER) { + /* + * The page is enqueued in the physical memory + * allocator's cache/free page queues. + * Moreover, it is the first page in a power- + * of-two-sized run of contiguous cache/free + * pages. Jump ahead to the last page within + * that run, and continue from there. + */ + m += (1 << order) - 1; + } +#if VM_NRESERVLEVEL > 0 + else if (vm_reserv_is_page_free(m)) + order = 0; +#endif + mtx_unlock(&vm_page_queue_free_mtx); + if (order == VM_NFREEORDER) + error = EINVAL; + } + } + if (m_mtx != NULL) + mtx_unlock(m_mtx); + if ((m = SLIST_FIRST(&free)) != NULL) { + mtx_lock(&vm_page_queue_free_mtx); + do { + SLIST_REMOVE_HEAD(&free, plinks.s.ss); + vm_phys_freecnt_adj(m, 1); +#if VM_NRESERVLEVEL > 0 + if (!vm_reserv_free_page(m)) +#else + if (true) +#endif + vm_phys_free_pages(m, 0); + } while ((m = SLIST_FIRST(&free)) != NULL); + vm_page_zero_idle_wakeup(); + vm_page_free_wakeup(); + mtx_unlock(&vm_page_queue_free_mtx); + } + return (error); +} + +#define NRUNS 16 + +CTASSERT(powerof2(NRUNS)); + +#define RUN_INDEX(count) ((count) & (NRUNS - 1)) + +#define MIN_RECLAIM 8 + +/* + * vm_page_reclaim_contig: + * + * Reclaim allocated, contiguous physical memory satisfying the specified + * conditions by relocating the virtual pages using that physical memory. + * Returns true if reclamation is successful and false otherwise. Since + * relocation requires the allocation of physical pages, reclamation may + * fail due to a shortage of cache/free pages. When reclamation fails, + * callers are expected to perform VM_WAIT before retrying a failed + * allocation operation, e.g., vm_page_alloc_contig(). + * + * The caller must always specify an allocation class through "req". + * + * allocation classes: + * VM_ALLOC_NORMAL normal process request + * VM_ALLOC_SYSTEM system *really* needs a page + * VM_ALLOC_INTERRUPT interrupt time request + * + * The optional allocation flags are ignored. + * + * "npages" must be greater than zero. Both "alignment" and "boundary" + * must be a power of two. + */ +bool +vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary) +{ + vm_paddr_t curr_low; + vm_page_t m_run, m_runs[NRUNS]; + u_long count, reclaimed; + int error, i, options, req_class; + + KASSERT(npages > 0, ("npages is 0")); + KASSERT(powerof2(alignment), ("alignment is not a power of 2")); + KASSERT(powerof2(boundary), ("boundary is not a power of 2")); + req_class = req & VM_ALLOC_CLASS_MASK; + + /* + * The page daemon is allowed to dig deeper into the free page list. + */ + if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) + req_class = VM_ALLOC_SYSTEM; + + /* + * Return if the number of cached and free pages cannot satisfy the + * requested allocation. + */ + count = vm_cnt.v_free_count + vm_cnt.v_cache_count; + if (count < npages + vm_cnt.v_free_reserved || (count < npages + + vm_cnt.v_interrupt_free_min && req_class == VM_ALLOC_SYSTEM) || + (count < npages && req_class == VM_ALLOC_INTERRUPT)) + return (false); + + /* + * Scan up to three times, relaxing the restrictions ("options") on + * the reclamation of reservations and superpages each time. + */ + for (options = VPSC_NORESERV;;) { + /* + * Find the highest runs that satisfy the given constraints + * and restrictions, and record them in "m_runs". + */ + curr_low = low; + count = 0; + for (;;) { + m_run = vm_phys_scan_contig(npages, curr_low, high, + alignment, boundary, options); + if (m_run == NULL) + break; + curr_low = VM_PAGE_TO_PHYS(m_run) + ptoa(npages); + m_runs[RUN_INDEX(count)] = m_run; + count++; + } + + /* + * Reclaim the highest runs in LIFO (descending) order until + * the number of reclaimed pages, "reclaimed", is at least + * MIN_RECLAIM. Reset "reclaimed" each time because each + * reclamation is idempotent, and runs will (likely) recur + * from one scan to the next as restrictions are relaxed. + */ + reclaimed = 0; + for (i = 0; count > 0 && i < NRUNS; i++) { + count--; + m_run = m_runs[RUN_INDEX(count)]; + error = vm_page_reclaim_run(req_class, npages, m_run, + high); + if (error == 0) { + reclaimed += npages; + if (reclaimed >= MIN_RECLAIM) + return (true); + } + } + + /* + * Either relax the restrictions on the next scan or return if + * the last scan had no restrictions. + */ + if (options == VPSC_NORESERV) + options = VPSC_NOSUPER; + else if (options == VPSC_NOSUPER) + options = VPSC_ANY; + else if (options == VPSC_ANY) + return (reclaimed != 0); + } +} + /* * vm_wait: (also see VM_WAIT macro) * Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/vm/vm_page.h Sat Dec 19 18:42:50 2015 (r292469) @@ -474,6 +474,8 @@ vm_page_t vm_page_prev(vm_page_t m); boolean_t vm_page_ps_is_valid(vm_page_t m); void vm_page_putfake(vm_page_t m); void vm_page_readahead_finish(vm_page_t m); +bool vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary); void vm_page_reference(vm_page_t m); void vm_page_remove (vm_page_t); int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); @@ -482,6 +484,8 @@ vm_page_t vm_page_replace(vm_page_t mnew void vm_page_requeue(vm_page_t m); void vm_page_requeue_locked(vm_page_t m); int vm_page_sbusied(vm_page_t m); +vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start, + vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options); void vm_page_set_valid_range(vm_page_t m, int base, int size); int vm_page_sleep_if_busy(vm_page_t m, const char *msg); vm_offset_t vm_page_startup(vm_offset_t vaddr); Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Dec 19 13:19:39 2015 (r292468) +++ head/sys/vm/vm_pageout.c Sat Dec 19 18:42:50 2015 (r292469) @@ -237,8 +237,6 @@ SYSCTL_INT(_vm, OID_AUTO, max_wired, CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); static boolean_t vm_pageout_fallback_object_lock(vm_page_t, vm_page_t *); -static boolean_t vm_pageout_launder(struct vm_pagequeue *pq, int, vm_paddr_t, - vm_paddr_t); #if !defined(NO_SWAPPING) static void vm_pageout_map_deactivate_pages(vm_map_t, long); static void vm_pageout_object_deactivate_pages(pmap_t, vm_object_t, long); @@ -595,170 +593,6 @@ vm_pageout_flush(vm_page_t *mc, int coun return (numpagedout); } -static boolean_t -vm_pageout_launder(struct vm_pagequeue *pq, int tries, vm_paddr_t low, - vm_paddr_t high) -{ - struct mount *mp; - struct vnode *vp; - vm_object_t object; - vm_paddr_t pa; - vm_page_t m, m_tmp, next; - int lockmode; - - vm_pagequeue_lock(pq); - TAILQ_FOREACH_SAFE(m, &pq->pq_pl, plinks.q, next) { - if ((m->flags & PG_MARKER) != 0) - continue; - pa = VM_PAGE_TO_PHYS(m); - if (pa < low || pa + PAGE_SIZE > high) - continue; - if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) { - vm_page_unlock(m); - continue; - } - object = m->object; - if ((!VM_OBJECT_TRYWLOCK(object) && - (!vm_pageout_fallback_object_lock(m, &next) || - m->hold_count != 0)) || vm_page_busied(m)) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); - continue; - } - vm_page_test_dirty(m); - if (m->dirty == 0 && object->ref_count != 0) - pmap_remove_all(m); - if (m->dirty != 0) { - vm_page_unlock(m); - if (tries == 0 || (object->flags & OBJ_DEAD) != 0) { - VM_OBJECT_WUNLOCK(object); - continue; - } - if (object->type == OBJT_VNODE) { - vm_pagequeue_unlock(pq); - vp = object->handle; - vm_object_reference_locked(object); - VM_OBJECT_WUNLOCK(object); - (void)vn_start_write(vp, &mp, V_WAIT); - lockmode = MNT_SHARED_WRITES(vp->v_mount) ? - LK_SHARED : LK_EXCLUSIVE; - vn_lock(vp, lockmode | LK_RETRY); - VM_OBJECT_WLOCK(object); - vm_object_page_clean(object, 0, 0, OBJPC_SYNC); - VM_OBJECT_WUNLOCK(object); - VOP_UNLOCK(vp, 0); - vm_object_deallocate(object); - vn_finished_write(mp); - return (TRUE); - } else if (object->type == OBJT_SWAP || - object->type == OBJT_DEFAULT) { - vm_pagequeue_unlock(pq); - m_tmp = m; - vm_pageout_flush(&m_tmp, 1, VM_PAGER_PUT_SYNC, - 0, NULL, NULL); - VM_OBJECT_WUNLOCK(object); - return (TRUE); - } - } else { - /* - * Dequeue here to prevent lock recursion in - * vm_page_cache(). - */ - vm_page_dequeue_locked(m); - vm_page_cache(m); - vm_page_unlock(m); - } - VM_OBJECT_WUNLOCK(object); - } - vm_pagequeue_unlock(pq); - return (FALSE); -} - -/* - * Increase the number of cached pages. The specified value, "tries", - * determines which categories of pages are cached: - * - * 0: All clean, inactive pages within the specified physical address range - * are cached. Will not sleep. - * 1: The vm_lowmem handlers are called. All inactive pages within - * the specified physical address range are cached. May sleep. - * 2: The vm_lowmem handlers are called. All inactive and active pages - * within the specified physical address range are cached. May sleep. - */ -void -vm_pageout_grow_cache(int tries, vm_paddr_t low, vm_paddr_t high) -{ - int actl, actmax, inactl, inactmax, dom, initial_dom; - static int start_dom = 0; - - if (tries > 0) { - /* - * Decrease registered cache sizes. The vm_lowmem handlers - * may acquire locks and/or sleep, so they can only be invoked - * when "tries" is greater than zero. - */ - SDT_PROBE0(vm, , , vm__lowmem_cache); - EVENTHANDLER_INVOKE(vm_lowmem, 0); - - /* - * We do this explicitly after the caches have been drained - * above. - */ - uma_reclaim(); - } - - /* - * Make the next scan start on the next domain. - */ - initial_dom = atomic_fetchadd_int(&start_dom, 1) % vm_ndomains; - - inactl = 0; - inactmax = vm_cnt.v_inactive_count; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 19 19:01:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEE54A4C94D; Sat, 19 Dec 2015 19:01:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A08DF186C; Sat, 19 Dec 2015 19:01:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJJ1hr5013788; Sat, 19 Dec 2015 19:01:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJJ1hEP013786; Sat, 19 Dec 2015 19:01:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512191901.tBJJ1hEP013786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 19 Dec 2015 19:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292472 - in head/sys: amd64/amd64 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 19:01:44 -0000 Author: imp Date: Sat Dec 19 19:01:43 2015 New Revision: 292472 URL: https://svnweb.freebsd.org/changeset/base/292472 Log: Save the physical address passed into the kernel of the UEFI system table. Modified: head/sys/amd64/amd64/machdep.c head/sys/sys/efi.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:42 2015 (r292471) +++ head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:43 2015 (r292472) @@ -188,6 +188,12 @@ extern char kernphys[]; struct msgbuf *msgbufp; +/* + * Physical address of the EFI System Table. Stashed from the metadata hints + * passed into the kernel and used by the EFI code to call runtime services. + */ +vm_paddr_t efi_systbl; + /* Intel ICH registers */ #define ICH_PMBASE 0x400 #define ICH_SMI_EN ICH_PMBASE + 0x30 @@ -1495,6 +1501,7 @@ native_parse_preload_data(u_int64_t modu ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); db_fetch_ksymtab(ksym_start, ksym_end); #endif + efi_systbl = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t); return (kmdp); } @@ -1615,6 +1622,8 @@ hammer_time(u_int64_t modulep, u_int64_t /* * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) * transition). + * Once bootblocks have updated, we can test directly for + * efi_systbl != NULL here... */ if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL) Modified: head/sys/sys/efi.h ============================================================================== --- head/sys/sys/efi.h Sat Dec 19 19:01:42 2015 (r292471) +++ head/sys/sys/efi.h Sat Dec 19 19:01:43 2015 (r292472) @@ -151,4 +151,5 @@ struct efi_systbl { uint64_t st_cfgtbl; }; +extern vm_paddr_t efi_systbl; #endif /* _SYS_EFI_H_ */ From owner-svn-src-all@freebsd.org Sat Dec 19 19:01:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC312A4C949; Sat, 19 Dec 2015 19:01:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABA61868; Sat, 19 Dec 2015 19:01:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJJ1gVC013744; Sat, 19 Dec 2015 19:01:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJJ1gED013743; Sat, 19 Dec 2015 19:01:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512191901.tBJJ1gED013743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 19 Dec 2015 19:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292471 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 19:01:43 -0000 Author: imp Date: Sat Dec 19 19:01:42 2015 New Revision: 292471 URL: https://svnweb.freebsd.org/changeset/base/292471 Log: Pass the UEFI system table into the kernel from the boot loader via the FW_HANDLE metadata item. The kernel can get the rest of what it needs from this. Modified: head/sys/boot/efi/loader/bootinfo.c Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Sat Dec 19 19:00:24 2015 (r292470) +++ head/sys/boot/efi/loader/bootinfo.c Sat Dec 19 19:01:42 2015 (r292471) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #endif +extern EFI_SYSTEM_TABLE *ST; + static const char howto_switches[] = "aCdrgDmphsv"; static int howto_masks[] = { RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, @@ -435,6 +437,7 @@ bi_load(char *args, vm_offset_t *modulep "device tree blob found!\n"); #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); + file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof ST, &ST); bi_load_efi_data(kfp); From owner-svn-src-all@freebsd.org Sat Dec 19 19:09:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6FB4A4CD4C; Sat, 19 Dec 2015 19:09:10 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0106.outbound.protection.outlook.com [207.46.100.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E9821CD1; Sat, 19 Dec 2015 19:09:09 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from SN1PR05CA0023.namprd05.prod.outlook.com (10.163.68.161) by BLUPR05MB053.namprd05.prod.outlook.com (10.255.210.139) with Microsoft SMTP Server (TLS) id 15.1.337.19; Sat, 19 Dec 2015 19:09:07 +0000 Received: from BL2FFO11OLC014.protection.gbl (2a01:111:f400:7c09::191) by SN1PR05CA0023.outlook.office365.com (2a01:111:e400:5197::33) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Sat, 19 Dec 2015 19:09:06 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11OLC014.mail.protection.outlook.com (10.173.160.144) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sat, 19 Dec 2015 19:09:06 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 19 Dec 2015 11:00:15 -0800 Received: from [172.29.32.216] (farena-sslvpn-nc.jnpr.net [172.29.32.216]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id tBJJ05D09800; Sat, 19 Dec 2015 11:00:08 -0800 (PST) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/14.5.9.151119 Date: Sat, 19 Dec 2015 13:53:32 -0500 Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks From: "Jonathan T. Looney" Sender: Jonathan Looney To: Kristof Provost , Randall Stewart CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Thread-Topic: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks References: <201512160056.tBG0ujqA067178@repo.freebsd.org> <3E097253-0E8E-4A50-B1BD-8C9A280E6CD0@sigsegv.be> In-Reply-To: <3E097253-0E8E-4A50-B1BD-8C9A280E6CD0@sigsegv.be> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="B_3533378411_450175" X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC014; 1:wTAdliNwYW/pUZFoyiXFlWSR1XGVFgY5OFUSvZ+h/0k2YGpnN03RHBjJkfy8VH60ugZ6aErooQF7WEbRFAQTMgnkdm9h4uA5eNTlmoO7whI5Nd6LYp9lPIe6/B+Sp0KJPDJSw+1Ssb7E9j0e2cUlqheFs3mqAsh4CNJJN7+82pNuuyDAQhSmaQfMDvD5qj9nLRlU52tBS0h1f7SRnIkgQnaegfvtAAH5WNuVVN66fK4sJ/ekTWAhB4i5emL0yrqffgTDgqCTDwtP+0HP2FJcvDmxGfYOuXT3+jg0xTBPS+UUr1+6B4atjgzVkOcnLkycdl6QGmOzF/97KjX3f9it7y727SR1aGb1y9tcvdM5jlY/PUUCiwy04yRwfMpj/9jy X-Forefront-Antispam-Report: CIP:66.129.239.19; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(479174004)(199003)(377454003)(13624006)(24454002)(189002)(97736004)(83506001)(76176999)(4001350100001)(568964002)(586003)(54356999)(21490400002)(5890100001)(36756003)(19580405001)(19580395003)(81156007)(105596002)(69596002)(84326002)(6806005)(92566002)(5001960100002)(86362001)(1220700001)(50986999)(1096002)(512954002)(15975445007)(4610100001)(189998001)(270700001)(16796002)(2950100001)(87936001)(77096005)(5001770100001)(106466001)(11100500001)(2476003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB053; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB053; 2:fPO46sHHMnG4SO8UBkM1MxpcXfb6FoK7nTMsuv01CHCxEWr6c5JMUXjhW6VIOpOyFI7wvQZttHBcX5MHref8aCP1glJ6hhRga9QSOkZ0YwGrjVgdnEwwT2b7iyQaOxLagivDrjl+AIP886Mj8QYpEg==; 3:XWpWqc+p+nHwYbsMydU8fGgkRjVQUJRAqCZSy+mT+JfPOb3hU0x7V1Rf3IsB5DLjaIVEYZ0U28n/kDMy+xnz1WsPfLAeje43UrRCblVxjXg67bFgWWZiBOJO2uRU8lemte++V01HAXL+wu0+zGNTAbaU3KoYyqrCF5olS+xkb8tHbYFgkZK0gpXL/0hY9UmZQUN3rFRVl4Xlm4Y/LuoPUen1ckrNopXGbUprgd4xsyM=; 25:b/9cjdlp/A1aHmMlERSnqf/lac30iV/vt2RojFCiKffTm4Z8WDuZawnScNEqIRtTUQJw5q4u/qXI7YQPMhbEFjU7fe6XzJKaLnub2Dm8NtkIgT3O47tlKvsFYnAlK21hoBHk9sB656PS2/+jsgsv0xFER0s994Z4wAEyRJYmdhkD+sM6AeucsIVTLV1iI9uLquGjl3V3MAbKJfycSmp0/zv/Myw2KRjiqLkrGITDdI5f02k5kd9NCIqbfzAXdocMQQwR8g6b+2CjAon1Gy4Zog== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB053; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB053; 20:y1Pqn3P2QppWk6HtViayucyRQwiJU7qqeYjiYK+/4VPKqIftnxBDv7Bt8J6Uk/NqcMi56QBsqf/LqlblEO/b+IyqvYHuPs/Q3hQooOJDJGFRvh0VRY50YUO6q30jKOPqf0+zk+F7NZlWQaWidc37kQu0CnpYb9NQSuRStIqG+fFXFfXIJqwfbY7ozxX+L77/+ArK2wRFCQ0N7cDS5FtsWYz/ZLQJpFKN+7qxc2ZdDrgFDyOsAtgzH6K4J6O4LF7LD5qbQzl2ypYCuVFS+Vebzy1/RXUqtOLgqtPco9d3Id+pU/P+7oIW7T1y4QlX6bpQOIfncNVa0xk7i9mVt0YwpiL8ytzIMPd77CQp2tfjm0uGyakYzRQASrrMG/GbnqqHqfzXBlcAimG9SCbuL7hnEVSX6WD7UgA+1v4IsTFrMELx69/Weg8icNjNArvV6vinNWaketwXESs9PFSQoTNuFPmFVBPJa1syIiE0MeCUIJEGVXbc5jHvsCpoo5iK85a4; 4:wbgJZSW3XkPGby/fW5jzPUeB91upjrsIbA9NNkeJin9cpdyYzvKEUClAz1I3NkxZkyztXNy4/YRsVqr8FYDANwdEDvAn6bbYYJuQrVulKEHIM1xSB2t8+XxnVKbxMW0IyegrRUbTEslt52u1Z4T244GTDE6vhYUzBbpaWjEZr2dUIUHHZ32cyytgvMI9/QBQbUk6rn6R1TaPaEskQW0S6Mr+vX6kdGugiF3HQWmpHz2Bc5rZZIpiolXMb8pFShaWXe36ZteSwEAboF88y2I0FGceVEsvx4WdhW7vnQ4VWbqS6C7gqKH4TuqM3840+k7slc3XM48PyIzE6PSwW2oVUhvY/sJrNH/Sf3kgJd0Ydvo/O+KeFskZIMS4XVPUeE/f X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046); SRVR:BLUPR05MB053; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB053; X-Forefront-PRVS: 07954CC105 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB053; 23:aT/okiUeYNKUQ/Zc9iVqXr12owhJLgVP5/hon+vzFF?= =?us-ascii?Q?S231z5FsQgWKUF3EpCryqGtidudx+r8eKQvlszxd5ZBE9Cg8JgQ/Rac9oRGf?= =?us-ascii?Q?H7jzkAevhoU3J59xIoVRXsRkEw0pW/PseA97Yvdh6Im5f+pLuJK5kMrhvQMl?= =?us-ascii?Q?KdN3AeKviWbxk+tBBQLvLMst3cUSeAGDNRknZpovY6fUCMVLWAsDfCo3AN5G?= =?us-ascii?Q?K2hdmNAK58t8HrJj+PULTyN4ImpSTT6pNynQ2PA2VDs5+ZNOO4hSixRGYLer?= =?us-ascii?Q?2lBdAvRhA4DJdj7zHDTWwxXhpG1GzfVLX7twcJzln1i+657UksBxQ9/i5knA?= =?us-ascii?Q?5l+1cyV4KmAZx0B9lssRyr8sP+lXUxcjPfYIktWzrsYdX0C+ifY5UZOVNpoO?= =?us-ascii?Q?j3A9P+G2btd4AEvrFEDeeIZW29p6uNBmdzqocOcvoRFVvCauTw/rejOtkrjS?= =?us-ascii?Q?cTRHqtcy7XI9s0QDsC9jGVaELwlnoQbdqqTVqbJJ52F88Mgpn1HM1Gv/mPx1?= =?us-ascii?Q?SpTfbDhtNmtnoFirmJf78Q5o1g64x+GxeJnQ9lwpzJHWgGNcLmMH4FzMRNnc?= =?us-ascii?Q?BPq/FNajgOWpbPBVRy3QyQrY8NNUdOib/r/komsLDaXavvUUFCWQS6x/JWYy?= =?us-ascii?Q?yJtAC80Ck+3Pa9ACs072MnFx/x4XzMnIRjPTOnv1e/qcbhlTuD98uT3xP8Yt?= =?us-ascii?Q?opmMIdIP/9AeBvU6H7uf6d0iJZq84ec6Ai8n7Z2jB/ndpc9GcyzvLTVuE+RZ?= =?us-ascii?Q?KkV7vBBi+a7S9dxxtcCCfHiCB1FwLK66rZP29ipiruaDrkOrgd8SY2lDwoV9?= =?us-ascii?Q?GDEW23XyoZGWTJ1jScCER9ACK8g2SHrb1ki1LY2UCcMuPlSIiBoj3zVv12ol?= =?us-ascii?Q?GrwG3sT00y/xkopI9sJ1F59/6/wTA/LYKpIv8p6oPn1tO4VLb1p9vZDyD3Vd?= =?us-ascii?Q?451jrSoKAAeCt15t11g6tZioR6ZDbzJAdCybuPajpMJzsxQbsaUvAQN4BC90?= =?us-ascii?Q?6lZFxBd7rMSs/34k9D3m9rshB1pHvOqt4ZLAFFrZc4tAUY3GUFiWcaCbPISJ?= =?us-ascii?Q?WJnvhWWBZSe1N7WBwUxmqsa4DtK2rhRUrfLP5gwa8eJQh9Z+/vQpkb8W0imI?= =?us-ascii?Q?02veDWlm/ZFRkxJJlUwH91cFfsa1to76K1iaU6jWDqY/Awwk29wJJPpQERgm?= =?us-ascii?Q?P2oxwbD2RrJjuVsWF6rT0w1ccHovRb0bgy?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB053; 5:pQCNFoqz4xjqbUEEBhLdTRJaMrV3Xmrb+s0x+mJlFv3KvQFNYFDrbeSycsynS6mSAKgwX4fULJhft91w3uuj1T6IFt6kwLadECxc8oY+H5Nsieht+vO9xSPwjM3EtQtlisrIxCJx5i4MyVOOPSOXiw==; 24:gGvlmaRWgpWBq0wSD+QFOZWagnDnonA40hc5rM5USjobE2MSceltXGiDYMPJZC8Las2hV976lId60ASNrid3uev8367aVohGD+dNNbDnrnQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2015 19:09:06.3540 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB053 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 19:09:10 -0000 --B_3533378411_450175 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit On 12/18/15, 3:54 PM, "owner-src-committers@freebsd.org on behalf of Kristof Provost" wrote: > >> On 16 Dec 2015, at 01:56, Randall Stewart wrote: >> >> Author: rrs >> Date: Wed Dec 16 00:56:45 2015 >> New Revision: 292309 >> URL: https://svnweb.freebsd.org/changeset/base/292309 >> >> Log: >> First cut of the modularization of our TCP stack. Still >> to do is to clean up the timer handling using the async-drain. >> Other optimizations may be coming to go with this. Whats here >> will allow differnet tcp implementations (one included). >> Reviewed by: jtl, hiren, transports >> Sponsored by: Netflix Inc. >> Differential Revision: D4055 > >I suspect this commit broke my machine. I run VIMAGE jails, and see the >following panic as soon as the first jails starts: I think Randall is now (or soon will be) on holiday. Can you try the patch from https://reviews.freebsd.org/D4645 (also attached) and let me know if that fixes the problem? Thanks! Jonathan --B_3533378411_450175 Content-Type: application/octet-stream; name="D4645.diff" Content-Disposition: attachment; filename="D4645.diff" Content-Transfer-Encoding: base64 SW5kZXg6IHN5cy9uZXRpbmV0L3RjcF9zdWJyLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL25l dGluZXQvdGNwX3N1YnIuYwkocmV2aXNpb24gMjkyNDY4KQorKysgc3lzL25ldGluZXQvdGNw X3N1YnIuYwkod29ya2luZyBjb3B5KQpAQCAtNTkzLDEwICs1OTMsNiBAQAogCWlmIChoaG9v a19oZWFkX3JlZ2lzdGVyKEhIT09LX1RZUEVfVENQLCBISE9PS19UQ1BfRVNUX09VVCwKIAkg ICAgJlZfdGNwX2hoaFtISE9PS19UQ1BfRVNUX09VVF0sIEhIT09LX05PV0FJVHxISE9PS19I RUFESVNJTlZORVQpICE9IDApCiAJCXByaW50ZigiJXM6IFdBUk5JTkc6IHVuYWJsZSB0byBy ZWdpc3RlciBoZWxwZXIgaG9va1xuIiwgX19mdW5jX18pOwotCS8qIFNldHVwIHRoZSB0Y3Ag ZnVuY3Rpb24gYmxvY2sgbGlzdCAqLwotCVRBSUxRX0lOSVQoJnRfZnVuY3Rpb25zKTsKLQly d19pbml0X2ZsYWdzKCZ0Y3BfZnVuY3Rpb25fbG9jaywgInRjcF9mdW5jX2xvY2siICwgMCk7 Ci0JcmVnaXN0ZXJfdGNwX2Z1bmN0aW9ucygmdGNwX2RlZl9mdW5jYmxrLCBNX1dBSVRPSyk7 CiAJaGFzaHNpemUgPSBUQ0JIQVNIU0laRTsKIAlUVU5BQkxFX0lOVF9GRVRDSCh0Y2JoYXNo X3R1bmVhYmxlLCAmaGFzaHNpemUpOwogCWlmIChoYXNoc2l6ZSA9PSAwKSB7CkBAIC02NzUs NiArNjcxLDEwIEBACiAJdGNwX3JleG1pdF9zbG9wID0gVENQVFZfQ1BVX1ZBUjsKIAl0Y3Bf Zmlud2FpdDJfdGltZW91dCA9IFRDUFRWX0ZJTldBSVQyX1RJTUVPVVQ7CiAJdGNwX3RjYmhh c2hzaXplID0gaGFzaHNpemU7CisJLyogU2V0dXAgdGhlIHRjcCBmdW5jdGlvbiBibG9jayBs aXN0ICovCisJVEFJTFFfSU5JVCgmdF9mdW5jdGlvbnMpOworCXJ3X2luaXRfZmxhZ3MoJnRj cF9mdW5jdGlvbl9sb2NrLCAidGNwX2Z1bmNfbG9jayIgLCAwKTsKKwlyZWdpc3Rlcl90Y3Bf ZnVuY3Rpb25zKCZ0Y3BfZGVmX2Z1bmNibGssIE1fV0FJVE9LKTsKIAogCWlmICh0Y3Bfc29y ZWNlaXZlX3N0cmVhbSkgewogI2lmZGVmIElORVQK --B_3533378411_450175-- From owner-svn-src-all@freebsd.org Sat Dec 19 19:13:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C17CA4D082; Sat, 19 Dec 2015 19:13:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15B871077; Sat, 19 Dec 2015 19:13:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJJDd83019317; Sat, 19 Dec 2015 19:13:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJJDcjZ019314; Sat, 19 Dec 2015 19:13:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512191913.tBJJDcjZ019314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 19 Dec 2015 19:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292473 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 19:13:40 -0000 Author: imp Date: Sat Dec 19 19:13:38 2015 New Revision: 292473 URL: https://svnweb.freebsd.org/changeset/base/292473 Log: Create libstand version of uuid_from_string and uuid_to_string. The normal libc versions of these functions use asprintf and sscanf, both of which aren't available in the libstand world. It's easier to rewrite these than to try to claw those functions into libstand. Also include uuid_create_nil, since it's safe to include. These were written from scratch, except for bits of comments that I got from the libc version, which are acknowledged in the source. Differential Revision: https://reviews.freebsd.org/D4540 Added: head/lib/libstand/uuid_from_string.c (contents, props changed) head/lib/libstand/uuid_to_string.c (contents, props changed) Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sat Dec 19 19:01:43 2015 (r292472) +++ head/lib/libstand/Makefile Sat Dec 19 19:13:38 2015 (r292473) @@ -69,7 +69,7 @@ SRCS+= syncicache.c # uuid functions from libc .PATH: ${LIBC_SRC}/uuid -SRCS+= uuid_equal.c uuid_is_nil.c +SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c # _setjmp/_longjmp .PATH: ${LIBSTAND_SRC}/${MACHINE_CPUARCH} Added: head/lib/libstand/uuid_from_string.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libstand/uuid_from_string.c Sat Dec 19 19:13:38 2015 (r292473) @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2015 M. Warner Losh + * 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$ + */ + +/* + * Note: some comments taken from lib/libc/uuid/uuid_from_string.c + * Copyright (c) 2002 Marcel Moolenaar + * Copyright (c) 2002 Hiten Mahesh Pandya + */ + + +#include +#include + +static int +hex2int(int ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + if (ch >= 'a' && ch <= 'f') + return 10 + ch - 'a'; + if (ch >= 'A' && ch <= 'F') + return 10 + ch - 'A'; + return 16; +} + +static uint32_t +fromhex(const char *s, int len, int *ok) +{ + uint32_t v; + int i, h; + + if (!*ok) + return 0; + v = 0; + for (i = 0; i < 8; i++) { + h = hex2int(s[i]); + if (h == 16) { + *ok = 0; + return v; + } + v = (v << 4) | h; + } + return v; +} + +/* + * uuid_from_string() - convert a string representation of an UUID into + * a binary representation. + * See also: + * http://www.opengroup.org/onlinepubs/009629399/uuid_from_string.htm + * + * NOTE: The sequence field is in big-endian, while the time fields are in + * native byte order. + * + * 01234567-89ab-cdef-0123-456789abcdef + * 000000000011111111112222222222333333 + * 012345678901234567890123456789012345 + * - - - - + * hhhhhhhh-hhhh-hhhh-bbbb-bbbbbbbbbbbb + * + */ +void +uuid_from_string(const char *s, uuid_t *u, uint32_t *status) +{ + int ok = 1; + int n; + + if (s == NULL || *s == '\0') { + uuid_create_nil(u, status); + return; + } + + if (status != NULL) + *status = uuid_s_invalid_string_uuid; + if (strlen(s) != 36) + return; + /* Only support new format, check for all the right dashes */ + if (s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-') + return; + /* native byte order */ + u->time_low = fromhex(s , 8, &ok); + u->time_mid = fromhex(s + 9, 4, &ok); + u->time_hi_and_version = fromhex(s + 14, 4, &ok); + /* Big endian, but presented as a whole number so decode as such */ + u->clock_seq_hi_and_reserved = fromhex(s + 19, 2, &ok); + u->clock_seq_low = fromhex(s + 21, 2, &ok); + u->node[0] = fromhex(s + 24, 2, &ok); + u->node[1] = fromhex(s + 26, 2, &ok); + u->node[2] = fromhex(s + 28, 2, &ok); + u->node[3] = fromhex(s + 30, 2, &ok); + u->node[4] = fromhex(s + 32, 2, &ok); + u->node[5] = fromhex(s + 34, 2, &ok); + if (!ok) + return; + + /* We have a successful scan. Check semantics... */ + n = u->clock_seq_hi_and_reserved; + if ((n & 0x80) != 0x00 && /* variant 0? */ + (n & 0xc0) != 0x80 && /* variant 1? */ + (n & 0xe0) != 0xc0) { /* variant 2? */ + if (status != NULL) + *status = uuid_s_bad_version; + } else { + if (status != NULL) + *status = uuid_s_ok; + } +} Added: head/lib/libstand/uuid_to_string.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libstand/uuid_to_string.c Sat Dec 19 19:13:38 2015 (r292473) @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 2015 M. Warner Losh + * 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$ + */ + + +/* + * Note: some comments taken from lib/libc/uuid/uuid_to_string.c + * Copyright (c) 2002,2005 Marcel Moolenaar + * Copyright (c) 2002 Hiten Mahesh Pandya + */ + +#include +#include + +/* + * Dump len characters into *buf from val as hex and update *buf + */ +static void +tohex(char **buf, int len, uint32_t val) +{ + static const char *hexstr = "0123456789abcdef"; + char *walker = *buf; + int i; + + for (i = len - 1; i >= 0; i++) { + walker[i] = hexstr[val & 0xf]; + val >>= 4; + } + *buf = walker + len; +} + +/* + * uuid_to_string() - Convert a binary UUID into a string representation. + * See also: + * http://www.opengroup.org/onlinepubs/009629399/uuid_to_string.htm + * + * NOTE: The references given above do not have a status code for when + * the string could not be allocated. The status code has been + * taken from the Hewlett-Packard implementation. + * + * NOTE: we don't support u == NULL for a nil UUID, sorry. + * + * NOTE: The sequence field is in big-endian, while the time fields are in + * native byte order. + * + * hhhhhhhh-hhhh-hhhh-bbbb-bbbbbbbbbbbb + * 01234567-89ab-cdef-0123-456789abcdef + */ +void +uuid_to_string(const uuid_t *u, char **s, uint32_t *status) +{ + uuid_t nil; + char *w; + + if (status != NULL) + *status = uuid_s_ok; + if (s == NULL) /* Regular version does this odd-ball behavior too */ + return; + w = *s = malloc(37); + if (*s == NULL) { + if (status != NULL) + *status = uuid_s_no_memory; + return; + } + if (u == NULL) { + u = &nil; + uuid_create_nil(&nil, NULL); + } + /* native */ + tohex(&w, 8, u->time_low); + *w++ = '-'; + tohex(&w, 4, u->time_mid); + *w++ = '-'; + tohex(&w, 4, u->time_hi_and_version); + *w++ = '-'; + /* Big endian, so do a byte at a time */ + tohex(&w, 2, u->clock_seq_hi_and_reserved); + tohex(&w, 2, u->clock_seq_low); + *w++ = '-'; + tohex(&w, 2, u->node[0]); + tohex(&w, 2, u->node[1]); + tohex(&w, 2, u->node[2]); + tohex(&w, 2, u->node[3]); + tohex(&w, 2, u->node[4]); + tohex(&w, 2, u->node[5]); + *w++ - '\0'; +} From owner-svn-src-all@freebsd.org Sat Dec 19 19:20:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F230A4D36A; Sat, 19 Dec 2015 19:20:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0FE312CB; Sat, 19 Dec 2015 19:20:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJJKnig021527; Sat, 19 Dec 2015 19:20:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJJKm9s021518; Sat, 19 Dec 2015 19:20:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512191920.tBJJKm9s021518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 19 Dec 2015 19:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292474 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 19:20:50 -0000 Author: imp Date: Sat Dec 19 19:20:48 2015 New Revision: 292474 URL: https://svnweb.freebsd.org/changeset/base/292474 Log: Move some MIPS specific flags to be more congruent with other architectures. Modified: head/sys/conf/Makefile.mips head/sys/conf/kern.mk head/sys/conf/kmod.mk Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Sat Dec 19 19:13:38 2015 (r292473) +++ head/sys/conf/Makefile.mips Sat Dec 19 19:20:48 2015 (r292474) @@ -42,7 +42,7 @@ TRAMPLOADADDR?=0x807963c0 # We default to the MIPS32 ISA, if none specified in the # kernel configuration file. ARCH_FLAGS?=-march=mips32 -EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 -DKERNLOADADDR=${KERNLOADADDR} +EXTRA_FLAGS=-DKERNLOADADDR=${KERNLOADADDR} HACK_EXTRA_FLAGS=-shared Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Dec 19 19:13:38 2015 (r292473) +++ head/sys/conf/kern.mk Sat Dec 19 19:20:48 2015 (r292474) @@ -160,6 +160,7 @@ CFLAGS.gcc+= -mcall-aixdesc # For MIPS we also tell gcc to use floating point emulation # .if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -fno-pic -mno-abicalls -G0 CFLAGS+= -msoft-float INLINE_LIMIT?= 8000 .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Dec 19 19:13:38 2015 (r292473) +++ head/sys/conf/kmod.mk Sat Dec 19 19:20:48 2015 (r292474) @@ -130,7 +130,7 @@ CFLAGS+= -mlongcall -fno-omit-frame-poin .endif .if ${MACHINE_CPUARCH} == mips -CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls +CFLAGS+= -mlong-calls .endif .if defined(DEBUG) || defined(DEBUG_FLAGS) From owner-svn-src-all@freebsd.org Sat Dec 19 20:47:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A056CA4D5A6; Sat, 19 Dec 2015 20:47:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 706891A7E; Sat, 19 Dec 2015 20:47:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJKlFDX045887; Sat, 19 Dec 2015 20:47:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJKlFXY045886; Sat, 19 Dec 2015 20:47:15 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512192047.tBJKlFXY045886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 19 Dec 2015 20:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292478 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 20:47:16 -0000 Author: cem Date: Sat Dec 19 20:47:15 2015 New Revision: 292478 URL: https://svnweb.freebsd.org/changeset/base/292478 Log: x86: Detect feature flags "CLWB" and "PCOMMIT" "The availability of CLWB instruction is indicated by the presence of the CPUID feature flag CLWB (bit 24 of the EBX register)." CLWB is similar to CLFLUSHOPT, except that it is not required to discard cacheline contents. "On processors that supports PCOMMIT, PCOMMIT is enumerated through CPUID (CPUID.7.0.EBX[22]) only when the feature is enabled by BIOS." PCOMMIT is used to cause store-to-memory operations to become persistent (protected from power failure). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Dec 19 20:42:01 2015 (r292477) +++ head/sys/x86/x86/identcpu.c Sat Dec 19 20:47:15 2015 (r292478) @@ -916,7 +916,9 @@ printcpuinfo(void) "\024ADX" /* Supervisor Mode Access Prevention */ "\025SMAP" + "\027PCOMMIT" "\030CLFLUSHOPT" + "\031CLWB" "\032PROCTRACE" "\033AVX512PF" "\034AVX512ER" From owner-svn-src-all@freebsd.org Sat Dec 19 23:02:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28FABA4C433; Sat, 19 Dec 2015 23:02:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE595158D; Sat, 19 Dec 2015 23:02:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJN2J0X084578; Sat, 19 Dec 2015 23:02:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJN2JHX084577; Sat, 19 Dec 2015 23:02:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512192302.tBJN2JHX084577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 19 Dec 2015 23:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292480 - head/etc/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.20 Precedence: list List-Id: "SVN commit messages 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, 19 Dec 2015 23:02:20 -0000 Author: ngie Date: Sat Dec 19 23:02:18 2015 New Revision: 292480 URL: https://svnweb.freebsd.org/changeset/base/292480 Log: Fix whitespace issues in BSD.usr.dist introduced in r291455 Sponsored by: EMC / Isilon Storage Division Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Dec 19 21:05:26 2015 (r292479) +++ head/etc/mtree/BSD.usr.dist Sat Dec 19 23:02:18 2015 (r292480) @@ -21,8 +21,8 @@ clang 3.7.0 include - sanitizer - .. + sanitizer + .. .. lib freebsd