From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 00:23:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A03581F for ; Sun, 10 Aug 2014 00:23:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10FC42B3A for ; Sun, 10 Aug 2014 00:23:58 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 27fa by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 00:23:57 +0000 From: Ian Lepore Date: Sun, 10 Aug 2014 00:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269769 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e6bb9d.27fa.94d13d8@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 00:23:58 -0000 Author: ian Date: Sun Aug 10 00:23:57 2014 New Revision: 269769 URL: http://svnweb.freebsd.org/changeset/base/269769 Log: Use a separate variable for resource id, because 'i' may increment at a rate greater than 1 on each iteration. Modified: head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Sun Aug 10 00:03:40 2014 (r269768) +++ head/sys/dev/ofw/ofwbus.c Sun Aug 10 00:23:57 2014 (r269769) @@ -438,7 +438,7 @@ ofwbus_setup_dinfo(device_t dev, phandle uint32_t *reg, *intr, icells; uint64_t phys, size; phandle_t iparent; - int i, j; + int i, j, rid; int nintr; int nreg; @@ -467,7 +467,7 @@ ofwbus_setup_dinfo(device_t dev, phandle nreg = 0; } - for (i = 0; i < nreg; i += sc->acells + sc->scells) { + for (i = 0, rid = 0; i < nreg; i += sc->acells + sc->scells, rid++) { phys = size = 0; for (j = 0; j < sc->acells; j++) { phys <<= 32; @@ -479,7 +479,7 @@ ofwbus_setup_dinfo(device_t dev, phandle } /* Skip the dummy reg property of glue devices like ssm(4). */ if (size != 0) - resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, i, + resource_list_add(&ndi->ndi_rl, SYS_RES_MEMORY, rid, phys, phys + size - 1, size); } free(reg, M_OFWPROP); @@ -492,10 +492,10 @@ ofwbus_setup_dinfo(device_t dev, phandle sizeof(iparent)); OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, sizeof(icells)); - for (i = 0; i < nintr; i+= icells) { + for (i = 0, rid = 0; i < nintr; i += icells, rid++) { intr[i] = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, i, intr[i], + resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, rid, intr[i], intr[i], 1); } free(intr, M_OFWPROP); From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 00:30:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01E4A9BF for ; Sun, 10 Aug 2014 00:30:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD1592B51 for ; Sun, 10 Aug 2014 00:30:12 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2813 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 00:30:12 +0000 From: Ian Lepore Date: Sun, 10 Aug 2014 00:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269770 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e6bd14.2813.47a4416f@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 00:30:13 -0000 Author: ian Date: Sun Aug 10 00:30:12 2014 New Revision: 269770 URL: http://svnweb.freebsd.org/changeset/base/269770 Log: Handle various ways that interrupt config data can be malformed by warning and assuming more or less reasonable values. Modified: head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Sun Aug 10 00:23:57 2014 (r269769) +++ head/sys/dev/ofw/ofwbus.c Sun Aug 10 00:30:12 2014 (r269770) @@ -435,6 +435,7 @@ ofwbus_setup_dinfo(device_t dev, phandle { struct ofwbus_softc *sc; struct ofwbus_devinfo *ndi; + const char *nodename; uint32_t *reg, *intr, icells; uint64_t phys, size; phandle_t iparent; @@ -449,8 +450,8 @@ ofwbus_setup_dinfo(device_t dev, phandle free(ndi, M_DEVBUF); return (NULL); } - if (OFWBUS_EXCLUDED(ndi->ndi_obdinfo.obd_name, - ndi->ndi_obdinfo.obd_type)) { + nodename = ndi->ndi_obdinfo.obd_name; + if (OFWBUS_EXCLUDED(nodename, ndi->ndi_obdinfo.obd_type)) { ofw_bus_gen_destroy_devinfo(&ndi->ndi_obdinfo); free(ndi, M_DEVBUF); return (NULL); @@ -463,7 +464,7 @@ ofwbus_setup_dinfo(device_t dev, phandle if (nreg % (sc->acells + sc->scells) != 0) { if (bootverbose) device_printf(dev, "Malformed reg property on <%s>\n", - ndi->ndi_obdinfo.obd_name); + nodename); nreg = 0; } @@ -487,11 +488,24 @@ ofwbus_setup_dinfo(device_t dev, phandle nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { - iparent = 0; - OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)); - OF_searchencprop(OF_xref_phandle(iparent), "#interrupt-cells", - &icells, sizeof(icells)); + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming nexus on <%s>\n", nodename); + iparent = 0xffffffff; + } + if (OF_searchencprop(OF_xref_phandle(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells property, " + "assuming <1> on <%s>\n", nodename); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1> on <%s>\n", icells, + nodename); + icells = 1; + } for (i = 0, rid = 0; i < nintr; i += icells, rid++) { intr[i] = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 01:13:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2113AE42 for ; Sun, 10 Aug 2014 01:13:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBCEF207C for ; Sun, 10 Aug 2014 01:13:32 +0000 (UTC) Received: from rmacklem (uid 1196) (envelope-from rmacklem@FreeBSD.org) id 2b9a by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 01:13:32 +0000 From: Rick Macklem Date: Sun, 10 Aug 2014 01:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269771 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e6c73c.2b9a.73209a54@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 01:13:33 -0000 Author: rmacklem Date: Sun Aug 10 01:13:32 2014 New Revision: 269771 URL: http://svnweb.freebsd.org/changeset/base/269771 Log: Change the NFS server's printf related to hitting the DRC cache's flood level so that it suggests increasing vfs.nfsd.tcphighwater. Suggested by: h.schmalzbauer@omnilan.de Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Aug 10 00:30:12 2014 (r269770) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Aug 10 01:13:32 2014 (r269771) @@ -749,10 +749,9 @@ nfsrvd_compound(struct nfsrv_descript *n nd->nd_rp->rc_refcnt == 0) && (nfsrv_mallocmget_limit() || nfsrc_tcpsavedreplies > nfsrc_floodlevel)) { - if (nfsrc_tcpsavedreplies > nfsrc_floodlevel) { - printf("nfsd server cache flooded, try to"); - printf(" increase nfsrc_floodlevel\n"); - } + if (nfsrc_tcpsavedreplies > nfsrc_floodlevel) + printf("nfsd server cache flooded, try " + "increasing vfs.nfsd.tcphighwater\n"); nd->nd_repstat = NFSERR_RESOURCE; *repp = nfsd_errmap(nd); if (op == NFSV4OP_SETATTR) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 03:09:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E97819E for ; Sun, 10 Aug 2014 03:09:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44B9A2A79 for ; Sun, 10 Aug 2014 03:09:36 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 29c1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 03:09:36 +0000 From: Adrian Chadd Date: Sun, 10 Aug 2014 03:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269772 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e6e270.29c1.60d01f1b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 03:09:36 -0000 Author: adrian Date: Sun Aug 10 03:09:35 2014 New Revision: 269772 URL: http://svnweb.freebsd.org/changeset/base/269772 Log: Fix paths. Modified: head/tools/tools/ath/athalq/ar9300_ds.c Modified: head/tools/tools/ath/athalq/ar9300_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar9300_ds.c Sun Aug 10 01:13:32 2014 (r269771) +++ head/tools/tools/ath/athalq/ar9300_ds.c Sun Aug 10 03:09:35 2014 (r269772) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "ar9300_ds.h" From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 05:58:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A613793B for ; Sun, 10 Aug 2014 05:58:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F73628E3 for ; Sun, 10 Aug 2014 05:58:43 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2f21 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 05:58:42 +0000 From: Xin LI Date: Sun, 10 Aug 2014 05:58: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: r269773 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/c... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e70a12.2f21.44896eca@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 05:58:43 -0000 Author: delphij Date: Sun Aug 10 05:58:41 2014 New Revision: 269773 URL: http://svnweb.freebsd.org/changeset/base/269773 Log: MFC r269118: MFV r269010: Import Illumos changes to address the following Illumos issues: 4976 zfs should only avoid writing to a failing non-redundant top-level vdev 4978 ztest fails in get_metaslab_refcount() 4979 extend free space histogram to device and pool 4980 metaslabs should have a fragmentation metric 4981 remove fragmented ops vector from block allocator 4982 space_map object should proactively upgrade when feature is enabled 4984 device selection should use fragmentation metric Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sun Aug 10 05:58:41 2014 (r269773) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2014 +.Dd July 26, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -27,11 +27,11 @@ .Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Op Fl CumdibcsDvhLXFPA +.Op Fl CumdibcsDvhLMXFPA .Op Fl e Op Fl p Ar path... .Op Fl t Ar txg .Op Fl U Ar cache -.Op Fl M Ar inflight I/Os +.Op Fl I Ar inflight I/Os .Op Fl x Ar dumpdir .Ar poolname .Op Ar object ... @@ -42,7 +42,7 @@ .Ar dataset .Op Ar object ... .Nm -.Fl m Op Fl LXFPA +.Fl m Op Fl MLXFPA .Op Fl t Ar txg .Op Fl e Op Fl p Ar path... .Op Fl U Ar cache @@ -155,6 +155,13 @@ By default, verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. +When specified twice, also display information about the on-disk free +space histogram associated with each metaslab. When specified three time, +display the maximum contiguous free space, the in-core free space histogram, +and the percentage of free space in each space map. When specified +four times display every spacemap record. +.It Fl M +Display the offset, spacemap, and free space of each metaslab. When specified twice, also display information about the maximum contiguous free space and the percentage of free space in each space map. When specified three times display every spacemap record. @@ -229,7 +236,7 @@ all metadata on the pool. .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. -.It Fl M Ar inflight I/Os +.It Fl I Ar inflight I/Os Limit the number of outstanding checksum I/Os to the specified value. The default value is 200. This option affects the performance of the .Fl c Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Aug 10 05:58:41 2014 (r269773) @@ -111,11 +111,11 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "[-U config] [-M inflight I/Os] [-x dumpdir] poolname [object...]\n" + "Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" - " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " + " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " "poolname [vdev [metaslab...]]\n" " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" @@ -138,6 +138,7 @@ usage(void) (void) fprintf(stderr, " -h pool history\n"); (void) fprintf(stderr, " -b block statistics\n"); (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -M metaslab groups\n"); (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); @@ -168,7 +169,7 @@ usage(void) (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); - (void) fprintf(stderr, " -M -- " + (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " @@ -548,7 +549,7 @@ get_metaslab_refcount(vdev_t *vd) { int refcount = 0; - if (vd->vdev_top == vd) { + if (vd->vdev_top == vd && !vd->vdev_removing) { for (int m = 0; m < vd->vdev_ms_count; m++) { space_map_t *sm = vd->vdev_ms[m]->ms_sm; @@ -686,9 +687,10 @@ dump_metaslab(metaslab_t *msp) * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). */ - (void) printf("\tOn-disk histogram:\n"); + (void) printf("\tOn-disk histogram:\t\tfragmentation %llu\n", + (u_longlong_t)msp->ms_fragmentation); dump_histogram(sm->sm_phys->smp_histogram, - SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift); } if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { @@ -713,6 +715,47 @@ print_vdev_metaslab_header(vdev_t *vd) } static void +dump_metaslab_groups(spa_t *spa) +{ + vdev_t *rvd = spa->spa_root_vdev; + metaslab_class_t *mc = spa_normal_class(spa); + uint64_t fragmentation; + + metaslab_class_histogram_verify(mc); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (mg->mg_class != mc) + continue; + + metaslab_group_histogram_verify(mg); + mg->mg_fragmentation = metaslab_group_fragmentation(mg); + + (void) printf("\tvdev %10llu\t\tmetaslabs%5llu\t\t" + "fragmentation", + (u_longlong_t)tvd->vdev_id, + (u_longlong_t)tvd->vdev_ms_count); + if (mg->mg_fragmentation == ZFS_FRAG_INVALID) { + (void) printf("%3s\n", "-"); + } else { + (void) printf("%3llu%%\n", + (u_longlong_t)mg->mg_fragmentation); + } + dump_histogram(mg->mg_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); + } + + (void) printf("\tpool %s\tfragmentation", spa_name(spa)); + fragmentation = metaslab_class_fragmentation(mc); + if (fragmentation == ZFS_FRAG_INVALID) + (void) printf("\t%3s\n", "-"); + else + (void) printf("\t%3llu%%\n", (u_longlong_t)fragmentation); + dump_histogram(mc->mc_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); +} + +static void dump_metaslabs(spa_t *spa) { vdev_t *vd, *rvd = spa->spa_root_vdev; @@ -2369,8 +2412,7 @@ zdb_leak(void *arg, uint64_t start, uint } static metaslab_ops_t zdb_metaslab_ops = { - NULL, /* alloc */ - NULL /* fragmented */ + NULL /* alloc */ }; static void @@ -2865,6 +2907,8 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] > 2 || dump_opt['m']) dump_metaslabs(spa); + if (dump_opt['M']) + dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); @@ -3360,7 +3404,7 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); while ((c = getopt(argc, argv, - "bcdhilmM:suCDRSAFLXx:evp:t:U:P")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3373,6 +3417,7 @@ main(int argc, char **argv) case 'u': case 'C': case 'D': + case 'M': case 'R': case 'S': dump_opt[c]++; @@ -3386,10 +3431,7 @@ main(int argc, char **argv) case 'P': dump_opt[c]++; break; - case 'v': - verbose++; - break; - case 'M': + case 'I': max_inflight = strtoull(optarg, NULL, 0); if (max_inflight == 0) { (void) fprintf(stderr, "maximum number " @@ -3413,9 +3455,6 @@ main(int argc, char **argv) } searchdirs[nsearch++] = optarg; break; - case 'x': - vn_dumpdir = optarg; - break; case 't': max_txg = strtoull(optarg, NULL, 0); if (max_txg < TXG_INITIAL) { @@ -3427,6 +3466,12 @@ main(int argc, char **argv) case 'U': spa_config_path = optarg; break; + case 'v': + verbose++; + break; + case 'x': + vn_dumpdir = optarg; + break; default: usage(); break; Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Aug 10 05:58:41 2014 (r269773) @@ -21,12 +21,12 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs -.\" Copyright (c) 2012 by Delphix. All Rights Reserved. +.\" Copyright (c) 2013 by Delphix. All Rights Reserved. .\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" -.Dd July 25, 2014 +.Dd July 26, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -543,6 +543,15 @@ For example, a value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See .Xr zfs 8 for a description of the deduplication feature. +.It Sy expandsize +Amount of uninitialized space within the pool or device that can be used to +increase the total capacity of the pool. +Uninitialized space consists of +any space on an EFI labeled vdev which has not been brought online +.Pq i.e. zpool online -e . +This space occurs when a LUN is dynamically expanded. +.It Sy fragmentation +The amount of fragmentation in the pool. .It Sy free Number of blocks within the pool that are not allocated. .It Sy freeing @@ -555,13 +564,6 @@ Over time will decrease while .Sy free increases. -.It Sy expandsize -Amount of uninitialized space within the pool or device that can be used to -increase the total capacity of the pool. -Uninitialized space consists of -any space on an EFI labeled vdev which has not been brought online -.Pq i.e. zpool online -e . -This space occurs when a LUN is dynamically expanded. .It Sy guid A unique identifier for the pool. .It Sy health @@ -1408,6 +1410,7 @@ section for a list of valid properties. .Sy size , .Sy used , .Sy available , +.Sy fragmentation , .Sy expandsize , .Sy capacity , .Sy health , @@ -1794,9 +1797,9 @@ is immediately available to any datasets The following command lists all available pools on the system. .Bd -literal -offset 2n .Li # Ic zpool list -NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT -pool 2.70T 473G 2.24T - 17% 1.00x ONLINE - -test 1.98G 89.5K 1.98G - 0% 1.00x ONLINE - +NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT +pool 2.70T 473G 2.24T 33% - 17% 1.00x ONLINE - +test 1.98G 89.5K 1.98G 48% - 0% 1.00x ONLINE - .Ed .It Sy Example 7 No Listing All Properties for a Pool .Pp @@ -1924,7 +1927,35 @@ subcommand as follows: .Bd -literal -offset 2n .Li # Ic zpool iostat -v pool 5 .Ed -.It Sy Example 15 No Removing a Mirrored Log Device +.It Xo +.Sy Example 15 +Displaying expanded space on a device +.Xc +.Pp +The following command dipslays the detailed information for the +.Em data +pool. +This pool is comprised of a single +.Em raidz +vdev where one of its +devices increased its capacity by 10GB. +In this example, the pool will not +be able to utilized this extra capacity until all the devices under the +.Em raidz +vdev have been expanded. +.Bd -literal -offset 2n +.Li # Ic zpool list -v data +NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT +data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE - + raidz1 23.9G 14.6G 9.30G 48% - + ada0 - - - - - + ada1 - - - - 10G + ada2 - - - - - +.Ed +.It Xo +.Sy Example 16 +Removing a Mirrored Log Device +.Xc .Pp The following command removes the mirrored log device .Em mirror-2 . @@ -1956,7 +1987,12 @@ is: .Bd -literal -offset 2n .Li # Ic zpool remove tank mirror-2 .Ed -.It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool +.It Xo +.Sy Example 17 +Recovering a Faulted +.Tn ZFS +Pool +.Xc .Pp If a pool is faulted but recoverable, a message indicating this state is provided by Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Aug 10 05:58:41 2014 (r269773) @@ -2900,10 +2900,15 @@ print_one_column(zpool_prop_t prop, uint boolean_t fixed; size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL); - zfs_nicenum(value, propval, sizeof (propval)); if (prop == ZPOOL_PROP_EXPANDSZ && value == 0) (void) strlcpy(propval, "-", sizeof (propval)); + else if (prop == ZPOOL_PROP_FRAGMENTATION && value == ZFS_FRAG_INVALID) + (void) strlcpy(propval, "-", sizeof (propval)); + else if (prop == ZPOOL_PROP_FRAGMENTATION) + (void) snprintf(propval, sizeof (propval), "%llu%%", value); + else + zfs_nicenum(value, propval, sizeof (propval)); if (scripted) (void) printf("\t%s", propval); @@ -2936,9 +2941,9 @@ print_list_stats(zpool_handle_t *zhp, co /* only toplevel vdevs have capacity stats */ if (vs->vs_space == 0) { if (scripted) - (void) printf("\t-\t-\t-"); + (void) printf("\t-\t-\t-\t-"); else - (void) printf(" - - -"); + (void) printf(" - - - -"); } else { print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, scripted); @@ -2946,6 +2951,8 @@ print_list_stats(zpool_handle_t *zhp, co scripted); print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc, scripted); + print_one_column(ZPOOL_PROP_FRAGMENTATION, + vs->vs_fragmentation, scripted); } print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, scripted); @@ -3031,8 +3038,8 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,expandsize,capacity,dedupratio," - "health,altroot"; + "name,size,allocated,free,fragmentation,expandsize,capacity," + "dedupratio,health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; zpool_list_t *list; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sun Aug 10 05:58:41 2014 (r269773) @@ -322,6 +322,14 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (u_longlong_t)intval); } break; + case ZPOOL_PROP_FRAGMENTATION: + if (intval == UINT64_MAX) { + (void) strlcpy(buf, "-", len); + } else { + (void) snprintf(buf, len, "%llu%%", + (u_longlong_t)intval); + } + break; case ZPOOL_PROP_DEDUPRATIO: (void) snprintf(buf, len, "%llu.%02llux", Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sun Aug 10 05:58:41 2014 (r269773) @@ -21,7 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -87,6 +87,8 @@ zpool_prop_init(void) PROP_READONLY, ZFS_TYPE_POOL, "", "ALLOC"); zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "EXPANDSZ"); + zprop_register_number(ZPOOL_PROP_FRAGMENTATION, "fragmentation", 0, + PROP_READONLY, ZFS_TYPE_POOL, "", "FRAG"); zprop_register_number(ZPOOL_PROP_CAPACITY, "capacity", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "CAP"); zprop_register_number(ZPOOL_PROP_GUID, "guid", 0, PROP_READONLY, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sun Aug 10 03:09:35 2014 (r269772) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sun Aug 10 05:58:41 2014 (r269773) @@ -32,6 +32,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -91,7 +92,7 @@ int zfs_metaslab_condense_block_threshol /* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of - * a free space. Metaslab groups that have more free space than + * free space. Metaslab groups that have more free space than * zfs_mg_noalloc_threshold are always eligible for allocations. Once * a metaslab group's free space is less than or equal to the * zfs_mg_noalloc_threshold the allocator will avoid allocating to that @@ -109,6 +110,23 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo " to make it eligible for allocation"); /* + * Metaslab groups are considered eligible for allocations if their + * fragmenation metric (measured as a percentage) is less than or equal to + * zfs_mg_fragmentation_threshold. If a metaslab group exceeds this threshold + * then it will be skipped unless all metaslab groups within the metaslab + * class have also crossed this threshold. + */ +int zfs_mg_fragmentation_threshold = 85; + +/* + * Allow metaslabs to keep their active state as long as their fragmentation + * percentage is less than or equal to zfs_metaslab_fragmentation_threshold. An + * active metaslab that exceeds this threshold will no longer keep its active + * status allowing better metaslabs to be selected. + */ +int zfs_metaslab_fragmentation_threshold = 70; + +/* * When set will load all metaslabs when pool is first opened. */ int metaslab_debug_load = 0; @@ -183,14 +201,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, "Number of TXGs that an unused metaslab can be kept in memory"); /* - * Should we be willing to write data to degraded vdevs? - */ -boolean_t zfs_write_to_degraded = B_FALSE; -SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN, - &zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs"); -TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); - -/* * Max number of metaslabs per group to preload. */ int metaslab_preload_limit = SPA_DVAS_PER_BP; @@ -209,15 +219,36 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, "Max number of metaslabs per group to preload"); /* - * Enable/disable additional weight factor for each metaslab. + * Enable/disable fragmentation weighting on metaslabs. + */ +boolean_t metaslab_fragmentation_factor_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab_fragmentation_factor_enabled", + &metaslab_fragmentation_factor_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, fragmentation_factor_enabled, CTLFLAG_RWTUN, + &metaslab_fragmentation_factor_enabled, 0, + "Enable fragmentation weighting on metaslabs"); + +/* + * Enable/disable lba weighting (i.e. outer tracks are given preference). + */ +boolean_t metaslab_lba_weighting_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.lba_weighting_enabled", + &metaslab_lba_weighting_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, lba_weighting_enabled, CTLFLAG_RWTUN, + &metaslab_lba_weighting_enabled, 0, + "Enable LBA weighting (i.e. outer tracks are given preference)"); + +/* + * Enable/disable metaslab group biasing. */ -boolean_t metaslab_weight_factor_enable = B_FALSE; -TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", - &metaslab_weight_factor_enable); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, - &metaslab_weight_factor_enable, 0, - "Enable additional weight factor for each metaslab"); +boolean_t metaslab_bias_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.bias_enabled", + &metaslab_bias_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, bias_enabled, CTLFLAG_RWTUN, + &metaslab_bias_enabled, 0, + "Enable metaslab group biasing"); +static uint64_t metaslab_fragmentation(metaslab_t *); /* * ========================================================================== @@ -337,6 +368,121 @@ metaslab_class_get_minblocksize(metaslab return (mc->mc_minblocksize); } +void +metaslab_class_histogram_verify(metaslab_class_t *mc) +{ + vdev_t *rvd = mc->mc_spa->spa_root_vdev; + uint64_t *mc_hist; + int i; + + if ((zfs_flags & ZFS_DEBUG_HISTOGRAM_VERIFY) == 0) + return; + + mc_hist = kmem_zalloc(sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE, + KM_SLEEP); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + /* + * Skip any holes, uninitialized top-levels, or + * vdevs that are not in this metalab class. + */ + if (tvd->vdev_ishole || tvd->vdev_ms_shift == 0 || + mg->mg_class != mc) { + continue; + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) + mc_hist[i] += mg->mg_histogram[i]; + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) + VERIFY3U(mc_hist[i], ==, mc->mc_histogram[i]); + + kmem_free(mc_hist, sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE); +} + +/* + * Calculate the metaslab class's fragmentation metric. The metric + * is weighted based on the space contribution of each metaslab group. + * The return value will be a number between 0 and 100 (inclusive), or + * ZFS_FRAG_INVALID if the metric has not been set. See comment above the + * zfs_frag_table for more information about the metric. + */ +uint64_t +metaslab_class_fragmentation(metaslab_class_t *mc) +{ + vdev_t *rvd = mc->mc_spa->spa_root_vdev; + uint64_t fragmentation = 0; + + spa_config_enter(mc->mc_spa, SCL_VDEV, FTAG, RW_READER); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + /* + * Skip any holes, uninitialized top-levels, or + * vdevs that are not in this metalab class. + */ + if (tvd->vdev_ishole || tvd->vdev_ms_shift == 0 || + mg->mg_class != mc) { + continue; + } + + /* + * If a metaslab group does not contain a fragmentation + * metric then just bail out. + */ + if (mg->mg_fragmentation == ZFS_FRAG_INVALID) { + spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); + return (ZFS_FRAG_INVALID); + } + + /* + * Determine how much this metaslab_group is contributing + * to the overall pool fragmentation metric. + */ + fragmentation += mg->mg_fragmentation * + metaslab_group_get_space(mg); + } + fragmentation /= metaslab_class_get_space(mc); + + ASSERT3U(fragmentation, <=, 100); + spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); + return (fragmentation); +} + +/* + * Calculate the amount of expandable space that is available in + * this metaslab class. If a device is expanded then its expandable + * space will be the amount of allocatable space that is currently not + * part of this metaslab class. + */ +uint64_t +metaslab_class_expandable_space(metaslab_class_t *mc) +{ + vdev_t *rvd = mc->mc_spa->spa_root_vdev; + uint64_t space = 0; + + spa_config_enter(mc->mc_spa, SCL_VDEV, FTAG, RW_READER); + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (tvd->vdev_ishole || tvd->vdev_ms_shift == 0 || + mg->mg_class != mc) { + continue; + } + + space += tvd->vdev_max_asize - tvd->vdev_asize; + } + spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); + return (space); +} + /* * ========================================================================== * Metaslab groups @@ -389,7 +535,15 @@ metaslab_group_alloc_update(metaslab_gro mg->mg_free_capacity = ((vs->vs_space - vs->vs_alloc) * 100) / (vs->vs_space + 1); - mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold); + /* + * A metaslab group is considered allocatable if it has plenty + * of free space or is not heavily fragmented. We only take + * fragmentation into account if the metaslab group has a valid + * fragmentation metric (i.e. a value between 0 and 100). + */ + mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold && + (mg->mg_fragmentation == ZFS_FRAG_INVALID || + mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)); /* * The mc_alloc_groups maintains a count of the number of @@ -410,6 +564,7 @@ metaslab_group_alloc_update(metaslab_gro mc->mc_alloc_groups--; else if (!was_allocatable && mg->mg_allocatable) mc->mc_alloc_groups++; + mutex_exit(&mg->mg_lock); } @@ -500,6 +655,7 @@ metaslab_group_passivate(metaslab_group_ } taskq_wait(mg->mg_taskq); + metaslab_group_alloc_update(mg); mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -517,20 +673,113 @@ metaslab_group_passivate(metaslab_group_ metaslab_class_minblocksize_update(mc); } +uint64_t +metaslab_group_get_space(metaslab_group_t *mg) +{ + return ((1ULL << mg->mg_vd->vdev_ms_shift) * mg->mg_vd->vdev_ms_count); +} + +void +metaslab_group_histogram_verify(metaslab_group_t *mg) +{ + uint64_t *mg_hist; + vdev_t *vd = mg->mg_vd; + uint64_t ashift = vd->vdev_ashift; + int i; + + if ((zfs_flags & ZFS_DEBUG_HISTOGRAM_VERIFY) == 0) + return; + + mg_hist = kmem_zalloc(sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE, + KM_SLEEP); + + ASSERT3U(RANGE_TREE_HISTOGRAM_SIZE, >=, + SPACE_MAP_HISTOGRAM_SIZE + ashift); + + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + + if (msp->ms_sm == NULL) + continue; + + for (i = 0; i < SPACE_MAP_HISTOGRAM_SIZE; i++) + mg_hist[i + ashift] += + msp->ms_sm->sm_phys->smp_histogram[i]; + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i ++) + VERIFY3U(mg_hist[i], ==, mg->mg_histogram[i]); + + kmem_free(mg_hist, sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE); +} + static void -metaslab_group_add(metaslab_group_t *mg, metaslab_t *msp) +metaslab_group_histogram_add(metaslab_group_t *mg, metaslab_t *msp) { + metaslab_class_t *mc = mg->mg_class; + uint64_t ashift = mg->mg_vd->vdev_ashift; + + ASSERT(MUTEX_HELD(&msp->ms_lock)); + if (msp->ms_sm == NULL) + return; + mutex_enter(&mg->mg_lock); + for (int i = 0; i < SPACE_MAP_HISTOGRAM_SIZE; i++) { + mg->mg_histogram[i + ashift] += + msp->ms_sm->sm_phys->smp_histogram[i]; + mc->mc_histogram[i + ashift] += + msp->ms_sm->sm_phys->smp_histogram[i]; + } + mutex_exit(&mg->mg_lock); +} + +void +metaslab_group_histogram_remove(metaslab_group_t *mg, metaslab_t *msp) +{ + metaslab_class_t *mc = mg->mg_class; + uint64_t ashift = mg->mg_vd->vdev_ashift; + + ASSERT(MUTEX_HELD(&msp->ms_lock)); + if (msp->ms_sm == NULL) + return; + + mutex_enter(&mg->mg_lock); + for (int i = 0; i < SPACE_MAP_HISTOGRAM_SIZE; i++) { + ASSERT3U(mg->mg_histogram[i + ashift], >=, + msp->ms_sm->sm_phys->smp_histogram[i]); + ASSERT3U(mc->mc_histogram[i + ashift], >=, + msp->ms_sm->sm_phys->smp_histogram[i]); + + mg->mg_histogram[i + ashift] -= + msp->ms_sm->sm_phys->smp_histogram[i]; + mc->mc_histogram[i + ashift] -= + msp->ms_sm->sm_phys->smp_histogram[i]; + } + mutex_exit(&mg->mg_lock); +} + +static void +metaslab_group_add(metaslab_group_t *mg, metaslab_t *msp) +{ ASSERT(msp->ms_group == NULL); + mutex_enter(&mg->mg_lock); msp->ms_group = mg; msp->ms_weight = 0; avl_add(&mg->mg_metaslab_tree, msp); mutex_exit(&mg->mg_lock); + + mutex_enter(&msp->ms_lock); + metaslab_group_histogram_add(mg, msp); + mutex_exit(&msp->ms_lock); } static void metaslab_group_remove(metaslab_group_t *mg, metaslab_t *msp) { + mutex_enter(&msp->ms_lock); + metaslab_group_histogram_remove(mg, msp); + mutex_exit(&msp->ms_lock); + mutex_enter(&mg->mg_lock); ASSERT(msp->ms_group == mg); avl_remove(&mg->mg_metaslab_tree, msp); @@ -543,9 +792,9 @@ metaslab_group_sort(metaslab_group_t *mg { /* * Although in principle the weight can be any value, in - * practice we do not use values in the range [1, 510]. + * practice we do not use values in the range [1, 511]. */ - ASSERT(weight >= SPA_MINBLOCKSIZE-1 || weight == 0); + ASSERT(weight >= SPA_MINBLOCKSIZE || weight == 0); ASSERT(MUTEX_HELD(&msp->ms_lock)); mutex_enter(&mg->mg_lock); @@ -557,9 +806,42 @@ metaslab_group_sort(metaslab_group_t *mg } /* + * Calculate the fragmentation for a given metaslab group. We can use + * a simple average here since all metaslabs within the group must have + * the same size. The return value will be a value between 0 and 100 + * (inclusive), or ZFS_FRAG_INVALID if less than half of the metaslab in this + * group have a fragmentation metric. + */ +uint64_t +metaslab_group_fragmentation(metaslab_group_t *mg) +{ + vdev_t *vd = mg->mg_vd; + uint64_t fragmentation = 0; + uint64_t valid_ms = 0; + + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + + if (msp->ms_fragmentation == ZFS_FRAG_INVALID) + continue; + + valid_ms++; + fragmentation += msp->ms_fragmentation; + } + + if (valid_ms <= vd->vdev_ms_count / 2) + return (ZFS_FRAG_INVALID); + + fragmentation /= valid_ms; + ASSERT3U(fragmentation, <=, 100); + return (fragmentation); +} + +/* * Determine if a given metaslab group should skip allocations. A metaslab - * group should avoid allocations if its used capacity has crossed the - * zfs_mg_noalloc_threshold and there is at least one metaslab group + * group should avoid allocations if its free capacity is less than the + * zfs_mg_noalloc_threshold or its fragmentation metric is greater than + * zfs_mg_fragmentation_threshold and there is at least one metaslab group * that can still handle allocations. */ static boolean_t @@ -570,12 +852,19 @@ metaslab_group_allocatable(metaslab_grou metaslab_class_t *mc = mg->mg_class; /* - * A metaslab group is considered allocatable if its free capacity - * is greater than the set value of zfs_mg_noalloc_threshold, it's - * associated with a slog, or there are no other metaslab groups - * with free capacity greater than zfs_mg_noalloc_threshold. - */ - return (mg->mg_free_capacity > zfs_mg_noalloc_threshold || + * We use two key metrics to determine if a metaslab group is + * considered allocatable -- free space and fragmentation. If + * the free space is greater than the free space threshold and + * the fragmentation is less than the fragmentation threshold then + * consider the group allocatable. There are two case when we will + * not consider these key metrics. The first is if the group is + * associated with a slog device and the second is if all groups + * in this metaslab class have already been consider ineligible + * for allocations. + */ + return ((mg->mg_free_capacity > zfs_mg_noalloc_threshold && + (mg->mg_fragmentation == ZFS_FRAG_INVALID || + mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)) || mc != spa_normal_class(spa) || mc->mc_alloc_groups == 0); } @@ -799,16 +1088,8 @@ metaslab_ff_alloc(metaslab_t *msp, uint6 return (metaslab_block_picker(t, cursor, size, align)); } -/* ARGSUSED */ -static boolean_t -metaslab_ff_fragmented(metaslab_t *msp) -{ - return (B_TRUE); -} - static metaslab_ops_t metaslab_ff_ops = { - metaslab_ff_alloc, - metaslab_ff_fragmented + metaslab_ff_alloc }; /* @@ -855,23 +1136,8 @@ metaslab_df_alloc(metaslab_t *msp, uint6 return (metaslab_block_picker(t, cursor, size, 1ULL)); } -static boolean_t -metaslab_df_fragmented(metaslab_t *msp) -{ - range_tree_t *rt = msp->ms_tree; - uint64_t max_size = metaslab_block_maxsize(msp); - int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - - if (max_size >= metaslab_df_alloc_threshold && - free_pct >= metaslab_df_free_pct) - return (B_FALSE); - - return (B_TRUE); -} - static metaslab_ops_t metaslab_df_ops = { - metaslab_df_alloc, - metaslab_df_fragmented + metaslab_df_alloc }; /* @@ -914,15 +1180,8 @@ metaslab_cf_alloc(metaslab_t *msp, uint6 return (offset); } -static boolean_t -metaslab_cf_fragmented(metaslab_t *msp) -{ - return (metaslab_block_maxsize(msp) < metaslab_min_alloc_size); -} - static metaslab_ops_t metaslab_cf_ops = { - metaslab_cf_alloc, - metaslab_cf_fragmented + metaslab_cf_alloc }; /* @@ -979,16 +1238,8 @@ metaslab_ndf_alloc(metaslab_t *msp, uint return (-1ULL); } -static boolean_t -metaslab_ndf_fragmented(metaslab_t *msp) -{ - return (metaslab_block_maxsize(msp) <= - (metaslab_min_alloc_size << metaslab_ndf_clump_shift)); -} - static metaslab_ops_t metaslab_ndf_ops = { - metaslab_ndf_alloc, - metaslab_ndf_fragmented + metaslab_ndf_alloc }; metaslab_ops_t *zfs_metaslab_ops = &metaslab_df_ops; @@ -1090,6 +1341,7 @@ metaslab_init(metaslab_group_t *mg, uint msp->ms_tree = range_tree_create(&metaslab_rt_ops, msp, &msp->ms_lock); metaslab_group_add(mg, msp); + msp->ms_fragmentation = metaslab_fragmentation(msp); msp->ms_ops = mg->mg_class->mc_ops; /* @@ -1155,69 +1407,113 @@ metaslab_fini(metaslab_t *msp) kmem_free(msp, sizeof (metaslab_t)); } +#define FRAGMENTATION_TABLE_SIZE 17 + /* - * Apply a weighting factor based on the histogram information for this - * metaslab. The current weighting factor is somewhat arbitrary and requires - * additional investigation. The implementation provides a measure of - * "weighted" free space and gives a higher weighting for larger contiguous - * regions. The weighting factor is determined by counting the number of - * sm_shift sectors that exist in each region represented by the histogram. - * That value is then multiplied by the power of 2 exponent and the sm_shift - * value. + * This table defines a segment size based fragmentation metric that will + * allow each metaslab to derive its own fragmentation value. This is done + * by calculating the space in each bucket of the spacemap histogram and + * multiplying that by the fragmetation metric in this table. Doing + * this for all buckets and dividing it by the total amount of free *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 06:10:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 541A0CBE for ; Sun, 10 Aug 2014 06:10:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4340A2A69 for ; Sun, 10 Aug 2014 06:10:22 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2908 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 06:10:22 +0000 From: Xin LI Date: Sun, 10 Aug 2014 06:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269774 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e70cce.2908.3ddc718d@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 06:10:22 -0000 Author: delphij Date: Sun Aug 10 06:10:21 2014 New Revision: 269774 URL: http://svnweb.freebsd.org/changeset/base/269774 Log: MFC r269138: Add two sysctls for newly added tunables. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sun Aug 10 05:58:41 2014 (r269773) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sun Aug 10 06:10:21 2014 (r269774) @@ -117,6 +117,12 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo * class have also crossed this threshold. */ int zfs_mg_fragmentation_threshold = 85; +TUNABLE_INT("vfs.zfs.mg_fragmentation_threshold", &zfs_mg_fragmentation_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_fragmentation_threshold, CTLFLAG_RWTUN, + &zfs_mg_fragmentation_threshold, 0, + "Percentage of metaslab group size that should be considered " + "eligible for allocations unless all metaslab groups within the metaslab class " + "have also crossed this threshold"); /* * Allow metaslabs to keep their active state as long as their fragmentation @@ -125,6 +131,11 @@ int zfs_mg_fragmentation_threshold = 85; * status allowing better metaslabs to be selected. */ int zfs_metaslab_fragmentation_threshold = 70; +TUNABLE_INT("vfs.zfs.metaslab.fragmentation_threshold", + &zfs_metaslab_fragmentation_threshold); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, fragmentation_threshold, CTLFLAG_RWTUN, + &zfs_metaslab_fragmentation_threshold, 0, + "Maximum percentage of metaslab fragmentation level to keep their active state"); /* * When set will load all metaslabs when pool is first opened. From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 06:43:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91B9C138 for ; Sun, 10 Aug 2014 06:43:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 678422D60 for ; Sun, 10 Aug 2014 06:43:40 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 23c9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 06:43:40 +0000 From: Rui Paulo Date: Sun, 10 Aug 2014 06:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269775 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7149c.23c9.59b20a2b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 06:43:40 -0000 Author: rpaulo Date: Sun Aug 10 06:43:40 2014 New Revision: 269775 URL: http://svnweb.freebsd.org/changeset/base/269775 Log: Fix a few problems with the USDT probes: * Include OBJDIR to make sure the generated file is found; * Simplify the definition of OBJS; * Add targets for shared objects and for profiled objects. MFC after: 3 days Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Aug 10 06:10:21 2014 (r269774) +++ head/share/mk/bsd.dep.mk Sun Aug 10 06:43:40 2014 (r269775) @@ -125,21 +125,26 @@ ${_YC:R}.o: ${_YC} .if ${SRCS:M*.d} LDFLAGS+= -lelf LDADD+= ${LIBELF} -CFLAGS+= -D_DTRACE_VERSION=1 +CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR} .endif .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} ${_D}.h: ${_DSRC} ${DTRACE} -xnolibs -h -s ${.ALLSRC} SRCS:= ${SRCS:S/${_DSRC}/${_D}.h/} -${_D}.o: ${_D}.h ${_DSRC} ${OBJS} ${SOBJS} - ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${_DSRC} \ - ${OBJS:S/${_D}.o//} ${SOBJS:S/${_D}.o//} -CLEANFILES+= ${_D}.h ${_D}.o -.if defined(PROG) OBJS+= ${_D}.o -.else -SOBJS+= ${_D}.o +CLEANFILES+= ${_D}.h ${_D}.o +${_D}.o: ${_D.h} ${OBJS:S/${_D}.o//} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ + ${OBJS:S/${_D}.o//} +.if defined(LIB) +CLEANFILES+= ${_D}.So ${_D}.po +${_D}.So: ${_D.h} ${SOBJS:S/${_D}.So//} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ + ${SOBJS:S/${_D}.So//} +${_D}.po: ${_D}.h ${POBJS:S/${_D}.po//} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ + ${POBJS:S/${_D}.po//} .endif .endfor .endfor From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 06:56:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF2D32EB for ; Sun, 10 Aug 2014 06:56:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 952DB2E43 for ; Sun, 10 Aug 2014 06:56:43 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 2978 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 06:56:43 +0000 From: Rui Paulo Date: Sun, 10 Aug 2014 06:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269776 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e717ab.2978.611515cf@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 06:56:43 -0000 Author: rpaulo Date: Sun Aug 10 06:56:43 2014 New Revision: 269776 URL: http://svnweb.freebsd.org/changeset/base/269776 Log: Remove the BROKEN_LIBELF section. This problem was fixed by Kai Wang in 2011. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sun Aug 10 06:43:40 2014 (r269775) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sun Aug 10 06:56:43 2014 (r269776) @@ -1895,7 +1895,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d goto done; } #if !defined(sun) -#define BROKEN_LIBELF /* * FreeBSD's ld(1) is not instructed to interpret and add * correctly the SUNW_dof section present in tfile. @@ -1919,9 +1918,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d /* * Add the string '.SUWN_dof' to the shstrtab section. */ -#ifdef BROKEN_LIBELF - elf_flagelf(e, ELF_C_SET, ELF_F_LAYOUT); -#endif elf_getshdrstrndx(e, &stridx); scn = elf_getscn(e, stridx); gelf_getshdr(scn, &shdr); @@ -1933,54 +1929,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d loc = shdr.sh_size; shdr.sh_size += data->d_size; gelf_update_shdr(scn, &shdr); -#ifdef BROKEN_LIBELF - off = shdr.sh_offset; - rc = shdr.sh_offset + shdr.sh_size; - gelf_getehdr(e, &ehdr); - if (ehdr.e_shoff > off) { - off = ehdr.e_shoff + ehdr.e_shnum * ehdr.e_shentsize; - rc = roundup(rc, 8); - ehdr.e_shoff = rc; - gelf_update_ehdr(e, &ehdr); - rc += ehdr.e_shnum * ehdr.e_shentsize; - } - for (;;) { - scn0 = NULL; - scn = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - if (shdr.sh_type == SHT_NOBITS || - shdr.sh_offset < off) - continue; - /* Find the immediately adjcent section. */ - if (scn0 == NULL || - shdr.sh_offset < shdr0.sh_offset) { - scn0 = scn; - gelf_getshdr(scn0, &shdr0); - } - } - if (scn0 == NULL) - break; - /* Load section data to work around another bug */ - elf_getdata(scn0, NULL); - /* Update section header, assure section alignment */ - off = shdr0.sh_offset + shdr0.sh_size; - rc = roundup(rc, shdr0.sh_addralign); - shdr0.sh_offset = rc; - gelf_update_shdr(scn0, &shdr0); - rc += shdr0.sh_size; - } - if (elf_update(e, ELF_C_WRITE) < 0) { - ret = dt_link_error(dtp, NULL, -1, NULL, - "failed to add append the shstrtab section: %s", - elf_errmsg(elf_errno())); - elf_end(e); - close(efd); - goto done; - } - elf_end(e); - e = elf_begin(efd, ELF_C_RDWR, NULL); -#endif /* * Construct the .SUNW_dof section. */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 07:51:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 214C7E17 for ; Sun, 10 Aug 2014 07:51:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E51832481 for ; Sun, 10 Aug 2014 07:51:55 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 20e4 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 07:51:55 +0000 From: Hans Petter Selasky Date: Sun, 10 Aug 2014 07:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269777 - head/sys/netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7249b.20e4.485017ca@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 07:51:56 -0000 Author: hselasky Date: Sun Aug 10 07:51:55 2014 New Revision: 269777 URL: http://svnweb.freebsd.org/changeset/base/269777 Log: Fix string length argument passed to "sysctl_handle_string()" so that the complete string is returned by the function and not just only one byte. PR: 192544 MFC after: 2 weeks Modified: head/sys/netinet/cc/cc.c Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Sun Aug 10 06:56:43 2014 (r269776) +++ head/sys/netinet/cc/cc.c Sun Aug 10 07:51:55 2014 (r269777) @@ -101,7 +101,7 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) CC_LIST_RLOCK(); strlcpy(default_cc, CC_DEFAULT()->name, TCP_CA_NAME_MAX); CC_LIST_RUNLOCK(); - err = sysctl_handle_string(oidp, default_cc, 1, req); + err = sysctl_handle_string(oidp, default_cc, 0, req); } else { /* Find algo with specified name and set it to default. */ CC_LIST_RLOCK(); @@ -166,7 +166,7 @@ cc_list_available(SYSCTL_HANDLER_ARGS) if (!err) { sbuf_finish(s); - err = sysctl_handle_string(oidp, sbuf_data(s), 1, req); + err = sysctl_handle_string(oidp, sbuf_data(s), 0, req); } sbuf_delete(s); From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 08:31:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4913EBE9; Sun, 10 Aug 2014 08:31:00 +0000 (UTC) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09CE62740; Sun, 10 Aug 2014 08:31:00 +0000 (UTC) Received: from 2a02-8428-011b-e000-0290-f5ff-fe9d-b78c.rev.sfr.net ([2a02:8428:11b:e000:290:f5ff:fe9d:b78c] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX (FreeBSD)) (envelope-from ) id 1XGOWn-000PjK-Mx; Sun, 10 Aug 2014 10:30:57 +0200 Message-ID: <53E72DBC.4080403@FreeBSD.org> Date: Sun, 10 Aug 2014 10:30:52 +0200 From: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Alan Cox , Konstantin Belousov , Alan Cox Subject: Re: svn commit: r269728 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen mips/mips powerpc/aim powerpc/booke powerpc/powerpc sparc64/sparc64 vm References: <53e504e3.2f94.dca1d13@svn.freebsd.org> <53E69892.1050000@FreeBSD.org> <53E6B220.5020407@rice.edu> In-Reply-To: <53E6B220.5020407@rice.edu> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jeOSWdJmJxUi9VK56blxoj3d9Kr5PBApq" Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 08:31:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jeOSWdJmJxUi9VK56blxoj3d9Kr5PBApq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10.08.2014 01:43, Alan Cox wrote: > When you say that you reverted r269728, did you revert just that one > revision? r269728 makes no functional change on sparc64. So, I can't > see how it could have any effect at all. Yes, that one only. I'll restore it and see if the panic comes back, then revert it again. --=20 Jean-S=C3=A9bastien P=C3=A9dron --jeOSWdJmJxUi9VK56blxoj3d9Kr5PBApq 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 iQJ8BAEBCgBmBQJT5y3BXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMG0cQAKPoeNDyX5lvb1Yy24AAX/j4 MsRVLmPzALfHBo4cFq7zMFIHMts8V9bB1z8RqRHkh5GIS1z/1icDVU/lU2Az01RO DXiDO1nghcFSBTT6iaeptGPz056/WSuQgxnx0cjn3QLuf3Umb+kL6eyVn49JIS3h rnN5VGpoBR3x1bwlAY1LRt42M5x8XRHpTHK7jtx4l534r7Xn3EaLFpK5YczpuDej LuBwSQyfVxyiP/iig1JKZsse6kdUmwBgkOT1e7S35Ry1QvOGA7xp9JD9IqluQ7L7 OcrSGOo+SezkHcJCpc0/P2JGaBCE2InndHveMUuCHrHq69gp8zDt/QwYiqb7edkx ntWFk1l6mHV7WxnO6w2WmsidICz8uE2PTw/DOSdqxYSjh+OK6JsK7joWPe4dp86v IUJs6gabIkl3cWjcSOY4uJRKRvJ49tk83Chv1PUhmCrt3hOMb6uEh+Chk4RyKJmF WALE+sSDf3Hl90InCJqqWFMsOWRsbqn+Mslmv+dJzZViSnTsU1csdNwi/7ctK0YJ OmHr97XEfSO0VB65PqJs6Oojcs1LIbH8AEM9jv+KcgEiPTWb4sd3bBHqf5nEpRlv uxYSAt1kKcKpDm/pQaXwN+VusxwYw4P+HD0dKtubzPqOTz9BAtvDqRZuGiiAIlKP MMDDAv3H4cmWag1DqXTd =/ZKb -----END PGP SIGNATURE----- --jeOSWdJmJxUi9VK56blxoj3d9Kr5PBApq-- From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 08:35:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A611DC0 for ; Sun, 10 Aug 2014 08:35:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CECD727E2 for ; Sun, 10 Aug 2014 08:35:42 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2247 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 08:35:42 +0000 From: Adrian Chadd Date: Sun, 10 Aug 2014 08:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269778 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e72ede.2247.6354488c@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 08:35:43 -0000 Author: adrian Date: Sun Aug 10 08:35:42 2014 New Revision: 269778 URL: http://svnweb.freebsd.org/changeset/base/269778 Log: Undo r195846 for now - allow raw frame transmit in monitor mode. The original commit was supposed to stop the ability to do raw frame injection in monitor mode to arbitrary channels (whether supported by regulatory or not) however it doesn't seem to have been followed by any useful way of doing it. Apparently AHDEMO is supposed to be that way, but it seems to require too much fiddly things (disable scanning, set a garbage SSID, etc) for it to actually be useful for spoofing things. So for now let's just disable it and instead look to filter transmit in the output path if the channel isn't allowed by regulatory. That way monitor RX works fine but TX will be blocked. I don't plan on MFC'ing this to -10 until the regulatory enforcement bits are written. Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Aug 10 07:51:55 2014 (r269777) +++ head/sys/net80211/ieee80211.c Sun Aug 10 08:35:42 2014 (r269778) @@ -570,15 +570,9 @@ ieee80211_vap_attach(struct ieee80211vap ifp->if_baudrate = IF_Mbps(maxrate); ether_ifattach(ifp, vap->iv_myaddr); - if (vap->iv_opmode == IEEE80211_M_MONITOR) { - /* NB: disallow transmit */ - ifp->if_transmit = null_transmit; - ifp->if_output = null_output; - } else { - /* hook output method setup by ether_ifattach */ - vap->iv_output = ifp->if_output; - ifp->if_output = ieee80211_output; - } + /* hook output method setup by ether_ifattach */ + vap->iv_output = ifp->if_output; + ifp->if_output = ieee80211_output; /* NB: if_mtu set by ether_ifattach to ETHERMTU */ IEEE80211_LOCK(ic); From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 12:00:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5702647A; Sun, 10 Aug 2014 12:00:17 +0000 (UTC) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id DFB342A65; Sun, 10 Aug 2014 12:00:16 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgGAHdd51ODaFve/2dsb2JhbABag19OCQEDgnTKMIdIAYEbd4QDAQEEASMEUgUWDgYEAgINGQJZBhOIOggNrCuUYReBLI1sATMHgnmBUwWOZYZZiEiTJIN4IS+BRw X-IronPort-AV: E=Sophos;i="5.01,836,1400040000"; d="scan'208";a="146199922" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 10 Aug 2014 07:59:07 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id D657BB3F19; Sun, 10 Aug 2014 07:59:06 -0400 (EDT) Date: Sun, 10 Aug 2014 07:59:06 -0400 (EDT) From: Rick Macklem To: Rick Macklem Message-ID: <796544262.9468281.1407671946855.JavaMail.root@uoguelph.ca> In-Reply-To: <53e6c73c.2b9a.73209a54@svn.freebsd.org> Subject: Re: svn commit: r269771 - head/sys/fs/nfsserver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.209] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 12:00:17 -0000 I wrote: > Author: rmacklem > Date: Sun Aug 10 01:13:32 2014 > New Revision: 269771 > URL: http://svnweb.freebsd.org/changeset/base/269771 > > Log: > Change the NFS server's printf related to hitting > the DRC cache's flood level so that it suggests > increasing vfs.nfsd.tcphighwater. > > Suggested by: h.schmalzbauer@omnilan.de > Oops, I intended to put an MFC of 1 week here. Sorry about that, rick > Modified: > head/sys/fs/nfsserver/nfs_nfsdsocket.c > > Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c > ============================================================================== > --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Aug 10 00:30:12 2014 > (r269770) > +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Aug 10 01:13:32 2014 > (r269771) > @@ -749,10 +749,9 @@ nfsrvd_compound(struct nfsrv_descript *n > nd->nd_rp->rc_refcnt == 0) && > (nfsrv_mallocmget_limit() || > nfsrc_tcpsavedreplies > nfsrc_floodlevel)) { > - if (nfsrc_tcpsavedreplies > nfsrc_floodlevel) { > - printf("nfsd server cache flooded, try to"); > - printf(" increase nfsrc_floodlevel\n"); > - } > + if (nfsrc_tcpsavedreplies > nfsrc_floodlevel) > + printf("nfsd server cache flooded, try " > + "increasing vfs.nfsd.tcphighwater\n"); > nd->nd_repstat = NFSERR_RESOURCE; > *repp = nfsd_errmap(nd); > if (op == NFSV4OP_SETATTR) { > > From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 14:55:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46659BC7 for ; Sun, 10 Aug 2014 14:55:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D36E2B22 for ; Sun, 10 Aug 2014 14:55:40 +0000 (UTC) Received: from dumbbell (uid 1042) (envelope-from dumbbell@FreeBSD.org) id 247f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 14:55:39 +0000 From: Jean-Sebastien Pedron Date: Sun, 10 Aug 2014 14:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269779 - head/sys/dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e787eb.247f.4de6e89f@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 14:55:40 -0000 Author: dumbbell Date: Sun Aug 10 14:55:39 2014 New Revision: 269779 URL: http://svnweb.freebsd.org/changeset/base/269779 Log: fbd: Fix a bug where vt_fb_attach() success would be considered a failure vt_fb_attach() currently always returns 0, but it could return a code defined in errno.h. However, it doesn't return a CN_* code. So checking its return value against CN_DEAD (which is 0) is incorrect, and in this case, a success becomes a failure. The consequence was unimportant, because the caller (drm_fb_helper.c) would only log an error message in this case. The console would still work. Approved by: nwhitehorn Modified: head/sys/dev/fb/fbd.c Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Sun Aug 10 08:35:42 2014 (r269778) +++ head/sys/dev/fb/fbd.c Sun Aug 10 14:55:39 2014 (r269779) @@ -246,8 +246,9 @@ fbd_register(struct fb_info* info) return (err); if (first) { - if (vt_fb_attach(info) == CN_DEAD) - return (ENXIO); + err = vt_fb_attach(info); + if (err) + return (err); } return (0); From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 15:02:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1541FE9F for ; Sun, 10 Aug 2014 15:02:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA4822C70 for ; Sun, 10 Aug 2014 15:02:51 +0000 (UTC) Received: from dumbbell (uid 1042) (envelope-from dumbbell@FreeBSD.org) id 2a80 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 15:02:51 +0000 From: Jean-Sebastien Pedron Date: Sun, 10 Aug 2014 15:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269780 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7899b.2a80.ac5f854@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 15:02:52 -0000 Author: dumbbell Date: Sun Aug 10 15:02:51 2014 New Revision: 269780 URL: http://svnweb.freebsd.org/changeset/base/269780 Log: vt(4): Add vtbuf_dirty*_locked() to lock vtbuf once, not twice In several functions, vtbuf_putchar() in particular, the lock on vtbuf is acquired twice: 1. once by the said functions; 2. once in vtbuf_dirty(). Now, vtbuf_dirty_locked() and vtbuf_dirty_cell_locked() allow to acquire that lock only once. This improves the input speed of vt(4). To measure the gain, a 50,000-lines file was displayed on the console using cat(1). The time taken by cat(1) is reported below: o On amd64, with vt_vga: - before: 1.0" - after: 0.5" o On sparc64, with creator_vt: - before: 13.6" - after: 10.5" MFC after: 1 week Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Sun Aug 10 14:55:39 2014 (r269779) +++ head/sys/dev/vt/vt_buf.c Sun Aug 10 15:02:51 2014 (r269780) @@ -229,10 +229,9 @@ vtbuf_dirty_axis(unsigned int begin, uns } static inline void -vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area) +vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_t *area) { - VTBUF_LOCK(vb); if (vb->vb_dirtyrect.tr_begin.tp_row > area->tr_begin.tp_row) vb->vb_dirtyrect.tr_begin.tp_row = area->tr_begin.tp_row; if (vb->vb_dirtyrect.tr_begin.tp_col > area->tr_begin.tp_col) @@ -245,18 +244,26 @@ vtbuf_dirty(struct vt_buf *vb, const ter vtbuf_dirty_axis(area->tr_begin.tp_row, area->tr_end.tp_row); vb->vb_dirtymask.vbm_col |= vtbuf_dirty_axis(area->tr_begin.tp_col, area->tr_end.tp_col); +} + +static inline void +vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area) +{ + + VTBUF_LOCK(vb); + vtbuf_dirty_locked(vb, area); VTBUF_UNLOCK(vb); } static inline void -vtbuf_dirty_cell(struct vt_buf *vb, const term_pos_t *p) +vtbuf_dirty_cell_locked(struct vt_buf *vb, const term_pos_t *p) { term_rect_t area; area.tr_begin = *p; area.tr_end.tp_row = p->tp_row + 1; area.tr_end.tp_col = p->tp_col + 1; - vtbuf_dirty(vb, &area); + vtbuf_dirty_locked(vb, &area); } static void @@ -373,9 +380,8 @@ vtbuf_fill_locked(struct vt_buf *vb, con VTBUF_LOCK(vb); vtbuf_fill(vb, r, c); + vtbuf_dirty_locked(vb, r); VTBUF_UNLOCK(vb); - - vtbuf_dirty(vb, r); } static void @@ -531,8 +537,8 @@ vtbuf_putchar(struct vt_buf *vb, const t if (row[p->tp_col] != c) { VTBUF_LOCK(vb); row[p->tp_col] = c; + vtbuf_dirty_cell_locked(vb, p); VTBUF_UNLOCK(vb); - vtbuf_dirty_cell(vb, p); } } @@ -541,9 +547,11 @@ vtbuf_cursor_position(struct vt_buf *vb, { if (vb->vb_flags & VBF_CURSOR) { - vtbuf_dirty_cell(vb, &vb->vb_cursor); + VTBUF_LOCK(vb); + vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); vb->vb_cursor = *p; - vtbuf_dirty_cell(vb, &vb->vb_cursor); + vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); + VTBUF_UNLOCK(vb); } else { vb->vb_cursor = *p; } @@ -724,10 +732,10 @@ vtbuf_cursor_visibility(struct vt_buf *v else vb->vb_flags &= ~VBF_CURSOR; nflags = vb->vb_flags; - VTBUF_UNLOCK(vb); if (oflags != nflags) - vtbuf_dirty_cell(vb, &vb->vb_cursor); + vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); + VTBUF_UNLOCK(vb); } void @@ -742,9 +750,9 @@ vtbuf_scroll_mode(struct vt_buf *vb, int else vb->vb_flags &= ~VBF_SCROLL; nflags = vb->vb_flags; - VTBUF_UNLOCK(vb); if (oflags != nflags) - vtbuf_dirty_cell(vb, &vb->vb_cursor); + vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); + VTBUF_UNLOCK(vb); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 15:21:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B853199 for ; Sun, 10 Aug 2014 15:21:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFE392E44 for ; Sun, 10 Aug 2014 15:21:26 +0000 (UTC) Received: from ume (uid 812) (envelope-from ume@FreeBSD.org) id 2184 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 15:21:26 +0000 From: Hajimu UMEMOTO Date: Sun, 10 Aug 2014 15:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r269781 - in vendor/resolver: 9.5.0/lib/libc/include 9.5.0/lib/libc/include/isc 9.5.0/lib/libc/isc 9.5.0/lib/libc/resolv dist/lib/libc/include dist/lib/libc/include/isc dist/lib/libc/is... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e78df6.2184.7b56813@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 15:21:27 -0000 Author: ume Date: Sun Aug 10 15:21:26 2014 New Revision: 269781 URL: http://svnweb.freebsd.org/changeset/base/269781 Log: We don't use these files. Deleted: vendor/resolver/9.5.0/lib/libc/include/fd_setsize.h vendor/resolver/9.5.0/lib/libc/include/isc/assertions.h vendor/resolver/9.5.0/lib/libc/include/isc/dst.h vendor/resolver/9.5.0/lib/libc/include/isc/heap.h vendor/resolver/9.5.0/lib/libc/include/isc/memcluster.h vendor/resolver/9.5.0/lib/libc/isc/assertions.c vendor/resolver/9.5.0/lib/libc/isc/assertions.mdoc vendor/resolver/9.5.0/lib/libc/resolv/res_mkupdate.h vendor/resolver/9.5.0/lib/libc/resolv/res_sendsigned.c vendor/resolver/dist/lib/libc/include/fd_setsize.h vendor/resolver/dist/lib/libc/include/isc/assertions.h vendor/resolver/dist/lib/libc/include/isc/dst.h vendor/resolver/dist/lib/libc/include/isc/heap.h vendor/resolver/dist/lib/libc/include/isc/memcluster.h vendor/resolver/dist/lib/libc/isc/assertions.c vendor/resolver/dist/lib/libc/isc/assertions.mdoc vendor/resolver/dist/lib/libc/resolv/res_mkupdate.h vendor/resolver/dist/lib/libc/resolv/res_sendsigned.c From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 15:26:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E94C53EC for ; Sun, 10 Aug 2014 15:26:32 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5C482E6C for ; Sun, 10 Aug 2014 15:26:32 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by gateway1.nyi.internal (Postfix) with ESMTP id CCD222130F for ; Sun, 10 Aug 2014 11:26:25 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Sun, 10 Aug 2014 11:26:25 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=mesmtp; bh=NEconUOMIHfBIFqV1KHmFdQc uOo=; b=coEwrXG3is+QVCBZI0kqkatdT8MlESgPJHmYJC1qK4wq24a37ZI2hN1p r6c0zznEnZ7feoyPK6o9b22b0JVAED/2W8R7wRuYw7G6XL9EhTtfOIPOEmSgGDHe BF8gxuNW+veMPMGQkT1qMHBvxpgRMa8Mm9UPTQL1KmqcrmSk/DI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=NEconUOMIHfBIFqV1KHmFdQcuOo=; b=I56C9kAVIykatFYLIIERgoQdsH0a /xGN7hMRhhJ3FP9v+KITLLa6ry7zbG0ha43jz1TJsFnY+h4gO/FVg+RQoTj++nr6 Red1Dhs3fAPJsU1+wOgSA+W7l3ikXWhCCC7PxaIJ3pIGqOf9W93bv0avnzmY6SNE xT0obzqzwrmo8K0= X-Sasl-enc: TkS/sYYmnnZRPwv1l86NRteI92MSrhhmjGA9oZ4fiF3C 1407684385 Received: from kropotkin.aux.io (unknown [223.252.30.161]) by mail.messagingengine.com (Postfix) with ESMTPA id 28E11C007B0; Sun, 10 Aug 2014 11:26:23 -0400 (EDT) Date: Mon, 11 Aug 2014 01:26:16 +1000 From: Alastair Hogge To: Baptiste Daroussin Subject: Re: svn commit: r269649 - in head: lib lib/libohash share/mk usr.bin/m4 usr.bin/m4/lib Message-ID: <20140810152615.GA3824@kropotkin.aux.io> References: <53e2b038.5e44.59dbd637@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53e2b038.5e44.59dbd637@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 15:26:33 -0000 On 2014-08-06 Wed 22:46:15 +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Aug 6 22:46:15 2014 > New Revision: 269649 > URL: http://svnweb.freebsd.org/changeset/base/269649 > > Log: > Make libohash a proper internallib instead of hidding it in m4 > > mandoc development seems to be also using ohash so prepare to share the > code when needed Hi, I have not been able to build head with PIE since this commit. Build host is 11.0-CURRENT r269770. $ cat /etc/src.conf WITH_PIE= $ cat /etc/make.conf ALWAYS_CHECK_MAKE= $ cd /tmp/r269649 && env MAKEOBJDIRPREFIX=/tmp/obj make -j9 buildworld ===> usr.bin/m4 (all) ===> usr.bin/m4/tests (all) cc -O2 -pipe -DEXTENDED -I/tmp/r269649/usr.bin/m4 -I/tmp/r269649/usr.bin/m4/../../lib/libohash -fPIE -pie -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wp ointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -pie -o m4 eval.o expr.o look.o main.o misc.o gnum4.o trace.o parser.o tokenizer.o -ly -ll -lm /tmp/obj/tmp/r269649/lib/libohash/libohash.a /tmp/obj/tmp/r269649/tmp/usr/bin/ld: /tmp/obj/tmp/r269649/lib/libohash/libohash.a(ohash.o): relocation R_X86_64_PC32 against `strlen@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC /tmp/obj/tmp/r269649/tmp/usr/bin/ld: final link failed: Bad value cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [m4] Error code 1 make[4]: stopped in /tmp/r269649/usr.bin/m4 1 error make[4]: stopped in /tmp/r269649/usr.bin/m4 *** [all_subdir_m4] Error code 2 make[3]: stopped in /tmp/r269649/usr.bin 1 error make[3]: stopped in /tmp/r269649/usr.bin *** [usr.bin.all__D] Error code 2 make[2]: stopped in /tmp/r269649 1 error make[2]: stopped in /tmp/r269649 *** [everything] Error code 2 make[1]: stopped in /tmp/r269649 1 error make[1]: stopped in /tmp/r269649 *** [buildworld] Error code 2 make: stopped in /tmp/r269649 1 error make: stopped in /tmp/r269649 From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 16:59:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 913A5448 for ; Sun, 10 Aug 2014 16:59:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F5812701 for ; Sun, 10 Aug 2014 16:59:40 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 2898 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 16:59:39 +0000 From: Konstantin Belousov Date: Sun, 10 Aug 2014 16:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269782 - in head/sys/sparc64: include sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7a4fc.2898.352aa941@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 16:59:40 -0000 Author: kib Date: Sun Aug 10 16:59:39 2014 New Revision: 269782 URL: http://svnweb.freebsd.org/changeset/base/269782 Log: On sparc64, do not keep mappings for the destroyed sf_bufs. Sparc64 pmap, unlike i386, and similar to i386/xen pv, does not tolerate abandoned mappings for the freed pages. Reported and tested by: dumbbell Diagnosed and reviewed by: alc Sponsored by: The FreeBSD Foundation Added: head/sys/sparc64/include/sf_buf.h - copied, changed from r269781, head/sys/i386/include/sf_buf.h Modified: head/sys/sparc64/include/vmparam.h head/sys/sparc64/sparc64/vm_machdep.c Copied and modified: head/sys/sparc64/include/sf_buf.h (from r269781, head/sys/i386/include/sf_buf.h) ============================================================================== --- head/sys/i386/include/sf_buf.h Sun Aug 10 15:21:26 2014 (r269781, copy source) +++ head/sys/sparc64/include/sf_buf.h Sun Aug 10 16:59:39 2014 (r269782) @@ -31,6 +31,5 @@ void sf_buf_map(struct sf_buf *, int); int sf_buf_unmap(struct sf_buf *); -boolean_t sf_buf_invalidate_cache(vm_page_t); #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Sun Aug 10 15:21:26 2014 (r269781) +++ head/sys/sparc64/include/vmparam.h Sun Aug 10 16:59:39 2014 (r269782) @@ -240,6 +240,6 @@ extern vm_offset_t vm_max_kernel_address #define ZERO_REGION_SIZE PAGE_SIZE #define SFBUF -#define SFBUF_NOMD +#define SFBUF_MAP #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Sun Aug 10 15:21:26 2014 (r269781) +++ head/sys/sparc64/sparc64/vm_machdep.c Sun Aug 10 16:59:39 2014 (r269782) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -443,3 +444,18 @@ uma_small_free(void *mem, int size, u_in vm_page_free(m); atomic_subtract_int(&vm_cnt.v_wire_count, 1); } + +void +sf_buf_map(struct sf_buf *sf, int flags) +{ + + pmap_qenter(sf->kva, &sf->m, 1); +} + +int +sf_buf_unmap(struct sf_buf *sf) +{ + + pmap_qremove(sf->kva, 1); + return (1); +} From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 17:04:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36FAE70E for ; Sun, 10 Aug 2014 17:04:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22E2127C6 for ; Sun, 10 Aug 2014 17:04:12 +0000 (UTC) Received: from dumbbell (uid 1042) (envelope-from dumbbell@FreeBSD.org) id 2c0b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 17:04:10 +0000 From: Jean-Sebastien Pedron Date: Sun, 10 Aug 2014 17:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269783 - in head/sys/dev: fb vt/colors vt/hw/efifb vt/hw/fb vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7a60a.2c0b.7349c23c@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 17:04:12 -0000 Author: dumbbell Date: Sun Aug 10 17:04:10 2014 New Revision: 269783 URL: http://svnweb.freebsd.org/changeset/base/269783 Log: vt(4): Colors are indexed against a console palette, not a VGA palette Rename vt_generate_vga_palette() to vt_generate_cons_palette() and change it to build a palette where the color index is the same than in terminal escape codes, not the VGA index. That's what TCHAR_CREATE() uses and passes to vt(4). The main differences between both orders are: o Blue and red are swapped (1 <-> 4) o Yellow and cyan are swapped (3 <-> 6) The problem remained unnoticed, because the RGB bit indexes passed to vt_generate_vga_palette() were reversed. This inversion was cancelled by the colors inversions in the generated palette. For instance, red (0xff0000) and blue (0x0000ff) have bytes in opposite order, but were swapped in the palette. But after changing the value of blue (see last paragraph), the modified color was in fact the red one. This commit includes a fix to creator_vt.c, submitted by Nathan Whitehorn: fb_cmsize is set to 16. Before this, the generated palette would be overwritte. This fixes colors on sparc64 with a Creator3D adapter. While here, tune the palette to better match console colors and improve the readability (especially the dark blue). Submitted by: nwhitehorn (fix to creator_vt.c) MFC after: 1 week Modified: head/sys/dev/fb/creator_vt.c head/sys/dev/vt/colors/vt_termcolors.c head/sys/dev/vt/colors/vt_termcolors.h head/sys/dev/vt/hw/efifb/efifb.c head/sys/dev/vt/hw/fb/vt_early_fb.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/fb/creator_vt.c ============================================================================== --- head/sys/dev/fb/creator_vt.c Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/fb/creator_vt.c Sun Aug 10 17:04:10 2014 (r269783) @@ -151,8 +151,9 @@ creatorfb_init(struct vt_device *vd) sc->memh = sparc64_fake_bustag(space, phys, &sc->memt[0]); /* 32-bit VGA palette */ - vt_generate_vga_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, - 255, 16, 255, 8, 255, 0); + vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, + 255, 0, 255, 8, 255, 16); + sc->fb.fb_cmsize = 16; vt_fb_init(vd); Modified: head/sys/dev/vt/colors/vt_termcolors.c ============================================================================== --- head/sys/dev/vt/colors/vt_termcolors.c Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/vt/colors/vt_termcolors.c Sun Aug 10 17:04:10 2014 (r269783) @@ -39,25 +39,36 @@ static struct { unsigned char b; /* Blue percentage value. */ } color_def[16] = { {0, 0, 0}, /* black */ - {0, 0, 50}, /* dark blue */ - {0, 50, 0}, /* dark green */ - {0, 50, 50}, /* dark cyan */ {50, 0, 0}, /* dark red */ + {0, 50, 0}, /* dark green */ + {77, 63, 0}, /* dark yellow */ + {20, 40, 64}, /* dark blue */ {50, 0, 50}, /* dark magenta */ - {50, 50, 0}, /* brown */ + {0, 50, 50}, /* dark cyan */ {75, 75, 75}, /* light gray */ - {50, 50, 50}, /* dark gray */ - {0, 0, 100}, /* light blue */ - {0, 100, 0}, /* light green */ - {0, 100, 100}, /* light cyan */ + + {18, 20, 21}, /* dark gray */ {100, 0, 0}, /* light red */ + {0, 100, 0}, /* light green */ + {100, 100, 0}, /* light yellow */ + {45, 62, 81}, /* light blue */ {100, 0, 100}, /* light magenta */ - {100, 100, 0}, /* yellow */ + {0, 100, 100}, /* light cyan */ {100, 100, 100}, /* white */ }; +/* + * Between console's palette and VGA's one: + * - blue and red are swapped (1 <-> 4) + * - yellow ad cyan are swapped (3 <-> 6) + */ +static const int cons_to_vga_colors[16] = { + 0, 4, 2, 6, 1, 5, 3, 7, + 0, 4, 2, 6, 1, 5, 3, 7 +}; + int -vt_generate_vga_palette(uint32_t *palette, int format, uint32_t rmax, int roffset, +vt_generate_cons_palette(uint32_t *palette, int format, uint32_t rmax, int roffset, uint32_t gmax, int goffset, uint32_t bmax, int boffset) { int i; @@ -66,7 +77,7 @@ vt_generate_vga_palette(uint32_t *palett for (i = 0; i < 16; i++) { switch (format) { case COLOR_FORMAT_VGA: - palette[i] = i; + palette[i] = cons_to_vga_colors[i]; break; case COLOR_FORMAT_RGB: palette[i] = CF(r, i) | CF(g, i) | CF(b, i); Modified: head/sys/dev/vt/colors/vt_termcolors.h ============================================================================== --- head/sys/dev/vt/colors/vt_termcolors.h Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/vt/colors/vt_termcolors.h Sun Aug 10 17:04:10 2014 (r269783) @@ -45,6 +45,6 @@ enum vt_color_format { }; /* Helper to fill color map used by driver */ -int vt_generate_vga_palette(uint32_t *palette, int format, uint32_t rmax, +int vt_generate_cons_palette(uint32_t *palette, int format, uint32_t rmax, int roffset, uint32_t gmax, int goffset, uint32_t bmax, int boffset); Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/vt/hw/efifb/efifb.c Sun Aug 10 17:04:10 2014 (r269783) @@ -129,7 +129,7 @@ vt_efifb_init(struct vt_device *vd) info->fb_stride = efifb->fb_stride * (depth / 8); - vt_generate_vga_palette(info->fb_cmap, COLOR_FORMAT_RGB, + vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, efifb->fb_mask_red, ffs(efifb->fb_mask_red) - 1, efifb->fb_mask_green, ffs(efifb->fb_mask_green) - 1, efifb->fb_mask_blue, ffs(efifb->fb_mask_blue) - 1); Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Sun Aug 10 17:04:10 2014 (r269783) @@ -90,25 +90,25 @@ vt_efb_initialize(struct fb_info *info) */ switch (info->fb_depth) { case 8: - vt_generate_vga_palette(info->fb_cmap, COLOR_FORMAT_RGB, + vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, 0x7, 5, 0x7, 2, 0x3, 0); break; case 15: - vt_generate_vga_palette(info->fb_cmap, COLOR_FORMAT_RGB, + vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, 0x1f, 10, 0x1f, 5, 0x1f, 0); break; case 16: - vt_generate_vga_palette(info->fb_cmap, COLOR_FORMAT_RGB, + vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, 0x1f, 11, 0x3f, 5, 0x1f, 0); break; case 24: case 32: #if BYTE_ORDER == BIG_ENDIAN - vt_generate_vga_palette(info->fb_cmap, - COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); -#else - vt_generate_vga_palette(info->fb_cmap, + vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB, 255, 0, 255, 8, 255, 16); +#else + vt_generate_cons_palette(info->fb_cmap, + COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); #endif #ifdef FDT for (i = 0; i < 16; i++) { Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/vt/hw/fb/vt_fb.c Sun Aug 10 17:04:10 2014 (r269783) @@ -333,18 +333,18 @@ vt_fb_init_cmap(uint32_t *cmap, int dept switch (depth) { case 8: - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, 0x7, 5, 0x7, 2, 0x3, 0)); case 15: - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, 0x1f, 10, 0x1f, 5, 0x1f, 0)); case 16: - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, 0x1f, 11, 0x3f, 5, 0x1f, 0)); case 24: case 32: /* Ignore alpha. */ - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, - 0xff, 0, 0xff, 8, 0xff, 16)); + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, + 0xff, 16, 0xff, 8, 0xff, 0)); default: return (1); } Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun Aug 10 16:59:39 2014 (r269782) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun Aug 10 17:04:10 2014 (r269783) @@ -205,8 +205,8 @@ ofwfb_initialize(struct vt_device *vd) switch (sc->fb.fb_bpp) { case 8: - vt_generate_vga_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255, - 0, 255, 8, 255, 16); + vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255, + 16, 255, 8, 255, 0); for (i = 0; i < 16; i++) { OF_call_method("color!", sc->sc_handle, 4, 1, @@ -228,11 +228,11 @@ ofwfb_initialize(struct vt_device *vd) oldpix = bus_space_read_4(sc->sc_memt, sc->fb.fb_vbase, 0); bus_space_write_4(sc->sc_memt, sc->fb.fb_vbase, 0, 0xff000000); if (*(uint8_t *)(sc->fb.fb_vbase) == 0xff) - vt_generate_vga_palette(sc->fb.fb_cmap, - COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); - else - vt_generate_vga_palette(sc->fb.fb_cmap, + vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255, 0, 255, 8, 255, 16); + else + vt_generate_cons_palette(sc->fb.fb_cmap, + COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); bus_space_write_4(sc->sc_memt, sc->fb.fb_vbase, 0, oldpix); break; From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 19:14:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F2D7907; Sun, 10 Aug 2014 19:14:15 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 345042560; Sun, 10 Aug 2014 19:14:15 +0000 (UTC) Received: from [IPv6:2601:9:8280:5fd:29b0:4ef8:aab2:5b94] (unknown [IPv6:2601:9:8280:5fd:29b0:4ef8:aab2:5b94]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 92E5E34AAC9; Sun, 10 Aug 2014 12:14:13 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269777 - head/sys/netinet/cc From: Rui Paulo In-Reply-To: <53e7249b.20e4.485017ca@svn.freebsd.org> Date: Sun, 10 Aug 2014 12:14:35 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <53e7249b.20e4.485017ca@svn.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 19:14:15 -0000 On Aug 10, 2014, at 0:51, Hans Petter Selasky = wrote: > Author: hselasky > Date: Sun Aug 10 07:51:55 2014 > New Revision: 269777 > URL: http://svnweb.freebsd.org/changeset/base/269777 >=20 > Log: > Fix string length argument passed to "sysctl_handle_string()" so that > the complete string is returned by the function and not just only one > byte. >=20 > PR: 192544 > MFC after: 2 weeks >=20 > Modified: > head/sys/netinet/cc/cc.c >=20 > Modified: head/sys/netinet/cc/cc.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet/cc/cc.c Sun Aug 10 06:56:43 2014 = (r269776) > +++ head/sys/netinet/cc/cc.c Sun Aug 10 07:51:55 2014 = (r269777) > @@ -101,7 +101,7 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) > CC_LIST_RLOCK(); > strlcpy(default_cc, CC_DEFAULT()->name, = TCP_CA_NAME_MAX); > CC_LIST_RUNLOCK(); > - err =3D sysctl_handle_string(oidp, default_cc, 1, req); > + err =3D sysctl_handle_string(oidp, default_cc, 0, req); > } else { > /* Find algo with specified name and set it to default. = */ > CC_LIST_RLOCK(); > @@ -166,7 +166,7 @@ cc_list_available(SYSCTL_HANDLER_ARGS) >=20 > if (!err) { > sbuf_finish(s); > - err =3D sysctl_handle_string(oidp, sbuf_data(s), 1, = req); > + err =3D sysctl_handle_string(oidp, sbuf_data(s), 0, = req); > } >=20 > sbuf_delete(s); >=20 Are you sure this is still correct? The len parameter should probably = be sbuf_len(s). -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 20:05:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE866568 for ; Sun, 10 Aug 2014 20:05:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83B952911 for ; Sun, 10 Aug 2014 20:05:13 +0000 (UTC) Received: from rmacklem (uid 1196) (envelope-from rmacklem@FreeBSD.org) id 29ab by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 20:05:13 +0000 From: Rick Macklem Date: Sun, 10 Aug 2014 20:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269788 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7d079.29ab.511a0bf3@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 20:05:13 -0000 Author: rmacklem Date: Sun Aug 10 20:05:13 2014 New Revision: 269788 URL: http://svnweb.freebsd.org/changeset/base/269788 Log: Document the use of the vfs.nfsd sysctls that control the size of the NFS server's DRC for TCP. This is a content change. MFC after: 1 week Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Sun Aug 10 18:13:50 2014 (r269787) +++ head/usr.sbin/nfsd/nfsd.8 Sun Aug 10 20:05:13 2014 (r269788) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd July 18, 2014 +.Dd August 10, 2014 .Dt NFSD 8 .Os .Sh NAME @@ -175,6 +175,24 @@ utility would then be used to block nfs-related packets that come in on the outside interface. .Pp +If the server has stopped servicing clients and has generated a console message +like +.Dq Li "nfsd server cache flooded..." , +the value for vfs.nfsd.tcphighwater needs to be increased. +This should allow the server to again handle requests without a reboot. +Also, you may want to consider decreasing the value for +vfs.nfsd.tcpcachetimeo to several minutes (in seconds) instead of 12 hours +when this occurs. +.Pp +Unfortunately making vfs.nfsd.tcphighwater too large can result in the mbuf +limit being reached, as indicated by a console message +like +.Dq Li "kern.ipc.nmbufs limit reached" . +If you cannot find values of the above +.Nm sysctl +values that work, you can disable the DRC cache for TCP by setting +vfs.nfsd.cachetcp to 0. +.Pp The .Nm utility has to be terminated with From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 21:17:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EAA0849 for ; Sun, 10 Aug 2014 21:17:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65C6420A6 for ; Sun, 10 Aug 2014 21:17:20 +0000 (UTC) Received: from gavin (uid 1136) (envelope-from gavin@FreeBSD.org) id 27d1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 21:17:20 +0000 From: Gavin Atkinson Date: Sun, 10 Aug 2014 21:17: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: r269789 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7e160.27d1.6ba150cc@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 21:17:20 -0000 Author: gavin Date: Sun Aug 10 21:17:19 2014 New Revision: 269789 URL: http://svnweb.freebsd.org/changeset/base/269789 Log: Merge r269489 from head (by peter): r262867 was described as fixing socket buffer checks for SOCK_SEQPACKET, but also changed one of the SOCK_DGRAM code paths to use the new sbappendaddr_nospacecheck_locked() function. This lead to SOCK_DGRAM bypassing socket buffer limits. Modified: stable/9/sys/kern/uipc_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_usrreq.c ============================================================================== --- stable/9/sys/kern/uipc_usrreq.c Sun Aug 10 20:05:13 2014 (r269788) +++ stable/9/sys/kern/uipc_usrreq.c Sun Aug 10 21:17:19 2014 (r269789) @@ -876,7 +876,7 @@ uipc_send(struct socket *so, int flags, from = &sun_noname; so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_rcv); - if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, from, m, + if (sbappendaddr_locked(&so2->so_rcv, from, m, control)) { sorwakeup_locked(so2); m = NULL; From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 21:45:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E90F6D4E for ; Sun, 10 Aug 2014 21:45:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA35823D9 for ; Sun, 10 Aug 2014 21:45:58 +0000 (UTC) Received: from sbruno (uid 1179) (envelope-from sbruno@FreeBSD.org) id 225d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 21:45:58 +0000 From: Sean Bruno Date: Sun, 10 Aug 2014 21:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269790 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7e816.225d.2dfec8dd@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 21:45:59 -0000 Author: sbruno Date: Sun Aug 10 21:45:58 2014 New Revision: 269790 URL: http://svnweb.freebsd.org/changeset/base/269790 Log: MFC r268954 Merge change from upstream linux kernel submitted by OpenBSD: drm/radeon: fix-up some float to fixed conversion thinkos Remove #ifdef DUMBBELL_WIP in favor of upstream fix. Modified: stable/10/sys/dev/drm2/radeon/rs690.c stable/10/sys/dev/drm2/radeon/rv515.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/rs690.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/rs690.c Sun Aug 10 21:17:19 2014 (r269789) +++ stable/10/sys/dev/drm2/radeon/rs690.c Sun Aug 10 21:45:58 2014 (r269790) @@ -308,12 +308,11 @@ static void rs690_crtc_bandwidth_compute if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full && rdev->pm.sideport_bandwidth.full) rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth; -#ifdef DUMBBELL_WIP - read_delay_latency.full = dfixed_const(370 * 800 * 1000); -#endif /* DUMBBELL_WIP */ - read_delay_latency.full = UINT_MAX; - read_delay_latency.full = dfixed_div(read_delay_latency, - rdev->pm.igp_sideport_mclk); + read_delay_latency.full = dfixed_const(370 * 800); + a.full = dfixed_const(1000); + b.full = dfixed_div(rdev->pm.igp_sideport_mclk, a); + read_delay_latency.full = dfixed_div(read_delay_latency, b); + read_delay_latency.full = dfixed_mul(read_delay_latency, a); } else { if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full && rdev->pm.k8_bandwidth.full) @@ -488,14 +487,10 @@ void rs690_bandwidth_update(struct radeo } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -526,8 +521,6 @@ void rs690_bandwidth_update(struct radeo } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -555,8 +548,6 @@ void rs690_bandwidth_update(struct radeo } if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d2mode_priority_a_cnt = dfixed_trunc(priority_mark12); Modified: stable/10/sys/dev/drm2/radeon/rv515.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/rv515.c Sun Aug 10 21:17:19 2014 (r269789) +++ stable/10/sys/dev/drm2/radeon/rv515.c Sun Aug 10 21:45:58 2014 (r269790) @@ -1087,14 +1087,10 @@ void rv515_bandwidth_avivo_update(struct } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -1125,8 +1121,6 @@ void rv515_bandwidth_avivo_update(struct } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -1154,8 +1148,6 @@ void rv515_bandwidth_avivo_update(struct } if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d2mode_priority_a_cnt = dfixed_trunc(priority_mark12); From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 22:24:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16D7F8F3 for ; Sun, 10 Aug 2014 22:24:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E087F2701 for ; Sun, 10 Aug 2014 22:24:14 +0000 (UTC) Received: from dumbbell (uid 1042) (envelope-from dumbbell@FreeBSD.org) id 23d4 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 22:24:14 +0000 From: Jean-Sebastien Pedron Date: Sun, 10 Aug 2014 22:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269791 - in head/sys: arm/freescale/imx powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7f10e.23d4.5ab585c1@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 22:24:15 -0000 Author: dumbbell Date: Sun Aug 10 22:24:14 2014 New Revision: 269791 URL: http://svnweb.freebsd.org/changeset/base/269791 Log: Fix two files forgotten in r269783 (vt_generate_cons_palette) Reported by: bz MFC after: 1 week MFC with: 269783 Modified: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Aug 10 21:45:58 2014 (r269790) +++ head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Sun Aug 10 22:24:14 2014 (r269791) @@ -163,18 +163,18 @@ ipu3_fb_init_cmap(uint32_t *cmap, int by switch (bytespp) { case 8: - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, 0x7, 5, 0x7, 2, 0x3, 0)); case 15: - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, 0x1f, 10, 0x1f, 5, 0x1f, 0)); case 16: - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, 0x1f, 11, 0x3f, 5, 0x1f, 0)); case 24: case 32: /* Ignore alpha. */ - return (vt_generate_vga_palette(cmap, COLOR_FORMAT_RGB, - 0xff, 16, 0xff, 8, 0xff, 0)); + return (vt_generate_cons_palette(cmap, COLOR_FORMAT_RGB, + 0xff, 0, 0xff, 8, 0xff, 16)); default: return (1); } Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Sun Aug 10 21:45:58 2014 (r269790) +++ head/sys/powerpc/ps3/ps3_syscons.c Sun Aug 10 22:24:14 2014 (r269791) @@ -178,8 +178,8 @@ ps3fb_init(struct vt_device *vd) sc->fb_info.fb_vbase = 0x10000000; /* 32-bit VGA palette */ - vt_generate_vga_palette(sc->fb_info.fb_cmap, COLOR_FORMAT_RGB, - 255, 16, 255, 8, 255, 0); + vt_generate_cons_palette(sc->fb_info.fb_cmap, COLOR_FORMAT_RGB, + 255, 0, 255, 8, 255, 16); /* Set correct graphics context */ lv1_gpu_context_attribute(sc->sc_fbcontext, From owner-svn-src-all@FreeBSD.ORG Sun Aug 10 22:26:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DF5CBD6 for ; Sun, 10 Aug 2014 22:26:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AEEA271F for ; Sun, 10 Aug 2014 22:26:31 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2402 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 10 Aug 2014 22:26:29 +0000 From: Ian Lepore Date: Sun, 10 Aug 2014 22:26: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: r269792 - in stable/10: contrib/libstdc++/libsupc++ lib/libc lib/libc/arm lib/libc/arm/aeabi sys/arm/include sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e7f196.2402.5912252@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2014 22:26:31 -0000 Author: ian Date: Sun Aug 10 22:26:29 2014 New Revision: 269792 URL: http://svnweb.freebsd.org/changeset/base/269792 Log: MFC r268993, r268893, r268994, plus partial r264070, r264082 Fix C++ exception handling for ARM EABI. Just the part of r264070 that creates the FBSD_1.4 namespace in libc is hand-applied, and then r264082 which creates the Versions.def entry is MFC'd. Added: stable/10/lib/libc/arm/aeabi/aeabi_unwind_exidx.c - copied unchanged from r268893, head/lib/libc/arm/aeabi/aeabi_unwind_exidx.c Modified: stable/10/contrib/libstdc++/libsupc++/unwind-cxx.h stable/10/lib/libc/Versions.def stable/10/lib/libc/arm/Symbol.map stable/10/lib/libc/arm/aeabi/Makefile.inc stable/10/sys/arm/include/elf.h stable/10/sys/sys/link_elf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/10/contrib/libstdc++/libsupc++/unwind-cxx.h Sun Aug 10 22:24:14 2014 (r269791) +++ stable/10/contrib/libstdc++/libsupc++/unwind-cxx.h Sun Aug 10 22:26:29 2014 (r269792) @@ -142,9 +142,9 @@ typedef enum { ctm_succeeded = 1, ctm_succeeded_with_ptr_to_base = 2 } __cxa_type_match_result; -extern "C" bool __cxa_type_match(_Unwind_Exception*, const std::type_info*, +extern "C" __cxa_type_match_result __cxa_type_match(_Unwind_Exception*, const std::type_info*, bool, void**); -extern "C" void __cxa_begin_cleanup (_Unwind_Exception*); +extern "C" bool __cxa_begin_cleanup (_Unwind_Exception*); extern "C" void __cxa_end_cleanup (void); #endif Modified: stable/10/lib/libc/Versions.def ============================================================================== --- stable/10/lib/libc/Versions.def Sun Aug 10 22:24:14 2014 (r269791) +++ stable/10/lib/libc/Versions.def Sun Aug 10 22:26:29 2014 (r269792) @@ -23,6 +23,11 @@ FBSD_1.2 { FBSD_1.3 { } FBSD_1.2; +# This version was first added to 11.0-current. +FBSD_1.4 { +} FBSD_1.3; + + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write @@ -30,4 +35,4 @@ FBSD_1.3 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.3; +} FBSD_1.4; Modified: stable/10/lib/libc/arm/Symbol.map ============================================================================== --- stable/10/lib/libc/arm/Symbol.map Sun Aug 10 22:24:14 2014 (r269791) +++ stable/10/lib/libc/arm/Symbol.map Sun Aug 10 22:26:29 2014 (r269792) @@ -37,6 +37,11 @@ FBSD_1.3 { __flt_rounds; }; +FBSD_1.4 { + __gnu_Unwind_Find_exidx; + dl_unwind_find_exidx; +}; + FBSDprivate_1.0 { /* PSEUDO syscalls */ __sys_getlogin; Modified: stable/10/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- stable/10/lib/libc/arm/aeabi/Makefile.inc Sun Aug 10 22:24:14 2014 (r269791) +++ stable/10/lib/libc/arm/aeabi/Makefile.inc Sun Aug 10 22:26:29 2014 (r269792) @@ -5,7 +5,8 @@ SRCS+= aeabi_atexit.c \ aeabi_double.c \ aeabi_float.c \ - aeabi_unwind_cpp.c + aeabi_unwind_cpp.c \ + aeabi_unwind_exidx.c .if ${MACHINE_ARCH:Marmv6*} SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S Copied: stable/10/lib/libc/arm/aeabi/aeabi_unwind_exidx.c (from r268893, head/lib/libc/arm/aeabi/aeabi_unwind_exidx.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/arm/aeabi/aeabi_unwind_exidx.c Sun Aug 10 22:26:29 2014 (r269792, copy of r268893, head/lib/libc/arm/aeabi/aeabi_unwind_exidx.c) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +/* + * ARM EABI unwind helper. + * + * This finds the exidx section address and size associated with a given code + * address. There are separate implementations for static and dynamic code. + * + * GCC expects this function to exist as __gnu_Unwind_Find_exidx(), clang and + * BSD tools expect it to be dl_unwind_find_exidx(). Both have the same API, so + * we set up an alias for GCC. + */ +__strong_reference(dl_unwind_find_exidx, __gnu_Unwind_Find_exidx); + +/* + * Each entry in the exidx section is a pair of 32-bit words. We don't + * interpret the contents of the entries here; this typedef is just a local + * convenience for using sizeof() and doing pointer math. + */ +typedef struct exidx_entry { + uint32_t data[2]; +} exidx_entry; + +#ifdef __PIC__ + +/* + * Unwind helper for dynamically linked code. + * + * This finds the shared object that contains the given address, and returns the + * address of the exidx section in that shared object along with the number of + * entries in that section, or NULL if it wasn't found. + */ +void * +dl_unwind_find_exidx(const void *pc, int *pcount) +{ + const Elf_Phdr *hdr; + struct dl_phdr_info info; + int i; + + if (_rtld_addr_phdr(pc, &info)) { + hdr = info.dlpi_phdr; + for (i = 0; i < info.dlpi_phnum; i++, hdr++) { + if (hdr->p_type == PT_ARM_EXIDX) { + *pcount = hdr->p_memsz / sizeof(exidx_entry); + return ((void *)(info.dlpi_addr + hdr->p_vaddr)); + } + } + } + return (NULL); +} + +#else /* !__PIC__ */ + +/* + * Unwind helper for statically linked code. + * + * In a statically linked program, the linker populates a pair of symbols with + * the addresses of the start and end of the exidx table, so returning the + * address and count of elements is pretty straighforward. + */ +void * +dl_unwind_find_exidx(const void *pc, int *pcount) +{ + extern struct exidx_entry __exidx_start; + extern struct exidx_entry __exidx_end; + + *pcount = (int)(&__exidx_end - &__exidx_start); + return (&__exidx_start); +} + +#endif /* __PIC__ */ + Modified: stable/10/sys/arm/include/elf.h ============================================================================== --- stable/10/sys/arm/include/elf.h Sun Aug 10 22:24:14 2014 (r269791) +++ stable/10/sys/arm/include/elf.h Sun Aug 10 22:26:29 2014 (r269792) @@ -55,6 +55,9 @@ __ElfType(Auxinfo); #define ELF_MACHINE_OK(x) ((x) == EM_ARM) +/* Unwind info section type */ +#define PT_ARM_EXIDX (PT_LOPROC + 1) + /* * Relocation types. */ Modified: stable/10/sys/sys/link_elf.h ============================================================================== --- stable/10/sys/sys/link_elf.h Sun Aug 10 22:24:14 2014 (r269791) +++ stable/10/sys/sys/link_elf.h Sun Aug 10 22:26:29 2014 (r269792) @@ -95,6 +95,10 @@ extern int dl_iterate_phdr(__dl_iterate_ int _rtld_addr_phdr(const void *, struct dl_phdr_info *); int _rtld_get_stack_prot(void); +#ifdef __ARM_EABI__ +void * dl_unwind_find_exidx(const void *, int *); +#endif + __END_DECLS #endif /* _SYS_LINK_ELF_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 00:03:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 698FBE34 for ; Mon, 11 Aug 2014 00:03:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F69F2075 for ; Mon, 11 Aug 2014 00:03:51 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2e6f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 00:03:50 +0000 From: Adrian Chadd Date: Mon, 11 Aug 2014 00:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269793 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e80867.2e6f.7b3e4cec@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 00:03:51 -0000 Author: adrian Date: Mon Aug 11 00:03:50 2014 New Revision: 269793 URL: http://svnweb.freebsd.org/changeset/base/269793 Log: Add some more OS_MARK() probes to the AR9300 HAL. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Sun Aug 10 22:26:29 2014 (r269792) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Mon Aug 11 00:03:50 2014 (r269793) @@ -666,6 +666,7 @@ ar9300_set_power_mode(struct ath_hal *ah HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: %s -> %s (%s)\n", __func__, modes[ar9300_get_power_mode(ah)], modes[mode], set_chip ? "set chip " : ""); + OS_MARK(ah, AH_MARK_CHIP_POWER, mode); switch (mode) { case HAL_PM_AWAKE: @@ -719,8 +720,10 @@ ar9300_set_power_mode(struct ath_hal *ah default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: unknown power mode %u\n", __func__, mode); + OS_MARK(ah, AH_MARK_CHIP_POWER_DONE, -1); return AH_FALSE; } + OS_MARK(ah, AH_MARK_CHIP_POWER_DONE, status); return status; } Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c Sun Aug 10 22:26:29 2014 (r269792) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c Mon Aug 11 00:03:50 2014 (r269793) @@ -113,6 +113,8 @@ ar9300_stop_dma_receive(struct ath_hal * #define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */ #define AH_TIME_QUANTUM 100 /* usec */ + OS_MARK(ah, AH_MARK_RX_CTL, AH_MARK_RX_CTL_DMA_STOP); + if (timeout == 0) { timeout = AH_RX_STOP_DMA_TIMEOUT; } @@ -157,6 +159,9 @@ ar9300_stop_dma_receive(struct ath_hal * OS_REG_WRITE(ah, AR_MACMISC, org_value); + OS_MARK(ah, AH_MARK_RX_CTL, + status ? AH_MARK_RX_CTL_DMA_STOP_OK : AH_MARK_RX_CTL_DMA_STOP_ERR); + return status; #undef AH_RX_STOP_DMA_TIMEOUT #undef AH_TIME_QUANTUM From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 01:10:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90244636 for ; Mon, 11 Aug 2014 01:10:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD1825A2 for ; Mon, 11 Aug 2014 01:10:16 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2b97 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 01:10:16 +0000 From: Ian Lepore Date: Mon, 11 Aug 2014 01:10: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: r269794 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e817f8.2b97.d400ca7@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 01:10:16 -0000 Author: ian Date: Mon Aug 11 01:10:15 2014 New Revision: 269794 URL: http://svnweb.freebsd.org/changeset/base/269794 Log: MFC r269206, r269207, r269208, r269209, r269210, r269211, r269212, r269213, r269214, r269215, r269216, r269217, r269221: busdma-v6 improvements, primarily: - Allocate the temporary segments array per-map rather than per-tag. - Avoid needlessly bouncing IO for mbufs and buffers allocated by bus_dmamem_alloc() (in both situations we known they're allocated on cacheline boundaries and don't need bouncing). - Various minor reformatting and cleanups. Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep-v6.c Mon Aug 11 00:03:50 2014 (r269793) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Mon Aug 11 01:10:15 2014 (r269794) @@ -64,7 +64,10 @@ __FBSDID("$FreeBSD$"); #include #define MAX_BPAGES 64 -#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define MAX_DMA_SEGMENTS 4096 +#define BUS_DMA_EXCL_BOUNCE BUS_DMA_BUS2 +#define BUS_DMA_ALIGN_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_COULD_BOUNCE (BUS_DMA_EXCL_BOUNCE | BUS_DMA_ALIGN_BOUNCE) #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 struct bounce_zone; @@ -94,15 +97,6 @@ struct bus_dma_tag { */ struct arm32_dma_range *ranges; int _nranges; - /* - * Most tags need one or two segments, and can use the local tagsegs - * array. For tags with a larger limit, we'll allocate a bigger array - * on first use. - */ - bus_dma_segment_t *segments; - bus_dma_segment_t tagsegs[2]; - - }; struct bounce_page { @@ -143,9 +137,40 @@ struct bounce_zone { static struct mtx bounce_lock; static int total_bpages; static int busdma_zonecount; +static uint32_t tags_total; +static uint32_t maps_total; +static uint32_t maps_dmamem; +static uint32_t maps_coherent; +static uint64_t maploads_total; +static uint64_t maploads_bounced; +static uint64_t maploads_coherent; +static uint64_t maploads_dmamem; +static uint64_t maploads_mbuf; +static uint64_t maploads_physmem; + static STAILQ_HEAD(, bounce_zone) bounce_zone_list; SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, tags_total, CTLFLAG_RD, &tags_total, 0, + "Number of active tags"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_total, CTLFLAG_RD, &maps_total, 0, + "Number of active maps"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_dmamem, CTLFLAG_RD, &maps_dmamem, 0, + "Number of active maps for bus_dmamem_alloc buffers"); +SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_coherent, CTLFLAG_RD, &maps_coherent, 0, + "Number of active maps with BUS_DMA_COHERENT flag set"); +SYSCTL_UQUAD(_hw_busdma, OID_AUTO, maploads_total, CTLFLAG_RD, &maploads_total, 0, + "Number of load operations performed"); +SYSCTL_UQUAD(_hw_busdma, OID_AUTO, maploads_bounced, CTLFLAG_RD, &maploads_bounced, 0, + "Number of load operations that used bounce buffers"); +SYSCTL_UQUAD(_hw_busdma, OID_AUTO, maploads_coherent, CTLFLAG_RD, &maploads_dmamem, 0, + "Number of load operations on BUS_DMA_COHERENT memory"); +SYSCTL_UQUAD(_hw_busdma, OID_AUTO, maploads_dmamem, CTLFLAG_RD, &maploads_dmamem, 0, + "Number of load operations on bus_dmamem_alloc buffers"); +SYSCTL_UQUAD(_hw_busdma, OID_AUTO, maploads_mbuf, CTLFLAG_RD, &maploads_mbuf, 0, + "Number of load operations for mbufs"); +SYSCTL_UQUAD(_hw_busdma, OID_AUTO, maploads_physmem, CTLFLAG_RD, &maploads_physmem, 0, + "Number of load operations on physical buffers"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -160,7 +185,10 @@ struct bus_dmamap { void *callback_arg; int flags; #define DMAMAP_COHERENT (1 << 0) +#define DMAMAP_DMAMEM_ALLOC (1 << 1) +#define DMAMAP_MBUF (1 << 2) STAILQ_ENTRY(bus_dmamap) links; + bus_dma_segment_t *segments; int sync_count; struct sync_list slist[]; }; @@ -177,7 +205,6 @@ static bus_addr_t add_bounce_page(bus_dm vm_offset_t vaddr, bus_addr_t addr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr, bus_size_t size, int coherent); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_size_t buflen, int flags); static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, @@ -229,62 +256,135 @@ busdma_init(void *dummy) */ SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL); -static __inline int -_bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) +static int +exclusion_bounce_check(vm_offset_t lowaddr, vm_offset_t highaddr) { int i; for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { - if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) - || (lowaddr < phys_avail[i] && - highaddr > phys_avail[i])) + if ((lowaddr >= phys_avail[i] && lowaddr < phys_avail[i + 1]) || + (lowaddr < phys_avail[i] && highaddr >= phys_avail[i])) return (1); } return (0); } -static __inline struct arm32_dma_range * -_bus_dma_inrange(struct arm32_dma_range *ranges, int nranges, - bus_addr_t curaddr) +/* + * Return true if the tag has an exclusion zone that could lead to bouncing. + */ +static __inline int +exclusion_bounce(bus_dma_tag_t dmat) { - struct arm32_dma_range *dr; - int i; - for (i = 0, dr = ranges; i < nranges; i++, dr++) { - if (curaddr >= dr->dr_sysbase && - round_page(curaddr) <= (dr->dr_sysbase + dr->dr_len)) - return (dr); - } + return (dmat->flags & BUS_DMA_EXCL_BOUNCE); +} - return (NULL); +/* + * Return true if the given address does not fall on the alignment boundary. + */ +static __inline int +alignment_bounce(bus_dma_tag_t dmat, bus_addr_t addr) +{ + + return (addr & (dmat->alignment - 1)); +} + +/* + * Return true if the DMA should bounce because the start or end does not fall + * on a cacheline boundary (which would require a partial cacheline flush). + * COHERENT memory doesn't trigger cacheline flushes. Memory allocated by + * bus_dmamem_alloc() is always aligned to cacheline boundaries, and there's a + * strict rule that such memory cannot be accessed by the CPU while DMA is in + * progress (or by multiple DMA engines at once), so that it's always safe to do + * full cacheline flushes even if that affects memory outside the range of a + * given DMA operation that doesn't involve the full allocated buffer. If we're + * mapping an mbuf, that follows the same rules as a buffer we allocated. + */ +static __inline int +cacheline_bounce(bus_dmamap_t map, bus_addr_t addr, bus_size_t size) +{ + + if (map->flags & (DMAMAP_DMAMEM_ALLOC | DMAMAP_COHERENT | DMAMAP_MBUF)) + return (0); + return ((addr | size) & arm_dcache_align_mask); } /* - * Return true if a match is made. + * Return true if we might need to bounce the DMA described by addr and size. * - * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. + * This is used to quick-check whether we need to do the more expensive work of + * checking the DMA page-by-page looking for alignment and exclusion bounces. * - * If paddr is within the bounds of the dma tag then call the filter callback - * to check for a match, if there is no filter callback then assume a match. + * Note that the addr argument might be either virtual or physical. It doesn't + * matter because we only look at the low-order bits, which are the same in both + * address spaces. */ -int -run_filter(bus_dma_tag_t dmat, bus_addr_t paddr, bus_size_t size, int coherent) +static __inline int +might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t addr, + bus_size_t size) { - int retval; + return ((dmat->flags & BUS_DMA_EXCL_BOUNCE) || + alignment_bounce(dmat, addr) || + cacheline_bounce(map, addr, size)); +} - retval = 0; +/* + * Return true if we must bounce the DMA described by paddr and size. + * + * Bouncing can be triggered by DMA that doesn't begin and end on cacheline + * boundaries, or doesn't begin on an alignment boundary, or falls within the + * exclusion zone of any tag in the ancestry chain. + * + * For exclusions, walk the chain of tags comparing paddr to the exclusion zone + * within each tag. If the tag has a filter function, use it to decide whether + * the DMA needs to bounce, otherwise any DMA within the zone bounces. + */ +static int +must_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr, + bus_size_t size) +{ - do { - if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) - || ((paddr & (dmat->alignment - 1)) != 0) || - (!coherent && (size & arm_dcache_align_mask)) || - (!coherent && (paddr & arm_dcache_align_mask))) - && (dmat->filter == NULL - || (*dmat->filter)(dmat->filterarg, paddr) != 0)) - retval = 1; + if (cacheline_bounce(map, paddr, size)) + return (1); + /* + * The tag already contains ancestors' alignment restrictions so this + * check doesn't need to be inside the loop. + */ + if (alignment_bounce(dmat, paddr)) + return (1); + + /* + * Even though each tag has an exclusion zone that is a superset of its + * own and all its ancestors' exclusions, the exclusion zone of each tag + * up the chain must be checked within the loop, because the busdma + * rules say the filter function is called only when the address lies + * within the low-highaddr range of the tag that filterfunc belongs to. + */ + while (dmat != NULL && exclusion_bounce(dmat)) { + if ((paddr >= dmat->lowaddr && paddr <= dmat->highaddr) && + (dmat->filter == NULL || + dmat->filter(dmat->filterarg, paddr) != 0)) + return (1); dmat = dmat->parent; - } while (retval == 0 && dmat != NULL); - return (retval); + } + + return (0); +} + +static __inline struct arm32_dma_range * +_bus_dma_inrange(struct arm32_dma_range *ranges, int nranges, + bus_addr_t curaddr) +{ + struct arm32_dma_range *dr; + int i; + + for (i = 0, dr = ranges; i < nranges; i++, dr++) { + if (curaddr >= dr->dr_sysbase && + round_page(curaddr) <= (dr->dr_sysbase + dr->dr_len)) + return (dr); + } + + return (NULL); } /* @@ -384,34 +484,21 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } - /* - * If all the segments we need fit into the local tagsegs array, set the - * pointer now. Otherwise NULL the pointer and an array of segments - * will be allocated later, on first use. We don't pre-allocate now - * because some tags exist just to pass contraints to children in the - * device hierarchy, and they tend to use BUS_SPACE_UNRESTRICTED and we - * sure don't want to try to allocate an array for that. - */ - if (newtag->nsegments <= nitems(newtag->tagsegs)) - newtag->segments = newtag->tagsegs; - else - newtag->segments = NULL; /* Take into account any restrictions imposed by our parent tag */ if (parent != NULL) { newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); + newtag->alignment = MAX(parent->alignment, newtag->alignment); + newtag->flags |= parent->flags & BUS_DMA_COULD_BOUNCE; if (newtag->boundary == 0) newtag->boundary = parent->boundary; else if (parent->boundary != 0) newtag->boundary = MIN(parent->boundary, newtag->boundary); - if ((newtag->filter != NULL) || - ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) - newtag->flags |= BUS_DMA_COULD_BOUNCE; if (newtag->filter == NULL) { /* - * Short circuit looking at our parent directly + * Short circuit to looking at our parent directly * since we have encapsulated all of its information */ newtag->filter = parent->filter; @@ -422,9 +509,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, atomic_add_int(&parent->ref_count, 1); } - if (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr) - || newtag->alignment > 1) - newtag->flags |= BUS_DMA_COULD_BOUNCE; + if (exclusion_bounce_check(newtag->lowaddr, newtag->highaddr)) + newtag->flags |= BUS_DMA_EXCL_BOUNCE; + if (alignment_bounce(newtag, 1)) + newtag->flags |= BUS_DMA_ALIGN_BOUNCE; /* * Any request can auto-bounce due to cacheline alignment, in addition @@ -463,6 +551,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, if (error != 0) { free(newtag, M_DEVBUF); } else { + atomic_add_32(&tags_total, 1); *dmat = newtag; } CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", @@ -492,9 +581,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { - if (dmat->segments != NULL && - dmat->segments != dmat->tagsegs) - free(dmat->segments, M_DEVBUF); + atomic_subtract_32(&tags_total, 1); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -534,8 +621,8 @@ static int allocate_bz_and_pages(bus_dma maxpages = MAX_BPAGES; else maxpages = 2 * bz->map_count; - if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (bz->map_count > 0 && bz->total_bpages < maxpages)) { + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = atop(roundup2(dmat->maxsize, PAGE_SIZE)) + 1; @@ -551,6 +638,31 @@ static int allocate_bz_and_pages(bus_dma return (0); } +static bus_dmamap_t +allocate_map(bus_dma_tag_t dmat, int mflags) +{ + int mapsize, segsize; + bus_dmamap_t map; + + /* + * Allocate the map. The map structure ends with an embedded + * variable-sized array of sync_list structures. Following that + * we allocate enough extra space to hold the array of bus_dma_segments. + */ + KASSERT(dmat->nsegments <= MAX_DMA_SEGMENTS, + ("cannot allocate %u dma segments (max is %u)", + dmat->nsegments, MAX_DMA_SEGMENTS)); + segsize = sizeof(struct bus_dma_segment) * dmat->nsegments; + mapsize = sizeof(*map) + sizeof(struct sync_list) * dmat->nsegments; + map = malloc(mapsize + segsize, M_DEVBUF, mflags | M_ZERO); + if (map == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); + return (NULL); + } + map->segments = (bus_dma_segment_t *)((uintptr_t)map + mapsize); + return (map); +} + /* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. @@ -558,41 +670,32 @@ static int allocate_bz_and_pages(bus_dma int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { - int mapsize; + bus_dmamap_t map; int error = 0; - mapsize = sizeof(**mapp) + (sizeof(struct sync_list) * dmat->nsegments); - *mapp = (bus_dmamap_t)malloc(mapsize, M_DEVBUF, M_NOWAIT | M_ZERO); - if (*mapp == NULL) { + *mapp = map = allocate_map(dmat, M_NOWAIT); + if (map == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); return (ENOMEM); } - (*mapp)->sync_count = 0; - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - M_NOWAIT); - if (dmat->segments == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - free(*mapp, M_DEVBUF); - *mapp = NULL; - return (ENOMEM); - } - } /* - * Bouncing might be required if the driver asks for an active - * exclusion region, a data alignment that is stricter than 1, and/or - * an active address boundary. + * Bouncing might be required if the driver asks for an exclusion + * region, a data alignment that is stricter than 1, or DMA that begins + * or ends with a partial cacheline. Whether bouncing will actually + * happen can't be known until mapping time, but we need to pre-allocate + * resources now because we might not be allowed to at mapping time. */ - error = allocate_bz_and_pages(dmat, *mapp); + error = allocate_bz_and_pages(dmat, map); if (error != 0) { - free(*mapp, M_DEVBUF); + free(map, M_DEVBUF); *mapp = NULL; return (error); } - return (error); + if (map->flags & DMAMAP_COHERENT) + atomic_add_32(&maps_coherent, 1); + atomic_add_32(&maps_total, 1); + return (0); } /* @@ -609,6 +712,9 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b } if (dmat->bounce_zone) dmat->bounce_zone->map_count--; + if (map->flags & DMAMAP_COHERENT) + atomic_subtract_32(&maps_coherent, 1); + atomic_subtract_32(&maps_total, 1); free(map, M_DEVBUF); dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); @@ -627,58 +733,33 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi { busdma_bufalloc_t ba; struct busdma_bufzone *bufzone; + bus_dmamap_t map; vm_memattr_t memattr; int mflags; - int mapsize; - int error; if (flags & BUS_DMA_NOWAIT) mflags = M_NOWAIT; else mflags = M_WAITOK; + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; - /* ARM non-snooping caches need a map for the VA cache sync structure */ - - mapsize = sizeof(**mapp) + (sizeof(struct sync_list) * dmat->nsegments); - *mapp = (bus_dmamap_t)malloc(mapsize, M_DEVBUF, M_NOWAIT | M_ZERO); - if (*mapp == NULL) { + *mapp = map = allocate_map(dmat, mflags); + if (map == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, ENOMEM); return (ENOMEM); } + map->flags = DMAMAP_DMAMEM_ALLOC; - (*mapp)->sync_count = 0; - /* We may need bounce pages, even for allocated memory */ - error = allocate_bz_and_pages(dmat, *mapp); - if (error != 0) { - free(*mapp, M_DEVBUF); - *mapp = NULL; - return (error); - } - - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - mflags); - if (dmat->segments == NULL) { - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); - free(*mapp, M_DEVBUF); - *mapp = NULL; - return (ENOMEM); - } - } - - if (flags & BUS_DMA_ZERO) - mflags |= M_ZERO; + /* Choose a busdma buffer allocator based on memory type flags. */ if (flags & BUS_DMA_COHERENT) { memattr = VM_MEMATTR_UNCACHEABLE; ba = coherent_allocator; - (*mapp)->flags |= DMAMAP_COHERENT; + map->flags |= DMAMAP_COHERENT; } else { memattr = VM_MEMATTR_DEFAULT; ba = standard_allocator; - (*mapp)->flags = 0; } /* @@ -702,7 +783,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi * constraints is something that only the contig allocator can fulfill. */ if (bufzone != NULL && dmat->alignment <= bufzone->size && - !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) { + !exclusion_bounce(dmat)) { *vaddr = uma_zalloc(bufzone->umazone, mflags); } else if (dmat->nsegments >= btoc(dmat->maxsize) && dmat->alignment <= PAGE_SIZE && dmat->boundary == 0) { @@ -718,12 +799,16 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, ENOMEM); - free(*mapp, M_DEVBUF); + free(map, M_DEVBUF); *mapp = NULL; return (ENOMEM); } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { printf("bus_dmamem_alloc failed to align memory properly.\n"); } + if (map->flags & DMAMAP_COHERENT) + atomic_add_32(&maps_coherent, 1); + atomic_add_32(&maps_dmamem, 1); + atomic_add_32(&maps_total, 1); dmat->map_count++; CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -751,12 +836,16 @@ bus_dmamem_free(bus_dma_tag_t dmat, void bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); if (bufzone != NULL && dmat->alignment <= bufzone->size && - !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) + !exclusion_bounce(dmat)) uma_zfree(bufzone->umazone, vaddr); else kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->maxsize); dmat->map_count--; + if (map->flags & DMAMAP_COHERENT) + atomic_subtract_32(&maps_coherent, 1); + atomic_subtract_32(&maps_total, 1); + atomic_subtract_32(&maps_dmamem, 1); free(map, M_DEVBUF); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); } @@ -780,8 +869,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma curaddr = buf; while (buflen != 0) { sgsize = MIN(buflen, dmat->maxsegsz); - if (run_filter(dmat, curaddr, sgsize, - map->flags & DMAMAP_COHERENT) != 0) { + if (must_bounce(dmat, map, curaddr, sgsize) != 0) { sgsize = MIN(sgsize, PAGE_SIZE); map->pagesneeded++; } @@ -817,10 +905,9 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm paddr = pmap_kextract(vaddr); else paddr = pmap_extract(map->pmap, vaddr); - if (run_filter(dmat, paddr, - min(vendaddr - vaddr, - (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK))), - map->flags & DMAMAP_COHERENT) != 0) { + if (must_bounce(dmat, map, paddr, + min(vendaddr - vaddr, (PAGE_SIZE - ((vm_offset_t)vaddr & + PAGE_MASK)))) != 0) { map->pagesneeded++; } vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); @@ -934,12 +1021,15 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat int error; if (segs == NULL) - segs = dmat->segments; + segs = map->segments; + + maploads_total++; + maploads_physmem++; - if (((map->flags & DMAMAP_COHERENT) == 0) || - (dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + if (might_bounce(dmat, map, buflen, buflen)) { _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { + maploads_bounced++; error = _bus_dmamap_reserve_pages(dmat, map, flags); if (error) return (error); @@ -949,10 +1039,8 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->maxsegsz); - if ((((map->flags & DMAMAP_COHERENT) == 0) || - ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) && - map->pagesneeded != 0 && run_filter(dmat, curaddr, - sgsize, map->flags & DMAMAP_COHERENT)) { + if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr, + sgsize)) { sgsize = MIN(sgsize, PAGE_SIZE); curaddr = add_bounce_page(dmat, map, 0, curaddr, sgsize); @@ -1004,15 +1092,26 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm struct sync_list *sl; int error; + maploads_total++; + if (map->flags & DMAMAP_COHERENT) + maploads_coherent++; + if (map->flags & DMAMAP_DMAMEM_ALLOC) + maploads_dmamem++; + if (segs == NULL) - segs = dmat->segments; + segs = map->segments; + + if (flags & BUS_DMA_LOAD_MBUF) { + maploads_mbuf++; + map->flags |= DMAMAP_MBUF; + } map->pmap = pmap; - if (!(map->flags & DMAMAP_COHERENT) || - (dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { _bus_dmamap_count_pages(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { + maploads_bounced++; error = _bus_dmamap_reserve_pages(dmat, map, flags); if (error) return (error); @@ -1040,10 +1139,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm if (buflen < sgsize) sgsize = buflen; - if ((((map->flags & DMAMAP_COHERENT) == 0) || - ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) && - map->pagesneeded != 0 && run_filter(dmat, curaddr, - sgsize, map->flags & DMAMAP_COHERENT)) { + if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr, + sgsize)) { curaddr = add_bounce_page(dmat, map, vaddr, curaddr, sgsize); } else { @@ -1100,7 +1197,7 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, { if (segs == NULL) - segs = dmat->segments; + segs = map->segments; return (segs); } @@ -1126,6 +1223,7 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b map->pagesneeded = 0; } map->sync_count = 0; + map->flags &= ~DMAMAP_MBUF; } #ifdef notyetbounceuser @@ -1204,12 +1302,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus while (bpage != NULL) { if (bpage->datavaddr != 0) bcopy((void *)bpage->datavaddr, - (void *)bpage->vaddr, - bpage->datacount); + (void *)bpage->vaddr, + bpage->datacount); else physcopyout(bpage->dataaddr, - (void *)bpage->vaddr, - bpage->datacount); + (void *)bpage->vaddr, + bpage->datacount); cpu_dcache_wb_range((vm_offset_t)bpage->vaddr, bpage->datacount); l2cache_wb_range((vm_offset_t)bpage->vaddr, @@ -1251,12 +1349,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus l2cache_inv_range(startv, startp, len); if (bpage->datavaddr != 0) bcopy((void *)bpage->vaddr, - (void *)bpage->datavaddr, - bpage->datacount); + (void *)bpage->datavaddr, + bpage->datacount); else physcopyin((void *)bpage->vaddr, - bpage->dataaddr, - bpage->datacount); + bpage->dataaddr, + bpage->datacount); bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -1345,8 +1443,8 @@ alloc_bounce_zone(bus_dma_tag_t dmat) /* Check to see if we already have a suitable zone */ STAILQ_FOREACH(bz, &bounce_zone_list, links) { - if ((dmat->alignment <= bz->alignment) - && (dmat->lowaddr >= bz->lowaddr)) { + if ((dmat->alignment <= bz->alignment) && + (dmat->lowaddr >= bz->lowaddr)) { dmat->bounce_zone = bz; return (0); } @@ -1397,7 +1495,7 @@ alloc_bounce_zone(bus_dma_tag_t dmat) SYSCTL_ADD_INT(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "total_bounced", CTLFLAG_RD, &bz->total_bounced, 0, - "Total bounce requests"); + "Total bounce requests (pages bounced)"); SYSCTL_ADD_INT(busdma_sysctl_tree(bz), SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO, "total_deferred", CTLFLAG_RD, &bz->total_deferred, 0, @@ -1424,15 +1522,12 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u struct bounce_page *bpage; bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF, - M_NOWAIT | M_ZERO); + M_NOWAIT | M_ZERO); if (bpage == NULL) break; bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT, 0ul, - bz->lowaddr, - PAGE_SIZE, - 0); + M_NOWAIT, 0ul, bz->lowaddr, PAGE_SIZE, 0); if (bpage->vaddr == 0) { free(bpage, M_DEVBUF); break; @@ -1538,7 +1633,7 @@ free_bounce_page(bus_dma_tag_t dmat, str if (reserve_bounce_pages(map->dmat, map, 1) == 0) { STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links); STAILQ_INSERT_TAIL(&bounce_map_callbacklist, - map, links); + map, links); busdma_swi_pending = 1; bz->total_deferred++; swi_sched(vm_ih, 0); @@ -1558,10 +1653,10 @@ busdma_swi(void) STAILQ_REMOVE_HEAD(&bounce_map_callbacklist, links); mtx_unlock(&bounce_lock); dmat = map->dmat; - (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_LOCK); + dmat->lockfunc(dmat->lockfuncarg, BUS_DMA_LOCK); bus_dmamap_load_mem(map->dmat, map, &map->mem, map->callback, - map->callback_arg, BUS_DMA_WAITOK); - (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_UNLOCK); + map->callback_arg, BUS_DMA_WAITOK); + dmat->lockfunc(dmat->lockfuncarg, BUS_DMA_UNLOCK); mtx_lock(&bounce_lock); } mtx_unlock(&bounce_lock); From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 01:22:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C5C3BC8 for ; Mon, 11 Aug 2014 01:22:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F29892702 for ; Mon, 11 Aug 2014 01:22:10 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2efa by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 01:22:10 +0000 From: Ian Lepore Date: Mon, 11 Aug 2014 01:22: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: r269795 - stable/10/sys/dev/mmc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e81ac2.2efa.2b4eb541@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 01:22:11 -0000 Author: ian Date: Mon Aug 11 01:22:10 2014 New Revision: 269795 URL: http://svnweb.freebsd.org/changeset/base/269795 Log: MFC r269341: Populate disk->d_ident with the sd or mmc card's serial number. Modified: stable/10/sys/dev/mmc/mmc.c stable/10/sys/dev/mmc/mmcsd.c stable/10/sys/dev/mmc/mmcvar.h Modified: stable/10/sys/dev/mmc/mmc.c ============================================================================== --- stable/10/sys/dev/mmc/mmc.c Mon Aug 11 01:10:15 2014 (r269794) +++ stable/10/sys/dev/mmc/mmc.c Mon Aug 11 01:22:10 2014 (r269795) @@ -102,6 +102,7 @@ struct mmc_ivars { uint32_t hs_tran_speed; /* Max speed in high speed mode */ uint32_t erase_sector; /* Card native erase sector size */ char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */ + char card_sn_string[16];/* Formatted serial # for disk->d_ident */ }; #define CMD_RETRIES 3 @@ -887,6 +888,9 @@ mmc_format_card_id_string(struct mmc_iva * mmcsd0: 968MB at mmc0 * 22.5MHz/4bit/128-block * + * Also format just the card serial number, which the mmcsd driver will + * use as the disk->d_ident string. + * * The card_id_string in mmc_ivars is currently allocated as 64 bytes, * and our max formatted length is currently 55 bytes if every field * contains the largest value. @@ -900,8 +904,10 @@ mmc_format_card_id_string(struct mmc_iva snprintf(oidstr, sizeof(oidstr), "%c%c", c1, c2); else snprintf(oidstr, sizeof(oidstr), "0x%04x", ivar->cid.oid); + snprintf(ivar->card_sn_string, sizeof(ivar->card_sn_string), + "%08X", ivar->cid.psn); snprintf(ivar->card_id_string, sizeof(ivar->card_id_string), - "%s%s %s %d.%d SN %u MFG %02d/%04d by %d %s", + "%s%s %s %d.%d SN %08X MFG %02d/%04d by %d %s", ivar->mode == mode_sd ? "SD" : "MMC", ivar->high_cap ? "HC" : "", ivar->cid.pnm, ivar->cid.prv >> 4, ivar->cid.prv & 0x0f, ivar->cid.psn, ivar->cid.mdt_month, ivar->cid.mdt_year, @@ -1698,6 +1704,9 @@ mmc_read_ivar(device_t bus, device_t chi case MMC_IVAR_CARD_ID_STRING: *(char **)result = ivar->card_id_string; break; + case MMC_IVAR_CARD_SN_STRING: + *(char **)result = ivar->card_sn_string; + break; } return (0); } Modified: stable/10/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/10/sys/dev/mmc/mmcsd.c Mon Aug 11 01:10:15 2014 (r269794) +++ stable/10/sys/dev/mmc/mmcsd.c Mon Aug 11 01:22:10 2014 (r269795) @@ -163,6 +163,9 @@ mmcsd_attach(device_t dev) d->d_unit = device_get_unit(dev); d->d_flags = DISKFLAG_CANDELETE; d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize * 1; /* conservative */ + strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); + strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr)); + /* * Display in most natural units. There's no cards < 1MB. The SD * standard goes to 2GiB due to its reliance on FAT, but the data @@ -188,7 +191,7 @@ mmcsd_attach(device_t dev) speed = mmcbr_get_clock(device_get_parent(dev)); maxblocks = mmc_get_max_data(dev); device_printf(dev, "%ju%cB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", - mb, unit, mmc_get_card_id_string(dev), + mb, unit, d->d_descr, mmc_get_read_only(dev) ? " (read-only)" : "", device_get_nameunit(device_get_parent(dev)), speed / 1000000, (speed / 100000) % 10, Modified: stable/10/sys/dev/mmc/mmcvar.h ============================================================================== --- stable/10/sys/dev/mmc/mmcvar.h Mon Aug 11 01:10:15 2014 (r269794) +++ stable/10/sys/dev/mmc/mmcvar.h Mon Aug 11 01:22:10 2014 (r269795) @@ -69,11 +69,12 @@ enum mmc_device_ivars { MMC_IVAR_BUS_WIDTH, MMC_IVAR_ERASE_SECTOR, MMC_IVAR_MAX_DATA, - MMC_IVAR_CARD_ID_STRING + MMC_IVAR_CARD_ID_STRING, + MMC_IVAR_CARD_SN_STRING, }; /* - * Simplified accessors for pci devices + * Simplified accessors for mmc devices */ #define MMC_ACCESSOR(var, ivar, type) \ __BUS_ACCESSOR(mmc, var, MMC, ivar, type) @@ -90,5 +91,6 @@ MMC_ACCESSOR(bus_width, BUS_WIDTH, int) MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int) MMC_ACCESSOR(max_data, MAX_DATA, int) MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *) +MMC_ACCESSOR(card_sn_string, CARD_SN_STRING, const char *) #endif /* DEV_MMC_MMCVAR_H */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 01:29:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D745DBB for ; Mon, 11 Aug 2014 01:29:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040072767 for ; Mon, 11 Aug 2014 01:29:32 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2f47 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 01:29:29 +0000 From: Ian Lepore Date: Mon, 11 Aug 2014 01:29: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: r269796 - in stable/10/sys: arm/arm arm/include libkern/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e81c79.2f47.107c3798@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 01:29:32 -0000 Author: ian Date: Mon Aug 11 01:29:28 2014 New Revision: 269796 URL: http://svnweb.freebsd.org/changeset/base/269796 Log: MFC r269390: Fix unwind info in hand-written asm (avoid nested functions). Modified: stable/10/sys/arm/arm/cpufunc_asm_arm10.S stable/10/sys/arm/arm/cpufunc_asm_arm9.S stable/10/sys/arm/arm/cpufunc_asm_armv5.S stable/10/sys/arm/arm/cpufunc_asm_armv6.S stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/cpufunc_asm_xscale.S stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/10/sys/arm/arm/exception.S stable/10/sys/arm/arm/fusu.S stable/10/sys/arm/arm/locore.S stable/10/sys/arm/arm/setstack.s stable/10/sys/arm/arm/support.S stable/10/sys/arm/include/asm.h stable/10/sys/libkern/arm/divsi3.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_arm10.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm10.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_arm10.S Mon Aug 11 01:29:28 2014 (r269796) @@ -209,7 +209,7 @@ ENTRY_NP(arm10_idcache_wbinv_all) mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ /* Fall through to purge Dcache. */ -ENTRY(arm10_dcache_wbinv_all) +EENTRY(arm10_dcache_wbinv_all) .Larm10_dcache_wbinv_all: ldr ip, .Larm10_cache_data ldmia ip, {s_max, i_max, s_inc, i_inc} @@ -223,8 +223,8 @@ ENTRY(arm10_dcache_wbinv_all) bhs .Lnext_set_inv /* Next set */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ bx lr +EEND(arm10_dcache_wbinv_all) END(arm10_idcache_wbinv_all) -END(arm10_dcache_wbinv_all) .Larm10_cache_data: .word _C_LABEL(arm10_dcache_sets_max) Modified: stable/10/sys/arm/arm/cpufunc_asm_arm9.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_arm9.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_arm9.S Mon Aug 11 01:29:28 2014 (r269796) @@ -197,7 +197,7 @@ ENTRY_NP(arm9_idcache_wbinv_all) mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ /* Fall through */ -ENTRY(arm9_dcache_wbinv_all) +EENTRY(arm9_dcache_wbinv_all) .Larm9_dcache_wbinv_all: ldr ip, .Larm9_cache_data ldmia ip, {s_max, i_max, s_inc, i_inc} @@ -210,8 +210,8 @@ ENTRY(arm9_dcache_wbinv_all) subs s_max, s_max, s_inc bhs .Lnext_set_inv /* Next set */ mov pc, lr +EEND(arm9_dcache_wbinv_all) END(arm9_idcache_wbinv_all) -END(arm9_dcache_wbinv_all) .Larm9_cache_data: .word _C_LABEL(arm9_dcache_sets_max) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv5.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv5.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_armv5.S Mon Aug 11 01:29:28 2014 (r269796) @@ -194,6 +194,7 @@ ENTRY(armv5_idcache_wbinv_range) END(armv5_idcache_wbinv_range) ENTRY_NP(armv5_idcache_wbinv_all) +armv5_idcache_wbinv_all: .Larmv5_idcache_wbinv_all: /* * We assume that the code here can never be out of sync with the @@ -203,7 +204,7 @@ ENTRY_NP(armv5_idcache_wbinv_all) mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ /* Fall through to purge Dcache. */ -ENTRY(armv5_dcache_wbinv_all) +EENTRY(armv5_dcache_wbinv_all) .Larmv5_dcache_wbinv_all: ldr ip, .Larmv5_cache_data ldmia ip, {s_max, i_max, s_inc, i_inc} @@ -219,8 +220,8 @@ ENTRY(armv5_dcache_wbinv_all) bpl 1b /* Next set */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ RET +EEND(armv5_dcache_wbinv_all) END(armv5_idcache_wbinv_all) -END(armv5_dcache_wbinv_all) .Larmv5_cache_data: .word _C_LABEL(armv5_dcache_sets_max) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv6.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_armv6.S Mon Aug 11 01:29:28 2014 (r269796) @@ -137,12 +137,12 @@ ENTRY_NP(armv6_idcache_wbinv_all) /* Fall through to purge Dcache. */ /* LINTSTUB: void armv6_dcache_wbinv_all(void); */ -ENTRY(armv6_dcache_wbinv_all) +EENTRY(armv6_dcache_wbinv_all) mcr p15, 0, r0, c7, c14, 0 /* clean & invalidate D cache */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ RET +EEND(armv6_dcache_wbinv_all) END(armv6_idcache_wbinv_all) -END(armv6_dcache_wbinv_all) ENTRY(armv6_idcache_inv_all) mov r0, #0 Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Mon Aug 11 01:29:28 2014 (r269796) @@ -358,7 +358,7 @@ ENTRY(armv7_idcache_inv_all) mcr p15, 0, r0, c7, c5, 0 @ invalidate instruction+branch cache isb @ instruction sync barrier bx lr @ return -END(armv7_l1cache_inv_all) +END(armv7_idcache_inv_all) ENTRY_NP(armv7_sleep) dsb Modified: stable/10/sys/arm/arm/cpufunc_asm_xscale.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_xscale.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_xscale.S Mon Aug 11 01:29:28 2014 (r269796) @@ -306,11 +306,12 @@ _C_LABEL(xscale_minidata_clean_size): XSCALE_CACHE_CLEAN_UNBLOCK ENTRY_NP(xscale_cache_syncI) -ENTRY_NP(xscale_cache_purgeID) + +EENTRY_NP(xscale_cache_purgeID) mcr p15, 0, r0, c7, c5, 0 /* flush I cache (D cleaned below) */ -ENTRY_NP(xscale_cache_cleanID) -ENTRY_NP(xscale_cache_purgeD) -ENTRY(xscale_cache_cleanD) +EENTRY_NP(xscale_cache_cleanID) +EENTRY_NP(xscale_cache_purgeD) +EENTRY(xscale_cache_cleanD) XSCALE_CACHE_CLEAN_PROLOGUE 1: subs r0, r0, #32 @@ -326,11 +327,11 @@ ENTRY(xscale_cache_cleanD) XSCALE_CACHE_CLEAN_EPILOGUE RET +EEND(xscale_cache_cleanD) +EEND(xscale_cache_purgeD) +EEND(xscale_cache_cleanID) +EEND(xscale_cache_purgeID) END(xscale_cache_syncI) -END(xscale_cache_purgeID) -END(xscale_cache_cleanID) -END(xscale_cache_purgeD) -END(xscale_cache_cleanD) /* * Clean the mini-data cache. @@ -374,7 +375,7 @@ END(xscale_cache_purgeD_E) */ /* xscale_cache_syncI is identical to xscale_cache_purgeID */ -ENTRY(xscale_cache_cleanID_rng) +EENTRY(xscale_cache_cleanID_rng) ENTRY(xscale_cache_cleanD_rng) cmp r1, #0x4000 bcs _C_LABEL(xscale_cache_cleanID) @@ -393,7 +394,7 @@ ENTRY(xscale_cache_cleanD_rng) mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ CPWAIT_AND_RETURN(r0) -END(xscale_cache_cleanID_rng) +/*END(xscale_cache_cleanID_rng)*/ END(xscale_cache_cleanD_rng) ENTRY(xscale_cache_purgeID_rng) Modified: stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Aug 11 01:29:28 2014 (r269796) @@ -143,11 +143,12 @@ __FBSDID("$FreeBSD$"); ENTRY_NP(xscalec3_cache_syncI) -ENTRY_NP(xscalec3_cache_purgeID) +xscalec3_cache_purgeID: +EENTRY_NP(xscalec3_cache_purgeID) mcr p15, 0, r0, c7, c5, 0 /* flush I cache (D cleaned below) */ -ENTRY_NP(xscalec3_cache_cleanID) -ENTRY_NP(xscalec3_cache_purgeD) -ENTRY(xscalec3_cache_cleanD) +EENTRY_NP(xscalec3_cache_cleanID) +EENTRY_NP(xscalec3_cache_purgeD) +EENTRY(xscalec3_cache_cleanD) XSCALE_CACHE_CLEAN_BLOCK mov r0, #0 @@ -168,11 +169,11 @@ ENTRY(xscalec3_cache_cleanD) mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ RET +EEND(xscalec3_cache_purgeID) +EEND(xscalec3_cache_cleanID) +EEND(xscalec3_cache_purgeD) +EEND(xscalec3_cache_cleanD) END(xscalec3_cache_syncI) -END(xscalec3_cache_purgeID) -END(xscalec3_cache_cleanID) -END(xscalec3_cache_purgeD) -END(xscalec3_cache_cleanD) ENTRY(xscalec3_cache_purgeID_rng) @@ -238,7 +239,7 @@ ENTRY(xscalec3_cache_purgeD_rng) END(xscalec3_cache_purgeD_rng) ENTRY(xscalec3_cache_cleanID_rng) -ENTRY(xscalec3_cache_cleanD_rng) +EENTRY(xscalec3_cache_cleanD_rng) cmp r1, #0x4000 bcs _C_LABEL(xscalec3_cache_cleanID) @@ -257,8 +258,8 @@ ENTRY(xscalec3_cache_cleanD_rng) mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ CPWAIT_AND_RETURN(r0) +EEND(xscalec3_cache_cleanD_rng) END(xscalec3_cache_cleanID_rng) -END(xscalec3_cache_cleanD_rng) ENTRY(xscalec3_l2cache_purge) /* Clean-up the L2 cache */ Modified: stable/10/sys/arm/arm/exception.S ============================================================================== --- stable/10/sys/arm/arm/exception.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/exception.S Mon Aug 11 01:29:28 2014 (r269796) @@ -280,12 +280,12 @@ ASENTRY_NP(swi_entry) * that a newly created thread appears to return from a SWI just like * the parent thread that created it. */ -ASENTRY_NP(swi_exit) +ASEENTRY_NP(swi_exit) DO_AST /* Handle pending signals. */ PULLFRAME /* Deallocate trapframe. */ movs pc, lr /* Return to userland. */ STOP_UNWINDING /* Don't unwind into user mode. */ -END(swi_exit) +EEND(swi_exit) END(swi_entry) /* Modified: stable/10/sys/arm/arm/fusu.S ============================================================================== --- stable/10/sys/arm/arm/fusu.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/fusu.S Mon Aug 11 01:29:28 2014 (r269796) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); * Fetch an int from the user's address space. */ -ENTRY_NP(casuword32) ENTRY(casuword) +EENTRY_NP(casuword32) GET_PCB(r3) ldr r3, [r3] @@ -91,7 +91,7 @@ ENTRY(casuword) mov r1, #0x00000000 str r1, [r3, #PCB_ONFAULT] RET -END(casuword32) +EEND(casuword32) END(casuword) /* @@ -110,8 +110,8 @@ END(casuword) * Fetch an int from the user's address space. */ -ENTRY_NP(fuword32) ENTRY(fuword) +EENTRY_NP(fuword32) GET_PCB(r2) ldr r2, [r2] @@ -277,8 +277,8 @@ fusupcbfaulttext: * Store an int in the user's address space. */ -ENTRY_NP(suword32) ENTRY(suword) +EENTRY_NP(suword32) GET_PCB(r2) ldr r2, [r2] @@ -390,4 +390,3 @@ ENTRY(subyte) str r0, [r2, #PCB_ONFAULT] RET END(subyte) - Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/locore.S Mon Aug 11 01:29:28 2014 (r269796) @@ -75,7 +75,8 @@ __FBSDID("$FreeBSD$"); * For both types of boot we gather up the args, put them in a struct arm_boot_params * structure and pass that to initarm. */ -ENTRY_NP(btext) + .globl btext +btext: ASENTRY_NP(_start) STOP_UNWINDING /* Can't unwind into the bootloader! */ @@ -261,7 +262,6 @@ virt_done: adr r0, .Lmainreturned b _C_LABEL(panic) /* NOTREACHED */ -END(btext) END(_start) /* @@ -524,7 +524,7 @@ ENTRY_NP(sigcode) /* Branch back to retry SYS_sigreturn */ b . - 16 - +END(sigcode) .word SYS_sigreturn .word SYS_exit @@ -536,5 +536,5 @@ ENTRY_NP(sigcode) .global szsigcode szsigcode: .long esigcode-sigcode -END(sigcode) + /* End of locore.S */ Modified: stable/10/sys/arm/arm/setstack.s ============================================================================== --- stable/10/sys/arm/arm/setstack.s Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/setstack.s Mon Aug 11 01:29:28 2014 (r269796) @@ -71,7 +71,7 @@ ENTRY(set_stackptr) msr cpsr_fsxc, r3 /* Restore the old mode */ mov pc, lr /* Exit */ - +END(set_stackptr) /* To get the stack pointer for a particular mode we must switch * to that mode copy the banked r13 and then switch back. * This routine provides an easy way of doing this for any mode @@ -90,5 +90,5 @@ ENTRY(get_stackptr) msr cpsr_fsxc, r3 /* Restore the old mode */ mov pc, lr /* Exit */ - +END(get_stackptr) /* End of setstack.S */ Modified: stable/10/sys/arm/arm/support.S ============================================================================== --- stable/10/sys/arm/arm/support.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/arm/support.S Mon Aug 11 01:29:28 2014 (r269796) @@ -130,7 +130,7 @@ ENTRY(bzero) .Lnormal0: mov r3, #0x00 b do_memset - +EEND(bzero) /* LINTSTUB: Func: void *memset(void *, int, size_t) */ ENTRY(memset) and r3, r1, #0xff /* We deal with bytes */ @@ -276,7 +276,6 @@ do_memset: strgeb r3, [ip], #0x01 /* Set another byte */ strgtb r3, [ip] /* and a third */ RET /* Exit */ -END(bzero) END(memset) ENTRY(bcmp) @@ -394,7 +393,7 @@ ENTRY(bcopy) eor r0, r1, r0 eor r1, r0, r1 eor r0, r1, r0 -ENTRY(memmove) +EENTRY(memmove) /* Do the buffers overlap? */ cmp r0, r1 RETeq /* Bail now if src/dst are the same */ @@ -931,8 +930,8 @@ ENTRY(memmove) .Lmemmove_bsrcul1l4: add r1, r1, #1 b .Lmemmove_bl4 +EEND(memmove) END(bcopy) -END(memmove) #if !defined(_ARM_ARCH_5E) ENTRY(memcpy) @@ -2945,13 +2944,17 @@ END(memcpy) ENTRY(user) nop +END(user) ENTRY(btrap) nop +END(btrap) ENTRY(etrap) nop +END(etrap) ENTRY(bintr) nop +END(bintr) ENTRY(eintr) nop - +END(eintr) #endif Modified: stable/10/sys/arm/include/asm.h ============================================================================== --- stable/10/sys/arm/include/asm.h Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/arm/include/asm.h Mon Aug 11 01:29:28 2014 (r269796) @@ -74,9 +74,20 @@ #define GLOBAL(X) .globl x #define _ENTRY(x) \ .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: _FNSTART - #define _END(x) .size x, . - x; _FNEND +/* + * EENTRY()/EEND() mark "extra" entry/exit points from a function. + * The unwind info cannot handle the concept of a nested function, or a function + * with multiple .fnstart directives, but some of our assembler code is written + * with multiple labels to allow entry at several points. The EENTRY() macro + * defines such an extra entry point without a new .fnstart, so that it's + * basically just a label that you can jump to. The EEND() macro does nothing + * at all, except document the exit point associated with the same-named entry. + */ +#define _EENTRY(x) .globl x; .type x,_ASM_TYPE_FUNCTION; x: +#define _EEND(x) /* nothing */ + #ifdef GPROF # define _PROF_PROLOGUE \ mov ip, lr; bl __mcount @@ -85,11 +96,17 @@ #endif #define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE +#define EENTRY(y) _EENTRY(_C_LABEL(y)); _PROF_PROLOGUE #define ENTRY_NP(y) _ENTRY(_C_LABEL(y)) +#define EENTRY_NP(y) _EENTRY(_C_LABEL(y)) #define END(y) _END(_C_LABEL(y)) +#define EEND(y) #define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE +#define ASEENTRY(y) _EENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE #define ASENTRY_NP(y) _ENTRY(_ASM_LABEL(y)) +#define ASEENTRY_NP(y) _EENTRY(_ASM_LABEL(y)) #define ASEND(y) _END(_ASM_LABEL(y)) +#define ASEEND(y) #define ASMSTR .asciz Modified: stable/10/sys/libkern/arm/divsi3.S ============================================================================== --- stable/10/sys/libkern/arm/divsi3.S Mon Aug 11 01:22:10 2014 (r269795) +++ stable/10/sys/libkern/arm/divsi3.S Mon Aug 11 01:29:28 2014 (r269796) @@ -51,11 +51,11 @@ ENTRY_NP(__modsi3) RET END(__modsi3) +ENTRY_NP(__udivsi3) #ifdef __ARM_EABI__ -ENTRY_NP(__aeabi_uidiv) -ENTRY_NP(__aeabi_uidivmod) +EENTRY_NP(__aeabi_uidiv) +EENTRY_NP(__aeabi_uidivmod) #endif -ENTRY_NP(__udivsi3) .L_udivide: /* r0 = r0 / r1; r1 = r0 % r1 */ eor r0, r1, r0 eor r1, r0, r1 @@ -77,16 +77,16 @@ ENTRY_NP(__udivsi3) mov r1, #0 RET #ifdef __ARM_EABI__ -END(__aeabi_uidiv) -END(__aeabi_uidivmod) +EEND(__aeabi_uidiv) +EEND(__aeabi_uidivmod) #endif END(__udivsi3) +ENTRY_NP(__divsi3) #ifdef __ARM_EABI__ -ENTRY_NP(__aeabi_idiv) -ENTRY_NP(__aeabi_idivmod) +EENTRY_NP(__aeabi_idiv) +EENTRY_NP(__aeabi_idivmod) #endif -ENTRY_NP(__divsi3) .L_divide: /* r0 = r0 / r1; r1 = r0 % r1 */ eor r0, r1, r0 eor r1, r0, r1 @@ -401,8 +401,8 @@ ENTRY_NP(__divsi3) mov r0, r3 RET #ifdef __ARM_EABI__ -END(__aeabi_idiv) -END(__aeabi_idivmod) +EEND(__aeabi_idiv) +EEND(__aeabi_idivmod) #endif END(__divsi3) From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 01:48:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A79B1D7 for ; Mon, 11 Aug 2014 01:48:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56FB5291D for ; Mon, 11 Aug 2014 01:48:01 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2928 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 01:48:00 +0000 From: Ian Lepore Date: Mon, 11 Aug 2014 01:48: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: r269797 - in stable/10: contrib/binutils/gas/config sys/arm/ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e820d1.2928.482367bc@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 01:48:01 -0000 Author: ian Date: Mon Aug 11 01:48:00 2014 New Revision: 269797 URL: http://svnweb.freebsd.org/changeset/base/269797 Log: MFC r269393, r269394, r269395: Fix parsing of arch extensions in binutils/gas. Use ".arch_extension sec" when compiling ARM TI code that uses the security extensions. Modified: stable/10/contrib/binutils/gas/config/tc-arm.c stable/10/sys/arm/ti/ti_smc.S Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-arm.c Mon Aug 11 01:29:28 2014 (r269796) +++ stable/10/contrib/binutils/gas/config/tc-arm.c Mon Aug 11 01:48:00 2014 (r269797) @@ -3837,6 +3837,7 @@ s_arm_eabi_attribute (int ignored ATTRIB #endif /* OBJ_ELF */ static void s_arm_arch (int); +static void s_arm_arch_extension (int); static void s_arm_object_arch (int); static void s_arm_cpu (int); static void s_arm_fpu (int); @@ -3891,6 +3892,7 @@ const pseudo_typeS md_pseudo_table[] = { "syntax", s_syntax, 0 }, { "cpu", s_arm_cpu, 0 }, { "arch", s_arm_arch, 0 }, + { "arch_extension", s_arm_arch_extension, 0 }, { "object_arch", s_arm_object_arch, 0 }, { "fpu", s_arm_fpu, 0 }, #ifdef OBJ_ELF @@ -20154,6 +20156,7 @@ static const struct arm_option_cpu_value {"xscale", ARM_FEATURE (0, ARM_CEXT_XSCALE)}, {"iwmmxt", ARM_FEATURE (0, ARM_CEXT_IWMMXT)}, {"iwmmxt2", ARM_FEATURE (0, ARM_CEXT_IWMMXT2)}, + {"sec", ARM_FEATURE (ARM_EXT_V6Z, 0)}, {NULL, ARM_ARCH_NONE} }; @@ -20337,7 +20340,7 @@ arm_parse_arch (char * str) } for (opt = arm_archs; opt->name != NULL; opt++) - if (streq (opt->name, str)) + if (strncmp (opt->name, str, optlen) == 0) { march_cpu_opt = &opt->value; march_fpu_opt = &opt->default_fpu; @@ -20738,6 +20741,34 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED ignore_rest_of_line (); } +/* Parse a .arch_extension directive. */ + +static void +s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED) +{ + const struct arm_option_cpu_value_table *opt; + char saved_char; + char *name; + + name = input_line_pointer; + while (*input_line_pointer && !ISSPACE(*input_line_pointer)) + input_line_pointer++; + saved_char = *input_line_pointer; + *input_line_pointer = 0; + + for (opt = arm_extensions; opt->name != NULL; opt++) + if (streq (opt->name, name)) + { + ARM_MERGE_FEATURE_SETS (cpu_variant, cpu_variant, opt->value); + *input_line_pointer = saved_char; + demand_empty_rest_of_line (); + return; + } + + as_bad (_("unknown architecture `%s'\n"), name); + *input_line_pointer = saved_char; + ignore_rest_of_line (); +} /* Parse a .object_arch directive. */ Modified: stable/10/sys/arm/ti/ti_smc.S ============================================================================== --- stable/10/sys/arm/ti/ti_smc.S Mon Aug 11 01:29:28 2014 (r269796) +++ stable/10/sys/arm/ti/ti_smc.S Mon Aug 11 01:48:00 2014 (r269797) @@ -26,7 +26,8 @@ #include __FBSDID("$FreeBSD$"); -.arch armv7a + .arch armv7a + .arch_extension sec /* Issue a smc #0 call */ /* r0 and r1 contains the eventual arguments, r2 contains the function ID */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 02:20:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 065DF742 for ; Mon, 11 Aug 2014 02:20:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E88022B87 for ; Mon, 11 Aug 2014 02:20:24 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 23cf by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 02:20:24 +0000 From: Ian Lepore Date: Mon, 11 Aug 2014 02:20: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: r269798 - in stable/10/sys: arm/include cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e82868.23cf.4075296f@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 02:20:25 -0000 Author: ian Date: Mon Aug 11 02:20:24 2014 New Revision: 269798 URL: http://svnweb.freebsd.org/changeset/base/269798 Log: MFC r269403, r269405, r269410, r269414: Add 64-bit atomic ops for armv6, and also for armv4 only in kernel code. Use the new ops in the cddl code (and avoid defining functions with the same names locally). Modified: stable/10/sys/arm/include/atomic.h stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c stable/10/sys/cddl/compat/opensolaris/sys/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/include/atomic.h ============================================================================== --- stable/10/sys/arm/include/atomic.h Mon Aug 11 01:48:00 2014 (r269797) +++ stable/10/sys/arm/include/atomic.h Mon Aug 11 02:20:24 2014 (r269798) @@ -88,6 +88,8 @@ defined (__ARM_ARCH_6T2__) || \ defined (__ARM_ARCH_6Z__) || \ defined (__ARM_ARCH_6ZK__) +#define ARM_HAVE_ATOMIC64 + static __inline void __do_dmb(void) { @@ -146,6 +148,28 @@ atomic_set_32(volatile uint32_t *address } static __inline void +atomic_set_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + uint32_t exflag; + + __asm __volatile( + "1: \n" + " ldrexd %[tmp], [%[ptr]]\n" + " orr %Q[tmp], %Q[val]\n" + " orr %R[tmp], %R[val]\n" + " strexd %[exf], %[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); +} + +static __inline void atomic_set_long(volatile u_long *address, u_long setmask) { u_long tmp = 0, tmp2 = 0; @@ -177,6 +201,28 @@ atomic_clear_32(volatile uint32_t *addre } static __inline void +atomic_clear_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + uint32_t exflag; + + __asm __volatile( + "1: \n" + " ldrexd %[tmp], [%[ptr]]\n" + " bic %Q[tmp], %Q[val]\n" + " bic %R[tmp], %R[val]\n" + " strexd %[exf], %[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); +} + +static __inline void atomic_clear_long(volatile u_long *address, u_long setmask) { u_long tmp = 0, tmp2 = 0; @@ -213,6 +259,35 @@ atomic_cmpset_32(volatile u_int32_t *p, return (ret); } +static __inline int +atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +{ + uint64_t tmp; + uint32_t ret; + + __asm __volatile( + "1: \n" + " ldrexd %[tmp], [%[ptr]]\n" + " teq %Q[tmp], %Q[cmp]\n" + " itee eq \n" + " teqeq %R[tmp], %R[cmp]\n" + " movne %[ret], #0\n" + " bne 2f\n" + " strexd %[ret], %[new], [%[ptr]]\n" + " teq %[ret], #0\n" + " it ne \n" + " bne 1b\n" + " mov %[ret], #1\n" + "2: \n" + : [ret] "=&r" (ret), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [cmp] "r" (cmpval), + [new] "r" (newval) + : "cc", "memory"); + return (ret); +} + static __inline u_long atomic_cmpset_long(volatile u_long *p, volatile u_long cmpval, volatile u_long newval) { @@ -244,6 +319,15 @@ atomic_cmpset_acq_32(volatile u_int32_t return (ret); } +static __inline uint64_t +atomic_cmpset_acq_64(volatile uint64_t *p, volatile uint64_t cmpval, volatile uint64_t newval) +{ + uint64_t ret = atomic_cmpset_64(p, cmpval, newval); + + __do_dmb(); + return (ret); +} + static __inline u_long atomic_cmpset_acq_long(volatile u_long *p, volatile u_long cmpval, volatile u_long newval) { @@ -261,6 +345,14 @@ atomic_cmpset_rel_32(volatile u_int32_t return (atomic_cmpset_32(p, cmpval, newval)); } +static __inline uint64_t +atomic_cmpset_rel_64(volatile uint64_t *p, volatile uint64_t cmpval, volatile uint64_t newval) +{ + + __do_dmb(); + return (atomic_cmpset_64(p, cmpval, newval)); +} + static __inline u_long atomic_cmpset_rel_long(volatile u_long *p, volatile u_long cmpval, volatile u_long newval) { @@ -286,6 +378,28 @@ atomic_add_32(volatile u_int32_t *p, u_i } static __inline void +atomic_add_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + uint32_t exflag; + + __asm __volatile( + "1: \n" + " ldrexd %[tmp], [%[ptr]]\n" + " adds %Q[tmp], %Q[val]\n" + " adc %R[tmp], %R[val]\n" + " strexd %[exf], %[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); +} + +static __inline void atomic_add_long(volatile u_long *p, u_long val) { u_long tmp = 0, tmp2 = 0; @@ -316,6 +430,28 @@ atomic_subtract_32(volatile u_int32_t *p } static __inline void +atomic_subtract_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + uint32_t exflag; + + __asm __volatile( + "1: \n" + " ldrexd %[tmp], [%[ptr]]\n" + " subs %Q[tmp], %Q[val]\n" + " sbc %R[tmp], %R[val]\n" + " strexd %[exf], %[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); +} + +static __inline void atomic_subtract_long(volatile u_long *p, u_long val) { u_long tmp = 0, tmp2 = 0; @@ -334,6 +470,10 @@ ATOMIC_ACQ_REL(clear, 32) ATOMIC_ACQ_REL(add, 32) ATOMIC_ACQ_REL(subtract, 32) ATOMIC_ACQ_REL(set, 32) +ATOMIC_ACQ_REL(clear, 64) +ATOMIC_ACQ_REL(add, 64) +ATOMIC_ACQ_REL(subtract, 64) +ATOMIC_ACQ_REL(set, 64) ATOMIC_ACQ_REL_LONG(clear) ATOMIC_ACQ_REL_LONG(add) ATOMIC_ACQ_REL_LONG(subtract) @@ -392,6 +532,116 @@ atomic_store_rel_32(volatile uint32_t *p *p = v; } +static __inline uint64_t +atomic_fetchadd_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t ret, tmp; + uint32_t exflag; + + __asm __volatile( + "1: \n" + " ldrexd %[ret], [%[ptr]]\n" + " adds %Q[tmp], %Q[ret], %Q[val]\n" + " adc %R[tmp], %R[ret], %R[val]\n" + " strexd %[exf], %[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [ret] "=&r" (ret), + [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); + return (ret); +} + +static __inline uint64_t +atomic_readandclear_64(volatile uint64_t *p) +{ + uint64_t ret, tmp; + uint32_t exflag; + + __asm __volatile( + "1: \n" + " ldrexd %[ret], [%[ptr]]\n" + " mov %Q[tmp], #0\n" + " mov %R[tmp], #0\n" + " strexd %[exf], %[tmp], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [ret] "=&r" (ret), + [exf] "=&r" (exflag), + [tmp] "=&r" (tmp) + : [ptr] "r" (p) + : "cc", "memory"); + return (ret); +} + +static __inline uint64_t +atomic_load_64(volatile uint64_t *p) +{ + uint64_t ret; + + /* + * The only way to atomically load 64 bits is with LDREXD which puts the + * exclusive monitor into the open state, so reset it with CLREX because + * we don't actually need to store anything. + */ + __asm __volatile( + "1: \n" + " ldrexd %[ret], [%[ptr]]\n" + " clrex \n" + : [ret] "=&r" (ret) + : [ptr] "r" (p) + : "cc", "memory"); + return (ret); +} + +static __inline uint64_t +atomic_load_acq_64(volatile uint64_t *p) +{ + uint64_t ret; + + ret = atomic_load_64(p); + __do_dmb(); + return (ret); +} + +static __inline void +atomic_store_64(volatile uint64_t *p, uint64_t val) +{ + uint64_t tmp; + uint32_t exflag; + + /* + * The only way to atomically store 64 bits is with STREXD, which will + * succeed only if paired up with a preceeding LDREXD using the same + * address, so we read and discard the existing value before storing. + */ + __asm __volatile( + "1: \n" + " ldrexd %[tmp], [%[ptr]]\n" + " strexd %[exf], %[val], [%[ptr]]\n" + " teq %[exf], #0\n" + " it ne \n" + " bne 1b\n" + : [tmp] "=&r" (tmp), + [exf] "=&r" (exflag) + : [ptr] "r" (p), + [val] "r" (val) + : "cc", "memory"); +} + +static __inline void +atomic_store_rel_64(volatile uint64_t *p, uint64_t val) +{ + + __do_dmb(); + atomic_store_64(p, val); +} + static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long val) { @@ -474,6 +724,8 @@ __swp(uint32_t val, volatile uint32_t *p #ifdef _KERNEL +#define ARM_HAVE_ATOMIC64 + static __inline void atomic_set_32(volatile uint32_t *address, uint32_t setmask) { @@ -481,11 +733,23 @@ atomic_set_32(volatile uint32_t *address } static __inline void +atomic_set_64(volatile uint64_t *address, uint64_t setmask) +{ + __with_interrupts_disabled(*address |= setmask); +} + +static __inline void atomic_clear_32(volatile uint32_t *address, uint32_t clearmask) { __with_interrupts_disabled(*address &= ~clearmask); } +static __inline void +atomic_clear_64(volatile uint64_t *address, uint64_t clearmask) +{ + __with_interrupts_disabled(*address &= ~clearmask); +} + static __inline u_int32_t atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { @@ -503,6 +767,23 @@ atomic_cmpset_32(volatile u_int32_t *p, return (ret); } +static __inline u_int64_t +atomic_cmpset_64(volatile u_int64_t *p, volatile u_int64_t cmpval, volatile u_int64_t newval) +{ + int ret; + + __with_interrupts_disabled( + { + if (*p == cmpval) { + *p = newval; + ret = 1; + } else { + ret = 0; + } + }); + return (ret); +} + static __inline void atomic_add_32(volatile u_int32_t *p, u_int32_t val) { @@ -510,11 +791,23 @@ atomic_add_32(volatile u_int32_t *p, u_i } static __inline void +atomic_add_64(volatile u_int64_t *p, u_int64_t val) +{ + __with_interrupts_disabled(*p += val); +} + +static __inline void atomic_subtract_32(volatile u_int32_t *p, u_int32_t val) { __with_interrupts_disabled(*p -= val); } +static __inline void +atomic_subtract_64(volatile u_int64_t *p, u_int64_t val) +{ + __with_interrupts_disabled(*p -= val); +} + static __inline uint32_t atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) { @@ -528,6 +821,34 @@ atomic_fetchadd_32(volatile uint32_t *p, return (value); } +static __inline uint64_t +atomic_fetchadd_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t value; + + __with_interrupts_disabled( + { + value = *p; + *p += v; + }); + return (value); +} + +static __inline uint64_t +atomic_load_64(volatile uint64_t *p) +{ + uint64_t value; + + __with_interrupts_disabled(value = *p); + return (value); +} + +static __inline void +atomic_store_64(volatile uint64_t *p, uint64_t value) +{ + __with_interrupts_disabled(*p = value); +} + #else /* !_KERNEL */ static __inline u_int32_t Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Mon Aug 11 01:48:00 2014 (r269797) +++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Mon Aug 11 02:20:24 2014 (r269798) @@ -52,7 +52,7 @@ atomic_init(void) } #endif -#if !defined(__LP64__) && !defined(__mips_n32) +#if !defined(__LP64__) && !defined(__mips_n32) && !defined(ARM_HAVE_ATOMIC64) void atomic_add_64(volatile uint64_t *target, int64_t delta) { Modified: stable/10/sys/cddl/compat/opensolaris/sys/atomic.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/atomic.h Mon Aug 11 01:48:00 2014 (r269797) +++ stable/10/sys/cddl/compat/opensolaris/sys/atomic.h Mon Aug 11 02:20:24 2014 (r269798) @@ -36,7 +36,7 @@ atomic_cmpset_ptr((volatile uintptr_t *)(_a), (uintptr_t)(_b), (uintptr_t) (_c)) #define cas32 atomic_cmpset_32 -#if !defined(__LP64__) && !defined(__mips_n32) +#if !defined(__LP64__) && !defined(__mips_n32) && !defined(ARM_HAVE_ATOMIC64) extern void atomic_add_64(volatile uint64_t *target, int64_t delta); extern void atomic_dec_64(volatile uint64_t *target); #endif @@ -85,7 +85,7 @@ atomic_dec_32_nv(volatile uint32_t *targ return (atomic_fetchadd_32(target, -1) - 1); } -#if defined(__LP64__) || defined(__mips_n32) +#if defined(__LP64__) || defined(__mips_n32) || defined(ARM_HAVE_ATOMIC64) static __inline void atomic_dec_64(volatile uint64_t *target) { From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 03:04:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBFF6F82 for ; Mon, 11 Aug 2014 03:04:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB0821A1 for ; Mon, 11 Aug 2014 03:04:16 +0000 (UTC) Received: from araujo (uid 1134) (envelope-from araujo@FreeBSD.org) id 2a0c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 03:04:16 +0000 From: Marcelo Araujo Date: Mon, 11 Aug 2014 03:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269799 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e832b0.2a0c.2e4c9ba5@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 03:04:16 -0000 Author: araujo (ports committer) Date: Mon Aug 11 03:04:16 2014 New Revision: 269799 URL: http://svnweb.freebsd.org/changeset/base/269799 Log: - Remove unneeded include. Phabric: D563 Reviewed by: kevlo Approved by: kevlo Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Aug 11 02:20:24 2014 (r269798) +++ head/sys/net/if_lagg.c Mon Aug 11 03:04:16 2014 (r269799) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 06:54:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15C455E9 for ; Mon, 11 Aug 2014 06:54:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB0682694 for ; Mon, 11 Aug 2014 06:54:07 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2851 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 06:54:07 +0000 From: Xin LI Date: Mon, 11 Aug 2014 06:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269800 - stable/10/sbin/ping6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8688f.2851.32479e23@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 06:54:08 -0000 Author: delphij Date: Mon Aug 11 06:54:07 2014 New Revision: 269800 URL: http://svnweb.freebsd.org/changeset/base/269800 Log: MFC r269180: When interval is set to very small value with limited amount of packets, ping6(8) would quit before the remote side gets a chance to respond. Solve this by resetting the itimer when we have reached the maximum packet number have reached, but let the other handling to continue. PR: bin/151023 Submitted by: tjmao at tjmao.net Modified: stable/10/sbin/ping6/ping6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ping6/ping6.c ============================================================================== --- stable/10/sbin/ping6/ping6.c Mon Aug 11 03:04:16 2014 (r269799) +++ stable/10/sbin/ping6/ping6.c Mon Aug 11 06:54:07 2014 (r269800) @@ -1090,8 +1090,14 @@ main(int argc, char *argv[]) /* signal handling */ if (seenalrm) { /* last packet sent, timeout reached? */ - if (npackets && ntransmitted >= npackets) - break; + if (npackets && ntransmitted >= npackets) { + struct timeval zerotime = {0, 0}; + itimer.it_value = zerotime; + itimer.it_interval = zerotime; + (void)setitimer(ITIMER_REAL, &itimer, NULL); + seenalrm = 0; /* clear flag */ + continue; + } retransmit(); seenalrm = 0; continue; From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 07:00:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD8D496D for ; Mon, 11 Aug 2014 07:00:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 848F72767 for ; Mon, 11 Aug 2014 07:00:57 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 287f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 07:00:57 +0000 From: Xin LI Date: Mon, 11 Aug 2014 07:00: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: r269802 - stable/9/sbin/ping6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e86a29.287f.3b04e141@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 07:00:57 -0000 Author: delphij Date: Mon Aug 11 07:00:57 2014 New Revision: 269802 URL: http://svnweb.freebsd.org/changeset/base/269802 Log: MFC r269180: When interval is set to very small value with limited amount of packets, ping6(8) would quit before the remote side gets a chance to respond. Solve this by resetting the itimer when we have reached the maximum packet number have reached, but let the other handling to continue. PR: bin/151023 Submitted by: tjmao at tjmao.net Modified: stable/9/sbin/ping6/ping6.c Directory Properties: stable/9/sbin/ping6/ (props changed) Modified: stable/9/sbin/ping6/ping6.c ============================================================================== --- stable/9/sbin/ping6/ping6.c Mon Aug 11 06:55:41 2014 (r269801) +++ stable/9/sbin/ping6/ping6.c Mon Aug 11 07:00:57 2014 (r269802) @@ -1088,8 +1088,14 @@ main(int argc, char *argv[]) /* signal handling */ if (seenalrm) { /* last packet sent, timeout reached? */ - if (npackets && ntransmitted >= npackets) - break; + if (npackets && ntransmitted >= npackets) { + struct timeval zerotime = {0, 0}; + itimer.it_value = zerotime; + itimer.it_interval = zerotime; + (void)setitimer(ITIMER_REAL, &itimer, NULL); + seenalrm = 0; /* clear flag */ + continue; + } retransmit(); seenalrm = 0; continue; From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 07:01:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FADBAB6 for ; Mon, 11 Aug 2014 07:01:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D42872774 for ; Mon, 11 Aug 2014 07:01:29 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2bd8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 07:01:29 +0000 From: Xin LI Date: Mon, 11 Aug 2014 07:01:29 +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: r269803 - stable/8/sbin/ping6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e86a49.2bd8.4ed1ec96@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 07:01:30 -0000 Author: delphij Date: Mon Aug 11 07:01:29 2014 New Revision: 269803 URL: http://svnweb.freebsd.org/changeset/base/269803 Log: MFC r269180: When interval is set to very small value with limited amount of packets, ping6(8) would quit before the remote side gets a chance to respond. Solve this by resetting the itimer when we have reached the maximum packet number have reached, but let the other handling to continue. PR: bin/151023 Submitted by: tjmao at tjmao.net Modified: stable/8/sbin/ping6/ping6.c Directory Properties: stable/8/sbin/ping6/ (props changed) Modified: stable/8/sbin/ping6/ping6.c ============================================================================== --- stable/8/sbin/ping6/ping6.c Mon Aug 11 07:00:57 2014 (r269802) +++ stable/8/sbin/ping6/ping6.c Mon Aug 11 07:01:29 2014 (r269803) @@ -1093,8 +1093,14 @@ main(argc, argv) /* signal handling */ if (seenalrm) { /* last packet sent, timeout reached? */ - if (npackets && ntransmitted >= npackets) - break; + if (npackets && ntransmitted >= npackets) { + struct timeval zerotime = {0, 0}; + itimer.it_value = zerotime; + itimer.it_interval = zerotime; + (void)setitimer(ITIMER_REAL, &itimer, NULL); + seenalrm = 0; /* clear flag */ + continue; + } retransmit(); seenalrm = 0; continue; From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 08:58:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5AB4E0B for ; Mon, 11 Aug 2014 08:58:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9652568 for ; Mon, 11 Aug 2014 08:58:36 +0000 (UTC) Received: from smh (uid 1306) (envelope-from smh@FreeBSD.org) id 29e9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 08:58:36 +0000 From: Steven Hartland Date: Mon, 11 Aug 2014 08:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269805 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e885bc.29e9.5339cb6e@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 08:58:36 -0000 Author: smh Date: Mon Aug 11 08:58:35 2014 New Revision: 269805 URL: http://svnweb.freebsd.org/changeset/base/269805 Log: MFC r269522 Added support for extra ifconfig args to jail ip4.addr & ip6.addr params This allows for CARP interfaces to be used in jails e.g. ip4.addr = "em0|10.10.1.20/32 vhid 1 pass MyPass advskew 100" r269340 will not be MFC'ed as mentioned due to the slim window and the amount of additional commits required to support it. Sponsored by: Multiplay Modified: stable/10/usr.sbin/jail/command.c stable/10/usr.sbin/jail/config.c stable/10/usr.sbin/jail/jail.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/command.c ============================================================================== --- stable/10/usr.sbin/jail/command.c Mon Aug 11 07:04:08 2014 (r269804) +++ stable/10/usr.sbin/jail/command.c Mon Aug 11 08:58:35 2014 (r269805) @@ -268,7 +268,7 @@ run_command(struct cfjail *j) pid_t pid; int argc, bg, clean, consfd, down, fib, i, injail, sjuser, timeout; #if defined(INET) || defined(INET6) - char *addr; + char *addr, *extrap, *p, *val; #endif static char *cleanenv; @@ -317,16 +317,30 @@ run_command(struct cfjail *j) switch (comparam) { #ifdef INET case IP__IP4_IFADDR: - argv = alloca(8 * sizeof(char *)); + argc = 0; + val = alloca(strlen(comstring->s) + 1); + strcpy(val, comstring->s); + cs = val; + extrap = NULL; + while ((p = strchr(cs, ' ')) != NULL && strlen(p) > 1) { + if (extrap == NULL) { + *p = '\0'; + extrap = p + 1; + } + cs = p + 1; + argc++; + } + + argv = alloca((8 + argc) * sizeof(char *)); *(const char **)&argv[0] = _PATH_IFCONFIG; - if ((cs = strchr(comstring->s, '|'))) { - argv[1] = alloca(cs - comstring->s + 1); - strlcpy(argv[1], comstring->s, cs - comstring->s + 1); + if ((cs = strchr(val, '|'))) { + argv[1] = alloca(cs - val + 1); + strlcpy(argv[1], val, cs - val + 1); addr = cs + 1; } else { *(const char **)&argv[1] = string_param(j->intparams[IP_INTERFACE]); - addr = comstring->s; + addr = val; } *(const char **)&argv[2] = "inet"; if (!(cs = strchr(addr, '/'))) { @@ -344,6 +358,15 @@ run_command(struct cfjail *j) argv[3] = addr; argc = 4; } + + if (!down) { + for (cs = strtok(extrap, " "); cs; cs = strtok(NULL, " ")) { + size_t len = strlen(cs) + 1; + argv[argc] = alloca(len); + strlcpy(argv[argc++], cs, len); + } + } + *(const char **)&argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; break; @@ -351,16 +374,30 @@ run_command(struct cfjail *j) #ifdef INET6 case IP__IP6_IFADDR: - argv = alloca(8 * sizeof(char *)); + argc = 0; + val = alloca(strlen(comstring->s) + 1); + strcpy(val, comstring->s); + cs = val; + extrap = NULL; + while ((p = strchr(cs, ' ')) != NULL && strlen(p) > 1) { + if (extrap == NULL) { + *p = '\0'; + extrap = p + 1; + } + cs = p + 1; + argc++; + } + + argv = alloca((8 + argc) * sizeof(char *)); *(const char **)&argv[0] = _PATH_IFCONFIG; - if ((cs = strchr(comstring->s, '|'))) { - argv[1] = alloca(cs - comstring->s + 1); - strlcpy(argv[1], comstring->s, cs - comstring->s + 1); + if ((cs = strchr(val, '|'))) { + argv[1] = alloca(cs - val + 1); + strlcpy(argv[1], val, cs - val + 1); addr = cs + 1; } else { *(const char **)&argv[1] = string_param(j->intparams[IP_INTERFACE]); - addr = comstring->s; + addr = val; } *(const char **)&argv[2] = "inet6"; argv[3] = addr; @@ -370,6 +407,15 @@ run_command(struct cfjail *j) argc = 6; } else argc = 4; + + if (!down) { + for (cs = strtok(extrap, " "); cs; cs = strtok(NULL, " ")) { + size_t len = strlen(cs) + 1; + argv[argc] = alloca(len); + strlcpy(argv[argc++], cs, len); + } + } + *(const char **)&argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; break; Modified: stable/10/usr.sbin/jail/config.c ============================================================================== --- stable/10/usr.sbin/jail/config.c Mon Aug 11 07:04:08 2014 (r269804) +++ stable/10/usr.sbin/jail/config.c Mon Aug 11 08:58:35 2014 (r269805) @@ -576,7 +576,9 @@ check_intparams(struct cfjail *j) /* * IP addresses may include an interface to set that address on, - * and a netmask/suffix for that address. + * a netmask/suffix for that address and options for ifconfig. + * These are copied to an internal command parameter and then stripped + * so they won't be passed on to jailparam_set. */ defif = string_param(j->intparams[IP_INTERFACE]) != NULL; #ifdef INET @@ -601,6 +603,10 @@ check_intparams(struct cfjail *j) *cs = '\0'; s->len = cs - s->s; } + if ((cs = strchr(s->s, ' ')) != NULL) { + *cs = '\0'; + s->len = cs - s->s; + } } } #endif @@ -625,6 +631,10 @@ check_intparams(struct cfjail *j) *cs = '\0'; s->len = cs - s->s; } + if ((cs = strchr(s->s, ' ')) != NULL) { + *cs = '\0'; + s->len = cs - s->s; + } } } #endif Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Mon Aug 11 07:04:08 2014 (r269804) +++ stable/10/usr.sbin/jail/jail.8 Mon Aug 11 08:58:35 2014 (r269805) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2013 +.Dd August 4, 2014 .Dt JAIL 8 .Os .Sh NAME @@ -684,17 +684,23 @@ prison is created, and will be removed f prison is removed. .It Va ip4.addr In addition to the IP addresses that are passed to the kernel, and -interface and/or a netmask may also be specified, in the form -.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask . +interface, netmask and additional paramters (as supported by +.Xr ifconfig 8 Ns ) +may also be specified, in the form +.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask param ... . If an interface is given before the IP address, an alias for the address will be added to that interface, as it is with the .Va interface parameter. If a netmask in either dotted-quad or CIDR form is given after IP address, it will be used when adding the IP alias. +If additional parameters are specified then they will also be used when +adding the IP alias. .It Va ip6.addr In addition to the IP addresses that are passed to the kernel, -and interface and/or a prefix may also be specified, in the form -.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix . +an interface, prefix and additional parameters (as supported by +.Xr ifconfig 8 Ns ) +may also be specified, in the form +.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix param ... . .It Va vnet.interface A network interface to give to a vnet-enabled jail after is it created. The interface will automatically be returned when the jail is removed. @@ -1172,6 +1178,7 @@ environment of the first jail. .Xr pkill 1 , .Xr ps 1 , .Xr quota 1 , +.Xr ifconfig 8 , .Xr jail_set 2 , .Xr devfs 5 , .Xr fdescfs 5 , From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 11:00:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6761C8FE; Mon, 11 Aug 2014 11:00:50 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DEBF224DA; Mon, 11 Aug 2014 11:00:49 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s7BB0kc2055662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 Aug 2014 15:00:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s7BB0kmd055661; Mon, 11 Aug 2014 15:00:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 11 Aug 2014 15:00:46 +0400 From: Gleb Smirnoff To: Konstantin Belousov Subject: Re: svn commit: r269782 - in head/sys/sparc64: include sparc64 Message-ID: <20140811110046.GQ72338@FreeBSD.org> References: <53e7a4fc.2898.352aa941@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53e7a4fc.2898.352aa941@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: alc@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, dumbbell@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 11:00:50 -0000 On Sun, Aug 10, 2014 at 04:59:39PM +0000, Konstantin Belousov wrote: K> Author: kib K> Date: Sun Aug 10 16:59:39 2014 K> New Revision: 269782 K> URL: http://svnweb.freebsd.org/changeset/base/269782 K> K> Log: K> On sparc64, do not keep mappings for the destroyed sf_bufs. Sparc64 K> pmap, unlike i386, and similar to i386/xen pv, does not tolerate K> abandoned mappings for the freed pages. K> K> Reported and tested by: dumbbell K> Diagnosed and reviewed by: alc K> Sponsored by: The FreeBSD Foundation That's my oversight. Sorry. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 12:26:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 845CD216 for ; Mon, 11 Aug 2014 12:26:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AB542EA4 for ; Mon, 11 Aug 2014 12:26:49 +0000 (UTC) Received: from ache (uid 542) (envelope-from ache@FreeBSD.org) id 2f28 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 12:26:49 +0000 From: Andrey A. Chernov Date: Mon, 11 Aug 2014 12:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269806 - in head/contrib/opie: . libopie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8b689.2f28.3febd085@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 12:26:49 -0000 Author: ache Date: Mon Aug 11 12:26:48 2014 New Revision: 269806 URL: http://svnweb.freebsd.org/changeset/base/269806 Log: Fix too long (seed length >12 chars) challenge handling. 1) " ext" length should be included into OPIE_CHALLENGE_MAX (as all places of opie code expects that). 2) Overflow check in challenge.c is off by 1 even with corrected OPIE_CHALLENGE_MAX 3) When fallback to randomchallenge() happens and rval is 0 (i.e. challenge is too long), its value should be set to error state too. To demonstrate the bug, run opiepasswd with valid seed: opiepasswd -s 1234567890123456 and notice that it falls back to randomchallenge() (i.e. no 1234567890123456 in the prompt). PR: 191511 Submitted by: mitsururike@gmail.com (partially) MFC after: 1 week Modified: head/contrib/opie/libopie/challenge.c head/contrib/opie/opie.h Modified: head/contrib/opie/libopie/challenge.c ============================================================================== --- head/contrib/opie/libopie/challenge.c Mon Aug 11 08:58:35 2014 (r269805) +++ head/contrib/opie/libopie/challenge.c Mon Aug 11 12:26:48 2014 (r269806) @@ -68,7 +68,9 @@ int opiechallenge FUNCTION((mp, name, ss } if (rval || - (snprintf(ss, OPIE_CHALLENGE_MAX, "otp-%s %d %s ext", algids[MDX], mp->opie_n - 1, mp->opie_seed) >= OPIE_CHALLENGE_MAX)) { + (snprintf(ss, OPIE_CHALLENGE_MAX+1, "otp-%s %d %s ext", algids[MDX], mp->opie_n - 1, mp->opie_seed) >= OPIE_CHALLENGE_MAX+1)) { + if (!rval) + rval = 1; opierandomchallenge(ss); memset(mp, 0, sizeof(*mp)); } Modified: head/contrib/opie/opie.h ============================================================================== --- head/contrib/opie/opie.h Mon Aug 11 08:58:35 2014 (r269805) +++ head/contrib/opie/opie.h Mon Aug 11 12:26:48 2014 (r269806) @@ -72,8 +72,8 @@ struct opie { /* Max length of hash algorithm name (md4/md5) */ #define OPIE_HASHNAME_MAX 3 -/* Maximum length of a challenge (otp-md? 9999 seed) */ -#define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX) +/* Maximum length of a challenge (otp-md? 9999 seed ext) */ +#define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX+1+3) /* Maximum length of a response that we allow */ #define OPIE_RESPONSE_MAX (9+1+19+1+9+OPIE_SEED_MAX+1+19+1+19+1+19) From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 12:59:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C3AEB58 for ; Mon, 11 Aug 2014 12:59:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4B1622D0 for ; Mon, 11 Aug 2014 12:59:55 +0000 (UTC) Received: from glebius (uid 1025) (envelope-from glebius@FreeBSD.org) id 2c83 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 12:59:55 +0000 From: Gleb Smirnoff Date: Mon, 11 Aug 2014 12:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269807 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8be4b.2c83.3b3d1940@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 12:59:56 -0000 Author: glebius Date: Mon Aug 11 12:59:55 2014 New Revision: 269807 URL: http://svnweb.freebsd.org/changeset/base/269807 Log: Provide sf_buf_ref() to optimize refcounting of already allocated sendfile(2) buffers. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/kern/subr_sfbuf.c head/sys/kern/uipc_syscalls.c head/sys/sys/sf_buf.h Modified: head/sys/kern/subr_sfbuf.c ============================================================================== --- head/sys/kern/subr_sfbuf.c Mon Aug 11 12:26:48 2014 (r269806) +++ head/sys/kern/subr_sfbuf.c Mon Aug 11 12:59:55 2014 (r269807) @@ -201,6 +201,22 @@ sf_buf_free(struct sf_buf *sf) mtx_unlock(&sf_buf_lock); } +void +sf_buf_ref(struct sf_buf *sf) +{ + +#ifdef SFBUF_OPTIONAL_DIRECT_MAP + if (SFBUF_OPTIONAL_DIRECT_MAP) + return; +#endif + + KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf)); + + mtx_lock(&sf_buf_lock); + sf->ref_count++; + mtx_unlock(&sf_buf_lock); +} + #ifdef SFBUF_PROCESS_PAGE /* * Run callback function on sf_buf that holds a certain page. Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Aug 11 12:26:48 2014 (r269806) +++ head/sys/kern/uipc_syscalls.c Mon Aug 11 12:59:55 2014 (r269807) @@ -1993,8 +1993,7 @@ sf_ext_ref(void *arg1, void *arg2) struct sendfile_sync *sfs = arg2; vm_page_t pg = sf_buf_page(sf); - /* XXXGL: there should be sf_buf_ref() */ - sf_buf_alloc(sf_buf_page(sf), SFB_NOWAIT); + sf_buf_ref(sf); vm_page_lock(pg); vm_page_wire(pg); Modified: head/sys/sys/sf_buf.h ============================================================================== --- head/sys/sys/sf_buf.h Mon Aug 11 12:26:48 2014 (r269806) +++ head/sys/sys/sf_buf.h Mon Aug 11 12:59:55 2014 (r269807) @@ -106,6 +106,7 @@ struct sf_buf; #ifdef SFBUF struct sf_buf *sf_buf_alloc(struct vm_page *, int); void sf_buf_free(struct sf_buf *); +void sf_buf_ref(struct sf_buf *); static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) @@ -168,6 +169,11 @@ static inline void sf_buf_free(struct sf_buf *sf) { } + +static inline void +sf_buf_ref(struct sf_buf *sf) +{ +} #endif /* SFBUF */ /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 13:12:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F193192 for ; Mon, 11 Aug 2014 13:12:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB4125CF for ; Mon, 11 Aug 2014 13:12:18 +0000 (UTC) Received: from glebius (uid 1025) (envelope-from glebius@FreeBSD.org) id 23e6 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 13:12:18 +0000 From: Gleb Smirnoff Date: Mon, 11 Aug 2014 13:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269808 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8c132.23e6.34cb6102@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 13:12:18 -0000 Author: glebius Date: Mon Aug 11 13:12:18 2014 New Revision: 269808 URL: http://svnweb.freebsd.org/changeset/base/269808 Log: Use M_WAITOK in sf_buf_init(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/kern/subr_sfbuf.c Modified: head/sys/kern/subr_sfbuf.c ============================================================================== --- head/sys/kern/subr_sfbuf.c Mon Aug 11 12:59:55 2014 (r269807) +++ head/sys/kern/subr_sfbuf.c Mon Aug 11 13:12:18 2014 (r269808) @@ -99,8 +99,7 @@ sf_buf_init(void *arg) TAILQ_INIT(&sf_buf_freelist); sf_base = kva_alloc(nsfbufs * PAGE_SIZE); sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, - M_NOWAIT | M_ZERO); - KASSERT(sf_bufs, ("%s: malloc failure", __func__)); + M_WAITOK | M_ZERO); for (i = 0; i < nsfbufs; i++) { sf_bufs[i].kva = sf_base + i * PAGE_SIZE; TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 13:36:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF9FCE22 for ; Mon, 11 Aug 2014 13:36:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 974422880 for ; Mon, 11 Aug 2014 13:36:02 +0000 (UTC) Received: from ache (uid 542) (envelope-from ache@FreeBSD.org) id 2dd0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 13:36:02 +0000 From: Andrey A. Chernov Date: Mon, 11 Aug 2014 13:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269809 - head/contrib/opie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8c6c2.2dd0.45941591@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 13:36:02 -0000 Author: ache Date: Mon Aug 11 13:36:02 2014 New Revision: 269809 URL: http://svnweb.freebsd.org/changeset/base/269809 Log: When sha1 support was added, they forget to increase OPIE_HASHNAME_MAX MFC after: 1 week Modified: head/contrib/opie/opie.h Modified: head/contrib/opie/opie.h ============================================================================== --- head/contrib/opie/opie.h Mon Aug 11 13:12:18 2014 (r269808) +++ head/contrib/opie/opie.h Mon Aug 11 13:36:02 2014 (r269809) @@ -69,8 +69,8 @@ struct opie { /* Maximum length of a seed */ #define OPIE_SEED_MAX 16 -/* Max length of hash algorithm name (md4/md5) */ -#define OPIE_HASHNAME_MAX 3 +/* Max length of hash algorithm name (md4/md5/sha1) */ +#define OPIE_HASHNAME_MAX 4 /* Maximum length of a challenge (otp-md? 9999 seed ext) */ #define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX+1+3) From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 13:47:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AEC44BC; Mon, 11 Aug 2014 13:47:38 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E35429C9; Mon, 11 Aug 2014 13:47:38 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s7BDlWoD085221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 11 Aug 2014 16:47:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s7BDlWoD085221 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s7BDlWWL085220; Mon, 11 Aug 2014 16:47:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 11 Aug 2014 16:47:32 +0300 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: svn commit: r269807 - in head/sys: kern sys Message-ID: <20140811134732.GA2737@kib.kiev.ua> References: <53e8be4b.2c83.3b3d1940@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: <53e8be4b.2c83.3b3d1940@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 13:47:38 -0000 --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 11, 2014 at 12:59:55PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Aug 11 12:59:55 2014 > New Revision: 269807 > URL: http://svnweb.freebsd.org/changeset/base/269807 >=20 > Log: > Provide sf_buf_ref() to optimize refcounting of already allocated > sendfile(2) buffers. > =20 > Sponsored by: Netflix > Sponsored by: Nginx, Inc. >=20 > Modified: > head/sys/kern/subr_sfbuf.c > head/sys/kern/uipc_syscalls.c > head/sys/sys/sf_buf.h >=20 > Modified: head/sys/kern/subr_sfbuf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/subr_sfbuf.c Mon Aug 11 12:26:48 2014 (r269806) > +++ head/sys/kern/subr_sfbuf.c Mon Aug 11 12:59:55 2014 (r269807) > @@ -201,6 +201,22 @@ sf_buf_free(struct sf_buf *sf) > mtx_unlock(&sf_buf_lock); > } > =20 > +void > +sf_buf_ref(struct sf_buf *sf) > +{ > + > +#ifdef SFBUF_OPTIONAL_DIRECT_MAP > + if (SFBUF_OPTIONAL_DIRECT_MAP) > + return; > +#endif > + > + KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf)); > + > + mtx_lock(&sf_buf_lock); > + sf->ref_count++; > + mtx_unlock(&sf_buf_lock); > +} I think assert could be usefully moved under the mutex protected region. --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT6Ml0AAoJEJDCuSvBvK1BO5cP/jVriWv8yNNdf9xWmTbiPHPu 1n4Dceed8aC8xiS2Wjb/NUYT2rDjvm06Pf3kD0Zl+NJwPS4x/eidyW0jqv6Wot4I SkB3BQMhd7I8Yg8y/Y9ZmvcDkWKt1V6VetkHZV6LLIrsqla6yWAhMEDVByqhysn5 dxvdJ9me5pLbjKlWlFvWQfbFysw5rMXA3xLlIvotddytPlYspMzAfbKN/6/ksHMW emiU5r5BO0nn+VFY9FPYZYz4VJbDu4XsHKt4E+ZGvAyJu7PPy9jexaKviklk2ybv E+leUDkHxXh5anOyvOqqAwIr2ec9Z3F1E2Eh2xINtIFPEOpsE6u3wBQtb81tJCtr 5byIqTBYCayqOTYnRPmnst4XJVfEU4JlRdv9WMun/I5pbBlj4GvSv03lsiOAwhSi 7Vw8XEgMHujip0dFLUOZJN4AWR35Svr3PF2E4lMoDou48yW3nYtMmj98xdYES+3c hWlgpj9X1dGb1OontIUmt2Ty4vH+czrETI9r7hb0X7hFY6tNzNgCJwUy1zx+svSH xcgHbLe5VHz5LNHqG7nVjb+EHLYmxo7ynfGCWWcx62oTRiueeKflziapV69xKy7G gx2LWq7v+1nD1XGXpLxQY4NR0iSIPe45zVRinXw0knq+9ZIFV9JPBoOWUv98d0/u nHUjNCzI1TiT8MMHAzha =ogeK -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 14:37:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7029AC5 for ; Mon, 11 Aug 2014 14:37:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D2272139 for ; Mon, 11 Aug 2014 14:37:57 +0000 (UTC) Received: from ache (uid 542) (envelope-from ache@FreeBSD.org) id 2930 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 14:37:57 +0000 From: Andrey A. Chernov Date: Mon, 11 Aug 2014 14:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269810 - head/usr.bin/opiekey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8d545.2930.710d42f1@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 14:37:57 -0000 Author: ache Date: Mon Aug 11 14:37:57 2014 New Revision: 269810 URL: http://svnweb.freebsd.org/changeset/base/269810 Log: Link otp-sha1 to match real challenge prompt, not otp-sha MFC after: 1 week Modified: head/usr.bin/opiekey/Makefile Modified: head/usr.bin/opiekey/Makefile ============================================================================== --- head/usr.bin/opiekey/Makefile Mon Aug 11 13:36:02 2014 (r269809) +++ head/usr.bin/opiekey/Makefile Mon Aug 11 14:37:57 2014 (r269810) @@ -15,9 +15,9 @@ LDADD= -lopie -lmd LINKS= ${BINDIR}/opiekey ${BINDIR}/otp-md4 LINKS+= ${BINDIR}/opiekey ${BINDIR}/otp-md5 -LINKS+= ${BINDIR}/opiekey ${BINDIR}/otp-sha +LINKS+= ${BINDIR}/opiekey ${BINDIR}/otp-sha1 -MLINKS= opiekey.1 otp-md4.1 opiekey.1 otp-md5.1 opiekey.1 otp-sha.1 +MLINKS= opiekey.1 otp-md4.1 opiekey.1 otp-md5.1 opiekey.1 otp-sha1.1 .PATH: ${OPIE_DIST} From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 14:46:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4321A23C for ; Mon, 11 Aug 2014 14:46:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B20E2244 for ; Mon, 11 Aug 2014 14:46:10 +0000 (UTC) Received: from ache (uid 542) (envelope-from ache@FreeBSD.org) id 2caa by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 14:46:10 +0000 From: Andrey A. Chernov Date: Mon, 11 Aug 2014 14:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269811 - head/contrib/opie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8d732.2caa.3b2dbe2@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 14:46:10 -0000 Author: ache Date: Mon Aug 11 14:46:09 2014 New Revision: 269811 URL: http://svnweb.freebsd.org/changeset/base/269811 Log: Last '/' for program name, not first one MFC after: 1 week Modified: head/contrib/opie/opiekey.c Modified: head/contrib/opie/opiekey.c ============================================================================== --- head/contrib/opie/opiekey.c Mon Aug 11 14:37:57 2014 (r269810) +++ head/contrib/opie/opiekey.c Mon Aug 11 14:46:09 2014 (r269811) @@ -145,7 +145,7 @@ int main FUNCTION((argc, argv), int argc int type = RESPONSE_STANDARD; int force = 0; - if (slash = strchr(argv[0], '/')) + if (slash = strrchr(argv[0], '/')) slash++; else slash = argv[0]; From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 14:50:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4470D55F for ; Mon, 11 Aug 2014 14:50:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BBE52418 for ; Mon, 11 Aug 2014 14:50:53 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2d10 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 14:50:50 +0000 From: Warner Losh Date: Mon, 11 Aug 2014 14:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269812 - in head/sys: conf modules modules/aic7xxx/ahc modules/cxgb modules/cxgbe modules/dpt modules/drm modules/drm2 modules/ep modules/if_gif modules/netgraph modules/sound/driver m... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8d84a.2d10.3a29d8f5@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 14:50:53 -0000 Author: imp Date: Mon Aug 11 14:50:49 2014 New Revision: 269812 URL: http://svnweb.freebsd.org/changeset/base/269812 Log: Remove dependence on source tree options. Move all kernel module options into kern.opts.mk and change all the places where we use src.opts.mk to pull in the options. Conditionally define SYSDIR and use SYSDIR/conf/kern.opts.mk instead of a CURDIR path. Replace all instances of CURDIR/../../etc with STSDIR, but only in the affected files. As a special compatibility hack, include bsd.owm.mk at the top of kern.opts.mk to allow the bare build of sys/modules to work on older systems. If the defaults ever change between 9.x, 10.x and current for these options, however, you'll wind up with the host OS' defaults rather than the -current defaults. This hack will be removed when we no longer need to support this build scenario. Reviewed by: jhb Differential Revision: https://phabric.freebsd.org/D529 Modified: head/sys/conf/kern.opts.mk head/sys/modules/Makefile head/sys/modules/aic7xxx/ahc/Makefile head/sys/modules/cxgb/Makefile head/sys/modules/cxgbe/Makefile head/sys/modules/dpt/Makefile head/sys/modules/drm/Makefile head/sys/modules/drm2/Makefile head/sys/modules/ep/Makefile head/sys/modules/if_gif/Makefile head/sys/modules/netgraph/Makefile head/sys/modules/sound/driver/Makefile head/sys/modules/usb/Makefile head/sys/modules/vx/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/conf/kern.opts.mk Mon Aug 11 14:50:49 2014 (r269812) @@ -11,19 +11,42 @@ # that haven't been converted over. # +# Note: bsd.own.mk must be included before the rest of kern.opts.mk to make +# building on 10.x and earlier work. This should be removed when that's no +# longer supported since it confounds the defaults (since it uses the host's +# notion of defaults rather than what's default in current when building +# within sys/modules). +.include + # These options are used by the kernel build process (kern.mk and kmod.mk) # They have to be listed here so we can build modules outside of the # src tree. __DEFAULT_YES_OPTIONS = \ ARM_EABI \ + BLUETOOTH \ + CDDL \ + CRYPT \ FORMAT_EXTENSIONS \ INET \ INET6 \ - KERNEL_SYMBOLS + IPFILTER \ + KERNEL_SYMBOLS \ + NETGRAPH \ + PF \ + SOURCELESS_HOST \ + SOURCELESS_UCODE \ + USB_GADGET_EXAMPLES \ + ZFS + +__DEFAULT_NO_OPTIONS = \ + EISA \ + NAND \ + OFED -# expanded inline from bsd.mkopt.mk: +# expanded inline from bsd.mkopt.mk to avoid share/mk dependency +# Those that default to yes .for var in ${__DEFAULT_YES_OPTIONS} .if !defined(MK_${var}) .if defined(WITHOUT_${var}) # WITHOUT always wins @@ -35,6 +58,18 @@ MK_${var}:= yes .endfor .undef __DEFAULT_YES_OPTIONS +# Those that default to no +.for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endif +.endfor +.undef __DEFAULT_NO_OPTIONS + # # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR_PARALLEL= Modified: head/sys/modules/aic7xxx/ahc/Makefile ============================================================================== --- head/sys/modules/aic7xxx/ahc/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/aic7xxx/ahc/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,9 +1,10 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../../dev/aic7xxx +.PATH: ${SYSDIR}/dev/aic7xxx KMOD= ahc .if ${MK_EISA} != "no" SUBDIR+= ahc_eisa @@ -20,20 +21,20 @@ REG_PRINT_OPT= -p aic7xxx_reg_print.c .endif BEFORE_DEPEND = ${GENSRCS} -../aicasm/aicasm: ${.CURDIR}/../../../dev/aic7xxx/aicasm/*.[chyl] +../aicasm/aicasm: ${SYSDIR}/dev/aic7xxx/aicasm/*.[chyl] ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; ) .if make(ahcfirmware) ahcfirmware: ${GENSRCS} ${GENSRCS}: \ - ${.CURDIR}/../../../dev/aic7xxx/aic7xxx.{reg,seq} \ - ${.CURDIR}/../../../cam/scsi/scsi_message.h - ../aicasm/aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \ - -I${.CURDIR}/../../../dev/aic7xxx \ + ${SYSDIR}/dev/aic7xxx/aic7xxx.{reg,seq} \ + ${SYSDIR}/cam/scsi/scsi_message.h + ../aicasm/aicasm ${INCLUDES} -I${SYSDIR}/cam/scsi \ + -I${SYSDIR}/dev/aic7xxx \ -o aic7xxx_seq.h -r aic7xxx_reg.h \ ${REG_PRINT_OPT} \ - -i ${.CURDIR}/../../../dev/aic7xxx/aic7xxx_osm.h \ - ${.CURDIR}/../../../dev/aic7xxx/aic7xxx.seq + -i ${SYSDIR}/dev/aic7xxx/aic7xxx_osm.h \ + ${SYSDIR}/dev/aic7xxx/aic7xxx.seq .else ${GENSRCS}: @echo "Error: ${.TARGET} is missing. Run 'make ahcfirmware'" Modified: head/sys/modules/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/cxgb/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= cxgb SUBDIR+= cxgb_t3fw Modified: head/sys/modules/cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/cxgbe/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -2,7 +2,8 @@ # $FreeBSD$ # -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= if_cxgbe SUBDIR+= t4_firmware Modified: head/sys/modules/dpt/Makefile ============================================================================== --- head/sys/modules/dpt/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/dpt/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/dpt +.PATH: ${SYSDIR}/dev/dpt KMOD= dpt SRCS= dpt_scsi.c dpt.h \ dpt_pci.c pci_if.h \ Modified: head/sys/modules/drm/Makefile ============================================================================== --- head/sys/modules/drm/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/drm/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). Modified: head/sys/modules/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/drm2/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,7 +1,7 @@ # $FreeBSD$ -.include -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" .if ${MACHINE_CPUARCH} == "amd64" _radeonkms= radeonkms Modified: head/sys/modules/ep/Makefile ============================================================================== --- head/sys/modules/ep/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/ep/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/ep +.PATH: ${SYSDIR}/dev/ep KMOD= if_ep SRCS= if_ep.c Modified: head/sys/modules/if_gif/Makefile ============================================================================== --- head/sys/modules/if_gif/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/if_gif/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 +.PATH: ${SYSDIR}/net ${SYSDIR}/netinet ${SYSDIR}/netinet6 KMOD= if_gif SRCS= if_gif.c in_gif.c opt_inet.h opt_inet6.h opt_mrouting.h Modified: head/sys/modules/netgraph/Makefile ============================================================================== --- head/sys/modules/netgraph/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/netgraph/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,7 +1,8 @@ # $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= async \ atm \ @@ -57,7 +58,7 @@ SUBDIR= async \ _bluetooth= bluetooth .endif -.if ${MK_CRYPT} != "no" && exists(${.CURDIR}/../../crypto/rc4/rc4.c) +.if ${MK_CRYPT} != "no" && exists(${SYSDIR}/crypto/rc4/rc4.c) _mppc= mppc .endif Modified: head/sys/modules/sound/driver/Makefile ============================================================================== --- head/sys/modules/sound/driver/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/sound/driver/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/usb/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -25,7 +25,8 @@ # SUCH DAMAGE. # -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" # # Check for common USB debug flags to pass when building the USB Modified: head/sys/modules/vx/Makefile ============================================================================== --- head/sys/modules/vx/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/vx/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/vx +.PATH: ${SYSDIR}/dev/vx KMOD= if_vx SRCS= if_vx.c if_vx_pci.c From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 15:06:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E2DBB95 for ; Mon, 11 Aug 2014 15:06:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73D6E25AC for ; Mon, 11 Aug 2014 15:06:07 +0000 (UTC) Received: from glebius (uid 1025) (envelope-from glebius@FreeBSD.org) id 256d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 15:06:07 +0000 From: Gleb Smirnoff Date: Mon, 11 Aug 2014 15:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269813 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8dbdf.256d.4d189ea0@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 15:06:07 -0000 Author: glebius Date: Mon Aug 11 15:06:07 2014 New Revision: 269813 URL: http://svnweb.freebsd.org/changeset/base/269813 Log: Move KASSERT into locked region. Submitted by: kib Modified: head/sys/kern/subr_sfbuf.c Modified: head/sys/kern/subr_sfbuf.c ============================================================================== --- head/sys/kern/subr_sfbuf.c Mon Aug 11 14:50:49 2014 (r269812) +++ head/sys/kern/subr_sfbuf.c Mon Aug 11 15:06:07 2014 (r269813) @@ -209,9 +209,8 @@ sf_buf_ref(struct sf_buf *sf) return; #endif - KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf)); - mtx_lock(&sf_buf_lock); + KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf)); sf->ref_count++; mtx_unlock(&sf_buf_lock); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 15:37:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A68D1705 for ; Mon, 11 Aug 2014 15:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76C832911 for ; Mon, 11 Aug 2014 15:37:02 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 2179 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 15:37:02 +0000 From: Roger Pau Monné Date: Mon, 11 Aug 2014 15:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269814 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8e31e.2179.30c1c657@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 15:37:02 -0000 Author: royger Date: Mon Aug 11 15:37:02 2014 New Revision: 269814 URL: http://svnweb.freebsd.org/changeset/base/269814 Log: blkfront: add support for unmapped IO Using unmapped IO is really beneficial when running inside of a VM, since it avoids IPIs to other vCPUs in order to invalidate the mappings. This patch adds unmapped IO support to blkfront. The following tests results have been obtained when running on a Xen host without HAP: PVHVM 3165.84 real 6354.17 user 4483.32 sys PVHVM with unmapped IO 2099.46 real 4624.52 user 2967.38 sys This is because when running using shadow page tables TLB flushes and range invalidations are much more expensive, so using unmapped IO provides a very important performance boost. Sponsored by: Citrix Systems R&D Tested by: robak MFC after: 1 week PR: 191173 dev/xen/blkfront/blkfront.c: - Add and announce support for unmapped IO. Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Aug 11 15:06:07 2014 (r269813) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Aug 11 15:37:02 2014 (r269814) @@ -272,8 +272,12 @@ xbd_queue_request(struct xbd_softc *sc, { int error; - error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, - cm->cm_datalen, xbd_queue_cb, cm, 0); + if (cm->cm_bp != NULL) + error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, + cm->cm_bp, xbd_queue_cb, cm, 0); + else + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, + cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); if (error == EINPROGRESS) { /* * Maintain queuing order by freezing the queue. The next @@ -333,8 +337,6 @@ xbd_bio_command(struct xbd_softc *sc) } cm->cm_bp = bp; - cm->cm_data = bp->bio_data; - cm->cm_datalen = bp->bio_bcount; cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; switch (bp->bio_cmd) { @@ -993,7 +995,7 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = 0; + sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; device_printf(sc->xbd_dev, From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 15:41:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDFCB97C for ; Mon, 11 Aug 2014 15:41:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 923A22A2B for ; Mon, 11 Aug 2014 15:41:55 +0000 (UTC) Received: from ache (uid 542) (envelope-from ache@FreeBSD.org) id 27ba by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 15:41:55 +0000 From: Andrey A. Chernov Date: Mon, 11 Aug 2014 15:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269815 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8e443.27ba.4596dd89@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 15:41:55 -0000 Author: ache Date: Mon Aug 11 15:41:55 2014 New Revision: 269815 URL: http://svnweb.freebsd.org/changeset/base/269815 Log: Add otp-sha MFC after: 1 week Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 11 15:37:02 2014 (r269814) +++ head/ObsoleteFiles.inc Mon Aug 11 15:41:55 2014 (r269815) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140811: otp-sha renamed to otp-sha1 +OLD_FILES+=usr/bin/otp-sha +OLD_FILES+=usr/share/man/man1/otp-sha.1.gz # 20140807: Remove private lib files that should not be installed. OLD_FILES+=usr/lib/private/libatf-c.a OLD_FILES+=usr/lib/private/libatf-c.so From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 16:31:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35EF5BC9 for ; Mon, 11 Aug 2014 16:31:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2FD214A for ; Mon, 11 Aug 2014 16:31:29 +0000 (UTC) Received: from gjb (uid 1237) (envelope-from gjb@FreeBSD.org) id 2894 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 16:31:29 +0000 From: Glen Barber Date: Mon, 11 Aug 2014 16:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269816 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8efe1.2894.7404ff5c@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 16:31:29 -0000 Author: gjb Date: Mon Aug 11 16:31:28 2014 New Revision: 269816 URL: http://svnweb.freebsd.org/changeset/base/269816 Log: In arm/release.sh, continue if 'xdev-links' target fails where the target is not valid (stable/10), instead of doing per-branch evaluation on if xdev-links needs to be invoked. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Mon Aug 11 15:41:55 2014 (r269815) +++ head/release/arm/release.sh Mon Aug 11 16:31:28 2014 (r269816) @@ -103,7 +103,7 @@ main() { eval chroot ${CHROOTDIR} make -C /usr/src \ ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ - ${WORLD_FLAGS} xdev-links + ${WORLD_FLAGS} xdev-links || true # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints # is created. From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 16:35:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F368ADD4; Mon, 11 Aug 2014 16:35:45 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9B5B2173; Mon, 11 Aug 2014 16:35:44 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s7BGWYaP018169; Mon, 11 Aug 2014 11:35:38 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1nppmn06k1-1; Mon, 11 Aug 2014 11:35:38 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id EAF9E460148; Mon, 11 Aug 2014 11:35:37 -0500 (CDT) Message-ID: <53E8F0D9.9080900@rice.edu> Date: Mon, 11 Aug 2014 11:35:37 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r269782 - in head/sys/sparc64: include sparc64 References: <53e7a4fc.2898.352aa941@svn.freebsd.org> In-Reply-To: <53e7a4fc.2898.352aa941@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=1.67643676718399e-14 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.714301145562988 urlsuspect_oldscore=0.714301145562988 suspectscore=13 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.714301145562988 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1408110191 Cc: src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 16:35:46 -0000 On 08/10/2014 11:59, Konstantin Belousov wrote: > Author: kib > Date: Sun Aug 10 16:59:39 2014 > New Revision: 269782 > URL: http://svnweb.freebsd.org/changeset/base/269782 > > Log: > On sparc64, do not keep mappings for the destroyed sf_bufs. Sparc64 > pmap, unlike i386, and similar to i386/xen pv, does not tolerate > abandoned mappings for the freed pages. > > Reported and tested by: dumbbell > Diagnosed and reviewed by: alc > Sponsored by: The FreeBSD Foundation This change fixes things on sparc64, but there is also an opportunity here to make sf_buf operations much faster on newer sparc64 hardware. If someone is interested in doing this, then please e-mail me. Basically, if dcache_color_ignore is non-zero, then sparc64's direct map can be used. It shouldn't be a difficult change. > Added: > head/sys/sparc64/include/sf_buf.h > - copied, changed from r269781, head/sys/i386/include/sf_buf.h > Modified: > head/sys/sparc64/include/vmparam.h > head/sys/sparc64/sparc64/vm_machdep.c > > Copied and modified: head/sys/sparc64/include/sf_buf.h (from r269781, head/sys/i386/include/sf_buf.h) > ============================================================================== > --- head/sys/i386/include/sf_buf.h Sun Aug 10 15:21:26 2014 (r269781, copy source) > +++ head/sys/sparc64/include/sf_buf.h Sun Aug 10 16:59:39 2014 (r269782) > @@ -31,6 +31,5 @@ > > void sf_buf_map(struct sf_buf *, int); > int sf_buf_unmap(struct sf_buf *); > -boolean_t sf_buf_invalidate_cache(vm_page_t); > > #endif /* !_MACHINE_SF_BUF_H_ */ > > Modified: head/sys/sparc64/include/vmparam.h > ============================================================================== > --- head/sys/sparc64/include/vmparam.h Sun Aug 10 15:21:26 2014 (r269781) > +++ head/sys/sparc64/include/vmparam.h Sun Aug 10 16:59:39 2014 (r269782) > @@ -240,6 +240,6 @@ extern vm_offset_t vm_max_kernel_address > #define ZERO_REGION_SIZE PAGE_SIZE > > #define SFBUF > -#define SFBUF_NOMD > +#define SFBUF_MAP > > #endif /* !_MACHINE_VMPARAM_H_ */ > > Modified: head/sys/sparc64/sparc64/vm_machdep.c > ============================================================================== > --- head/sys/sparc64/sparc64/vm_machdep.c Sun Aug 10 15:21:26 2014 (r269781) > +++ head/sys/sparc64/sparc64/vm_machdep.c Sun Aug 10 16:59:39 2014 (r269782) > @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -443,3 +444,18 @@ uma_small_free(void *mem, int size, u_in > vm_page_free(m); > atomic_subtract_int(&vm_cnt.v_wire_count, 1); > } > + > +void > +sf_buf_map(struct sf_buf *sf, int flags) > +{ > + > + pmap_qenter(sf->kva, &sf->m, 1); > +} > + > +int > +sf_buf_unmap(struct sf_buf *sf) > +{ > + > + pmap_qremove(sf->kva, 1); > + return (1); > +} > > From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 17:04:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E938814 for ; Mon, 11 Aug 2014 17:04:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 340DD255A for ; Mon, 11 Aug 2014 17:04:05 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 29bb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 17:04:05 +0000 From: Garrett Cooper Date: Mon, 11 Aug 2014 17:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269820 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e8f785.29bb.3ea60116@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 17:04:05 -0000 Author: ngie Date: Mon Aug 11 17:04:04 2014 New Revision: 269820 URL: http://svnweb.freebsd.org/changeset/base/269820 Log: Similar to r250143, optimize MODULES_OVERRIDE such that SUBDIR isn't automatically defined if MODULES_OVERRIDE is defined Approved by: jmmv (mentor) Reviewed by: imp Phabric: D578 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Aug 11 16:57:47 2014 (r269819) +++ head/sys/modules/Makefile Mon Aug 11 17:04:04 2014 (r269820) @@ -8,6 +8,9 @@ SUBDIR_PARALLEL= # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). +.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) +SUBDIR=${MODULES_OVERRIDE} +.else SUBDIR= \ ${_3dfx} \ ${_3dfx_linux} \ @@ -830,9 +833,6 @@ _sound= sound _zfs= zfs .endif .endif - -.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) -SUBDIR=${MODULES_OVERRIDE} .endif .for reject in ${WITHOUT_MODULES} From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 17:45:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14534AC3 for ; Mon, 11 Aug 2014 17:45:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4DD429BC for ; Mon, 11 Aug 2014 17:45:41 +0000 (UTC) Received: from alc (uid 759) (envelope-from alc@FreeBSD.org) id 2d1e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 17:45:41 +0000 From: Alan Cox Date: Mon, 11 Aug 2014 17:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269822 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e90145.2d1e.35def4e2@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 17:45:42 -0000 Author: alc Date: Mon Aug 11 17:45:41 2014 New Revision: 269822 URL: http://svnweb.freebsd.org/changeset/base/269822 Log: Change {_,}pmap_allocpte() so that they look for the flag PMAP_ENTER_NOSLEEP instead of M_NOWAIT/M_WAITOK when deciding whether to sleep on page table page allocation. (The same functions in the i386/xen and mips pmap implementations already use PMAP_ENTER_NOSLEEP.) X-MFC with: r269728 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Aug 11 17:34:25 2014 (r269821) +++ head/sys/i386/i386/pmap.c Mon Aug 11 17:45:41 2014 (r269822) @@ -331,9 +331,9 @@ static void pmap_update_pde(pmap_t pmap, pd_entry_t newpde); static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde); -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, u_int flags); -static vm_page_t _pmap_allocpte(pmap_t pmap, u_int ptepindex, int flags); +static vm_page_t _pmap_allocpte(pmap_t pmap, u_int ptepindex, u_int flags); static void _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spglist *free); static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offset_t va); static void pmap_pte_release(pt_entry_t *pte); @@ -1818,21 +1818,17 @@ pmap_pinit(pmap_t pmap) * mapped correctly. */ static vm_page_t -_pmap_allocpte(pmap_t pmap, u_int ptepindex, int flags) +_pmap_allocpte(pmap_t pmap, u_int ptepindex, u_int flags) { vm_paddr_t ptepa; vm_page_t m; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - /* * Allocate a page table page. */ if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { - if (flags & M_WAITOK) { + if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); VM_WAIT; @@ -1864,16 +1860,12 @@ _pmap_allocpte(pmap_t pmap, u_int ptepin } static vm_page_t -pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpte(pmap_t pmap, vm_offset_t va, u_int flags) { u_int ptepindex; pd_entry_t ptepa; vm_page_t m; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - /* * Calculate pagetable page index */ @@ -1906,7 +1898,7 @@ retry: * been deallocated. */ m = _pmap_allocpte(pmap, ptepindex, flags); - if (m == NULL && (flags & M_WAITOK)) + if (m == NULL && (flags & PMAP_ENTER_NOSLEEP) == 0) goto retry; } return (m); @@ -3468,12 +3460,11 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv_entry_t pv; vm_paddr_t opa, pa; vm_page_t mpte, om; - boolean_t invlva, nosleep, wired; + boolean_t invlva, wired; va = trunc_page(va); mpte = NULL; wired = (flags & PMAP_ENTER_WIRED) != 0; - nosleep = (flags & PMAP_ENTER_NOSLEEP) != 0; KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, @@ -3491,9 +3482,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * resident, we are creating it here. */ if (va < VM_MAXUSER_ADDRESS) { - mpte = pmap_allocpte(pmap, va, nosleep ? M_NOWAIT : M_WAITOK); + mpte = pmap_allocpte(pmap, va, flags); if (mpte == NULL) { - KASSERT(nosleep, + KASSERT((flags & PMAP_ENTER_NOSLEEP) != 0, ("pmap_allocpte failed with sleep allowed")); sched_unpin(); rw_wunlock(&pvh_global_lock); @@ -3828,7 +3819,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ mpte->wire_count++; } else { mpte = _pmap_allocpte(pmap, ptepindex, - M_NOWAIT); + PMAP_ENTER_NOSLEEP); if (mpte == NULL) return (mpte); } @@ -4154,7 +4145,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm */ if ((ptetemp & PG_MANAGED) != 0) { dstmpte = pmap_allocpte(dst_pmap, addr, - M_NOWAIT); + PMAP_ENTER_NOSLEEP); if (dstmpte == NULL) goto out; dst_pte = pmap_pte_quick(dst_pmap, addr); From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 18:26:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E38B92A for ; Mon, 11 Aug 2014 18:26:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E776F2FE6 for ; Mon, 11 Aug 2014 18:26:57 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 2e27 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 18:26:57 +0000 From: John Baldwin Date: Mon, 11 Aug 2014 18:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269824 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e90af1.2e27.3eae78d1@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 18:26:58 -0000 Author: jhb Date: Mon Aug 11 18:26:57 2014 New Revision: 269824 URL: http://svnweb.freebsd.org/changeset/base/269824 Log: Fix a typo. PR: 192294 Submitted by: Conrad Meyer Modified: head/share/man/man9/vm_page_busy.9 Modified: head/share/man/man9/vm_page_busy.9 ============================================================================== --- head/share/man/man9/vm_page_busy.9 Mon Aug 11 18:09:37 2014 (r269823) +++ head/share/man/man9/vm_page_busy.9 Mon Aug 11 18:26:57 2014 (r269824) @@ -95,7 +95,7 @@ themselves. For example, when a thread wants to access or update page contents without a lock held the page is shared busied. .Pp -Before busing a page the vm_object lock must be held. +Before busying a page the vm_object lock must be held. The same rule applies when a page is unbusied. This makes the vm_object lock a real busy interlock. .Pp From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 18:42:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76FB1819 for ; Mon, 11 Aug 2014 18:42:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5C92220 for ; Mon, 11 Aug 2014 18:42:21 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2878 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 18:42:20 +0000 From: Warner Losh Date: Mon, 11 Aug 2014 18:42: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: r269825 - stable/10/usr.sbin/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e90e8d.2878.29cbb502@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 18:42:21 -0000 Author: imp Date: Mon Aug 11 18:42:20 2014 New Revision: 269825 URL: http://svnweb.freebsd.org/changeset/base/269825 Log: MFC: Merge in the changes in -current: Support ! operator in "files" files. Improve error detection and reporting Cleanup code to make it easier to maintain. Remove mandatory keyword: it has been used for 17 years. Bump version number (we should have bumped for -I too, but didn't) r261501 | imp | 2014-02-04 17:26:11 -0700 (Tue, 04 Feb 2014) | 5 lines Fix ! by not clearing not at the bottom of the loop. Add a blank line Submitted by: bde (blank line) r261493 | imp | 2014-02-04 11:28:58 -0700 (Tue, 04 Feb 2014) | 5 lines Implement the '!' operator for files* files. It means 'include this only if the specified option is NOT specified.' Bump version because old config won't be able to cope with files* files that have this construct in them. r261446 | imp | 2014-02-03 12:14:36 -0700 (Mon, 03 Feb 2014) | 5 lines Convert the loop by gotos into a for loop to improve readability. I did this only with the inner loop for the token parsing, and not the outer loop which was understandable enough when the extra layers of looping went away... r261445 | imp | 2014-02-03 12:10:33 -0700 (Mon, 03 Feb 2014) | 4 lines Fix a bug introduced in r261437 that failed to honor "optional profiling-routine" to work, since profiling-routine is not really an option or a device, but a special case elsewhere in the code. r261444 | imp | 2014-02-03 11:56:41 -0700 (Mon, 03 Feb 2014) | 2 lines Slight cleanup to the error messaging to compress code vertically... r261442 | imp | 2014-02-03 11:31:51 -0700 (Mon, 03 Feb 2014) | 2 lines Better error messages when EOF is hit in the middle of a phrase. r261438 | imp | 2014-02-03 09:54:53 -0700 (Mon, 03 Feb 2014) | 5 lines Move the check for standard keyword + optional inclusion specifier to its proper location. Otherwise you could have 'file.c standard pci' without an error. This construct isn't in our tree, and has no well defined meaning. r261437 | imp | 2014-02-03 09:47:10 -0700 (Mon, 03 Feb 2014) | 4 lines Don't believe we have a requirement until after we've checked all the known key words. This will make error messages slightly better in weird corner cases, but should otherwise be a nop. r261436 | imp | 2014-02-03 09:46:01 -0700 (Mon, 03 Feb 2014) | 3 lines In the 17 years since r30796, the mandatory keyword has never been used in any files as far as I can tell, and is currently unused. Retire it. r261435 | imp | 2014-02-03 08:10:44 -0700 (Mon, 03 Feb 2014) | 6 lines Slightly deobfuscate read_file() and likely pessimize the runtime performance by epsilon. (Translation: elminate bogus macros that hid 'returns' making it hard to read and moved a block of code inline rather than at the end of the fuction where it was effectively a 'gosub' kind of goto). Modified: stable/10/usr.sbin/config/configvers.h stable/10/usr.sbin/config/mkmakefile.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/config/configvers.h ============================================================================== --- stable/10/usr.sbin/config/configvers.h Mon Aug 11 18:26:57 2014 (r269824) +++ stable/10/usr.sbin/config/configvers.h Mon Aug 11 18:42:20 2014 (r269825) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600012 +#define CONFIGVERS 600013 #define MAJOR_VERS(x) ((x) / 100000) Modified: stable/10/usr.sbin/config/mkmakefile.c ============================================================================== --- stable/10/usr.sbin/config/mkmakefile.c Mon Aug 11 18:26:57 2014 (r269824) +++ stable/10/usr.sbin/config/mkmakefile.c Mon Aug 11 18:42:20 2014 (r269825) @@ -43,6 +43,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -50,21 +51,6 @@ static const char rcsid[] = #include "config.h" #include "configvers.h" -#define next_word(fp, wd) \ - { char *word = get_word(fp); \ - if (word == (char *)EOF) \ - return; \ - else \ - wd = word; \ - } -#define next_quoted_word(fp, wd) \ - { char *word = get_quoted_word(fp); \ - if (word == (char *)EOF) \ - return; \ - else \ - wd = word; \ - } - static char *tail(char *); static void do_clean(FILE *); static void do_rules(FILE *); @@ -74,6 +60,16 @@ static void do_before_depend(FILE *); static int opteq(const char *, const char *); static void read_files(void); +static void errout(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + exit(1); +} + /* * Lookup a file, by name. */ @@ -313,8 +309,8 @@ read_file(char *fname) struct opt *op; char *wd, *this, *compilewith, *depends, *clean, *warning; const char *objprefix; - int compile, match, nreqs, std, filetype, - imp_rule, no_obj, before_depend, mandatory, nowerror; + int compile, match, nreqs, std, filetype, not, + imp_rule, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); if (fp == 0) @@ -322,7 +318,7 @@ read_file(char *fname) next: /* * include "filename" - * filename [ standard | mandatory | optional ] + * filename [ standard | optional ] * [ dev* [ | dev* ... ] | profiling-routine ] [ no-obj ] * [ compile-with "compile rule" [no-implicit-rule] ] * [ dependency "dependency-list"] [ before-depend ] @@ -343,12 +339,9 @@ next: goto next; } if (eq(wd, "include")) { - next_quoted_word(fp, wd); - if (wd == 0) { - fprintf(stderr, "%s: missing include filename.\n", - fname); - exit(1); - } + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: missing include filename.\n", fname); (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); read_file(ifname); while (((wd = get_word(fp)) != (char *)EOF) && wd) @@ -356,11 +349,11 @@ next: goto next; } this = ns(wd); - next_word(fp, wd); - if (wd == 0) { - fprintf(stderr, "%s: No type for %s.\n", fname, this); - exit(1); - } + wd = get_word(fp); + if (wd == (char *)EOF) + return; + if (wd == 0) + errout("%s: No type for %s.\n", fname, this); tp = fl_lookup(this); compile = 0; match = 1; @@ -369,186 +362,154 @@ next: depends = 0; clean = 0; warning = 0; - std = mandatory = 0; + std = 0; imp_rule = 0; no_obj = 0; before_depend = 0; nowerror = 0; + not = 0; filetype = NORMAL; objprefix = ""; - if (eq(wd, "standard")) { + if (eq(wd, "standard")) std = 1; - /* - * If an entry is marked "mandatory", config will abort if it's - * not called by a configuration line in the config file. Apart - * from this, the device is handled like one marked "optional". - */ - } else if (eq(wd, "mandatory")) { - mandatory = 1; - } else if (!eq(wd, "optional")) { - fprintf(stderr, - "%s: \"%s\" %s must be optional, mandatory or standard\n", + else if (!eq(wd, "optional")) + errout("%s: \"%s\" %s must be optional or standard\n", fname, wd, this); - exit(1); - } -nextparam: - next_word(fp, wd); - if (wd == 0) { - compile += match; - if (compile && tp == NULL) - goto doneparam; - goto next; - } - if (eq(wd, "|")) { - if (nreqs == 0) { - fprintf(stderr, "%s: syntax error describing %s\n", - fname, this); - exit(1); + for (wd = get_word(fp); wd; wd = get_word(fp)) { + if (wd == (char *)EOF) + return; + if (eq(wd, "!")) { + not = 1; + continue; + } + if (eq(wd, "|")) { + if (nreqs == 0) + errout("%s: syntax error describing %s\n", + fname, this); + if (not) + compile += !match; + else + compile += match; + match = 1; + nreqs = 0; + not = 0; + continue; + } + if (eq(wd, "no-obj")) { + no_obj++; + continue; + } + if (eq(wd, "no-implicit-rule")) { + if (compilewith == 0) + errout("%s: alternate rule required when " + "\"no-implicit-rule\" is specified for" + " %s.\n", + fname, this); + imp_rule++; + continue; + } + if (eq(wd, "before-depend")) { + before_depend++; + continue; + } + if (eq(wd, "dependency")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing dependency string.\n", + fname, this); + depends = ns(wd); + continue; + } + if (eq(wd, "clean")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing clean file list.\n", + fname, this); + clean = ns(wd); + continue; + } + if (eq(wd, "compile-with")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing compile command string.\n", + fname, this); + compilewith = ns(wd); + continue; + } + if (eq(wd, "warning")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing warning text string.\n", + fname, this); + warning = ns(wd); + continue; + } + if (eq(wd, "obj-prefix")) { + wd = get_quoted_word(fp); + if (wd == (char *)EOF || wd == 0) + errout("%s: %s missing object prefix string.\n", + fname, this); + objprefix = ns(wd); + continue; + } + if (eq(wd, "nowerror")) { + nowerror = 1; + continue; } + if (eq(wd, "local")) { + filetype = LOCAL; + continue; + } + if (eq(wd, "no-depend")) { + filetype = NODEPEND; + continue; + } + nreqs++; + if (eq(wd, "profiling-routine")) { + filetype = PROFILING; + continue; + } + if (std) + errout("standard entry %s has optional inclusion specifier %s!\n", + this, wd); + STAILQ_FOREACH(dp, &dtab, d_next) + if (eq(dp->d_name, wd)) { + dp->d_done |= DEVDONE; + goto nextparam; + } + SLIST_FOREACH(op, &opt, op_next) + if (op->op_value == 0 && opteq(op->op_name, wd)) + goto nextparam; + match = 0; +nextparam:; + } + if (not) + compile += !match; + else compile += match; - match = 1; - nreqs = 0; - goto nextparam; - } - if (eq(wd, "no-obj")) { - no_obj++; - goto nextparam; + if (compile && tp == NULL) { + if (std == 0 && nreqs == 0) + errout("%s: what is %s optional on?\n", + fname, this); + if (filetype == PROFILING && profiling == 0) + goto next; + tp = new_fent(); + tp->f_fn = this; + tp->f_type = filetype; + if (imp_rule) + tp->f_flags |= NO_IMPLCT_RULE; + if (no_obj) + tp->f_flags |= NO_OBJ; + if (before_depend) + tp->f_flags |= BEFORE_DEPEND; + if (nowerror) + tp->f_flags |= NOWERROR; + tp->f_compilewith = compilewith; + tp->f_depends = depends; + tp->f_clean = clean; + tp->f_warn = warning; + tp->f_objprefix = objprefix; } - if (eq(wd, "no-implicit-rule")) { - if (compilewith == 0) { - fprintf(stderr, "%s: alternate rule required when " - "\"no-implicit-rule\" is specified.\n", - fname); - } - imp_rule++; - goto nextparam; - } - if (eq(wd, "before-depend")) { - before_depend++; - goto nextparam; - } - if (eq(wd, "dependency")) { - next_quoted_word(fp, wd); - if (wd == 0) { - fprintf(stderr, - "%s: %s missing dependency string.\n", - fname, this); - exit(1); - } - depends = ns(wd); - goto nextparam; - } - if (eq(wd, "clean")) { - next_quoted_word(fp, wd); - if (wd == 0) { - fprintf(stderr, "%s: %s missing clean file list.\n", - fname, this); - exit(1); - } - clean = ns(wd); - goto nextparam; - } - if (eq(wd, "compile-with")) { - next_quoted_word(fp, wd); - if (wd == 0) { - fprintf(stderr, - "%s: %s missing compile command string.\n", - fname, this); - exit(1); - } - compilewith = ns(wd); - goto nextparam; - } - if (eq(wd, "warning")) { - next_quoted_word(fp, wd); - if (wd == 0) { - fprintf(stderr, - "%s: %s missing warning text string.\n", - fname, this); - exit(1); - } - warning = ns(wd); - goto nextparam; - } - if (eq(wd, "obj-prefix")) { - next_quoted_word(fp, wd); - if (wd == 0) { - printf("%s: %s missing object prefix string.\n", - fname, this); - exit(1); - } - objprefix = ns(wd); - goto nextparam; - } - nreqs++; - if (eq(wd, "local")) { - filetype = LOCAL; - goto nextparam; - } - if (eq(wd, "no-depend")) { - filetype = NODEPEND; - goto nextparam; - } - if (eq(wd, "profiling-routine")) { - filetype = PROFILING; - goto nextparam; - } - if (eq(wd, "nowerror")) { - nowerror = 1; - goto nextparam; - } - STAILQ_FOREACH(dp, &dtab, d_next) - if (eq(dp->d_name, wd)) { - dp->d_done |= DEVDONE; - goto nextparam; - } - if (mandatory) { - fprintf(stderr, "%s: mandatory device \"%s\" not found\n", - fname, wd); - exit(1); - } - if (std) { - fprintf(stderr, - "standard entry %s has a device keyword - %s!\n", - this, wd); - exit(1); - } - SLIST_FOREACH(op, &opt, op_next) - if (op->op_value == 0 && opteq(op->op_name, wd)) - goto nextparam; - match = 0; - goto nextparam; - -doneparam: - if (std == 0 && nreqs == 0) { - fprintf(stderr, "%s: what is %s optional on?\n", - fname, this); - exit(1); - } - - if (wd) { - fprintf(stderr, "%s: syntax error describing %s\n", - fname, this); - exit(1); - } - if (filetype == PROFILING && profiling == 0) - goto next; - tp = new_fent(); - tp->f_fn = this; - tp->f_type = filetype; - if (imp_rule) - tp->f_flags |= NO_IMPLCT_RULE; - if (no_obj) - tp->f_flags |= NO_OBJ; - if (before_depend) - tp->f_flags |= BEFORE_DEPEND; - if (nowerror) - tp->f_flags |= NOWERROR; - tp->f_compilewith = compilewith; - tp->f_depends = depends; - tp->f_clean = clean; - tp->f_warn = warning; - tp->f_objprefix = objprefix; goto next; } From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 19:03:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0795662 for ; Mon, 11 Aug 2014 19:03:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 809D12561 for ; Mon, 11 Aug 2014 19:03:20 +0000 (UTC) Received: from jmg (uid 686) (envelope-from jmg@FreeBSD.org) id 2fb9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 19:03:20 +0000 From: John-Mark Gurney Date: Mon, 11 Aug 2014 19:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269828 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e91378.2fb9.18277257@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 19:03:20 -0000 Author: jmg Date: Mon Aug 11 19:03:20 2014 New Revision: 269828 URL: http://svnweb.freebsd.org/changeset/base/269828 Log: add myself as opencrypto maintainer as I'm doing some work in the area... Note that documentation is requires for commits to what I maintain... Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Aug 11 18:57:22 2014 (r269827) +++ head/MAINTAINERS Mon Aug 11 19:03:20 2014 (r269828) @@ -20,7 +20,7 @@ It is not a registry of 'turf' or privat subsystem login notes ----------------------------- -kqueue jmg Pre-commit review requested. +kqueue jmg Pre-commit review requested. Documentation Required. libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. UFS EAs rwatson Pre-commit review requested. @@ -132,3 +132,4 @@ release/release.sh gjb Pre-commit review requested. nanobsd imp Pre-commit review requested for coordination. vmm(4) neel,grehan Pre-commit review requested. +opencrypto jmg Pre-commit review requested. Documentation Required. From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 19:19:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7E0E139 for ; Mon, 11 Aug 2014 19:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC6A926CB for ; Mon, 11 Aug 2014 19:19:49 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2518 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 19:19:49 +0000 From: Peter Wemm Date: Mon, 11 Aug 2014 19:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r269830 - vendor/subversion/subversion-1.8.10 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e91755.2518.738d1c5e@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 19:19:50 -0000 Author: peter Date: Mon Aug 11 19:19:49 2014 New Revision: 269830 URL: http://svnweb.freebsd.org/changeset/base/269830 Log: Tag svn-1.8.10 import Added: vendor/subversion/subversion-1.8.10/ - copied from r269829, vendor/subversion/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 19:20:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94F3126F for ; Mon, 11 Aug 2014 19:20:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8238C26D3 for ; Mon, 11 Aug 2014 19:20:31 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2a81 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 19:20:31 +0000 From: Peter Wemm Date: Mon, 11 Aug 2014 19:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r269831 - in vendor/serf/dist: . buckets X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9177f.2a81.443a3053@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 19:20:31 -0000 Author: peter Date: Mon Aug 11 19:20:30 2014 New Revision: 269831 URL: http://svnweb.freebsd.org/changeset/base/269831 Log: Import serf-1.3.7 Modified: vendor/serf/dist/CHANGES vendor/serf/dist/buckets/ssl_buckets.c vendor/serf/dist/serf.h Modified: vendor/serf/dist/CHANGES ============================================================================== --- vendor/serf/dist/CHANGES Mon Aug 11 19:19:49 2014 (r269830) +++ vendor/serf/dist/CHANGES Mon Aug 11 19:20:30 2014 (r269831) @@ -1,8 +1,11 @@ -Serf 1.3.6 [2014-06-09, from /tags/1.3.6, rxxxx] +Serf 1.3.7 [2014-08-11, from /tags/1.3.7, r2411] + Handle NUL bytes in fields of an X.509 certificate. (r2393, r2399) + +Serf 1.3.6 [2014-06-09, from /tags/1.3.6, r2372] Revert r2319 from serf 1.3.5: this change was making serf call handle_response multiple times in case of an error response, leading to unexpected behavior. -Serf 1.3.5 [2014-04-27, from /tags/1.3.5, rxxxx] +Serf 1.3.5 [2014-04-27, from /tags/1.3.5, r2355] Fix issue #125: no reverse lookup during Negotiate authentication for proxies. Fix a crash caused by incorrect reuse of the ssltunnel CONNECT request (r2316) Cancel request if response parsing failed + authn callback set (r2319) Modified: vendor/serf/dist/buckets/ssl_buckets.c ============================================================================== --- vendor/serf/dist/buckets/ssl_buckets.c Mon Aug 11 19:19:49 2014 (r269830) +++ vendor/serf/dist/buckets/ssl_buckets.c Mon Aug 11 19:20:30 2014 (r269831) @@ -202,6 +202,8 @@ struct serf_ssl_certificate_t { }; static void disable_compression(serf_ssl_context_t *ssl_ctx); +static char * + pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool); #if SSL_VERBOSE /* Log all ssl alerts that we receive from the server. */ @@ -427,6 +429,85 @@ static BIO_METHOD bio_file_method = { #endif }; +typedef enum san_copy_t { + EscapeNulAndCopy = 0, + ErrorOnNul = 1, +} san_copy_t; + + +static apr_status_t +get_subject_alt_names(apr_array_header_t **san_arr, X509 *ssl_cert, + san_copy_t copy_action, apr_pool_t *pool) +{ + STACK_OF(GENERAL_NAME) *names; + + /* assert: copy_action == ErrorOnNul || (san_arr && pool) */ + + if (san_arr) { + *san_arr = NULL; + } + + /* Get subjectAltNames */ + names = X509_get_ext_d2i(ssl_cert, NID_subject_alt_name, NULL, NULL); + if (names) { + int names_count = sk_GENERAL_NAME_num(names); + int name_idx; + + if (san_arr) + *san_arr = apr_array_make(pool, names_count, sizeof(char*)); + for (name_idx = 0; name_idx < names_count; name_idx++) { + char *p = NULL; + GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, name_idx); + + switch (nm->type) { + case GEN_DNS: + if (copy_action == ErrorOnNul && + strlen(nm->d.ia5->data) != nm->d.ia5->length) + return SERF_ERROR_SSL_CERT_FAILED; + if (san_arr && *san_arr) + p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data, + nm->d.ia5->length, + pool); + break; + default: + /* Don't know what to do - skip. */ + break; + } + + if (p) { + APR_ARRAY_PUSH(*san_arr, char*) = p; + } + } + sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); + } + + return APR_SUCCESS; +} + +static apr_status_t validate_cert_hostname(X509 *server_cert, apr_pool_t *pool) +{ + char buf[1024]; + int length; + apr_status_t ret; + + ret = get_subject_alt_names(NULL, server_cert, ErrorOnNul, NULL); + if (ret) { + return ret; + } else { + /* Fail if the subject's CN field contains \0 characters. */ + X509_NAME *subject = X509_get_subject_name(server_cert); + if (!subject) + return SERF_ERROR_SSL_CERT_FAILED; + + length = X509_NAME_get_text_by_NID(subject, NID_commonName, buf, 1024); + if (length != -1) + if (strlen(buf) != length) + return SERF_ERROR_SSL_CERT_FAILED; + } + + return APR_SUCCESS; +} + static int validate_server_certificate(int cert_valid, X509_STORE_CTX *store_ctx) { @@ -435,6 +516,7 @@ validate_server_certificate(int cert_val X509 *server_cert; int err, depth; int failures = 0; + apr_status_t status; ssl = X509_STORE_CTX_get_ex_data(store_ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); @@ -475,6 +557,11 @@ validate_server_certificate(int cert_val } } + /* Validate hostname */ + status = validate_cert_hostname(server_cert, ctx->pool); + if (status) + failures |= SERF_SSL_CERT_UNKNOWN_FAILURE; + /* Check certificate expiry dates. */ if (X509_cmp_current_time(X509_get_notBefore(server_cert)) >= 0) { failures |= SERF_SSL_CERT_NOTYETVALID; @@ -485,7 +572,6 @@ validate_server_certificate(int cert_val if (ctx->server_cert_callback && (depth == 0 || failures)) { - apr_status_t status; serf_ssl_certificate_t *cert; apr_pool_t *subpool; @@ -512,7 +598,6 @@ validate_server_certificate(int cert_val if (ctx->server_cert_chain_callback && (depth == 0 || failures)) { - apr_status_t status; STACK_OF(X509) *chain; const serf_ssl_certificate_t **certs; int certs_len; @@ -1461,7 +1546,50 @@ serf_ssl_context_t *serf_bucket_ssl_encr /* Functions to read a serf_ssl_certificate structure. */ -/* Creates a hash_table with keys (E, CN, OU, O, L, ST and C). */ +/* Takes a counted length string and escapes any NUL bytes so that + * it can be used as a C string. NUL bytes are escaped as 3 characters + * "\00" (that's a literal backslash). + * The returned string is allocated in POOL. + */ +static char * +pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool) +{ + int i, nul_count = 0; + char *ret; + + /* First determine if there are any nul bytes in the string. */ + for (i = 0; i < len; i++) { + if (buf[i] == '\0') + nul_count++; + } + + if (nul_count == 0) { + /* There aren't so easy case to just copy the string */ + ret = apr_pstrdup(pool, buf); + } else { + /* There are so we have to replace nul bytes with escape codes + * Proper length is the length of the original string, plus + * 2 times the number of nulls (for two digit hex code for + * the value) + the trailing null. */ + char *pos; + ret = pos = apr_palloc(pool, len + 2 * nul_count + 1); + for (i = 0; i < len; i++) { + if (buf[i] != '\0') { + *(pos++) = buf[i]; + } else { + *(pos++) = '\\'; + *(pos++) = '0'; + *(pos++) = '0'; + } + } + *pos = '\0'; + } + + return ret; +} + +/* Creates a hash_table with keys (E, CN, OU, O, L, ST and C). Any NUL bytes in + these fields in the certificate will be escaped as \00. */ static apr_hash_t * convert_X509_NAME_to_table(X509_NAME *org, apr_pool_t *pool) { @@ -1474,37 +1602,44 @@ convert_X509_NAME_to_table(X509_NAME *or NID_commonName, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "CN", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "CN", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); ret = X509_NAME_get_text_by_NID(org, NID_pkcs9_emailAddress, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "E", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "E", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); ret = X509_NAME_get_text_by_NID(org, NID_organizationalUnitName, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "OU", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "OU", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); ret = X509_NAME_get_text_by_NID(org, NID_organizationName, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "O", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "O", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); ret = X509_NAME_get_text_by_NID(org, NID_localityName, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "L", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "L", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); ret = X509_NAME_get_text_by_NID(org, NID_stateOrProvinceName, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "ST", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "ST", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); ret = X509_NAME_get_text_by_NID(org, NID_countryName, buf, 1024); if (ret != -1) - apr_hash_set(tgt, "C", APR_HASH_KEY_STRING, apr_pstrdup(pool, buf)); + apr_hash_set(tgt, "C", APR_HASH_KEY_STRING, + pstrdup_escape_nul_bytes(buf, ret, pool)); return tgt; } @@ -1550,7 +1685,7 @@ apr_hash_t *serf_ssl_cert_certificate( unsigned int md_size, i; unsigned char md[EVP_MAX_MD_SIZE]; BIO *bio; - STACK_OF(GENERAL_NAME) *names; + apr_array_header_t *san_arr; /* sha1 fingerprint */ if (X509_digest(cert->ssl_cert, EVP_sha1(), md, &md_size)) { @@ -1595,32 +1730,8 @@ apr_hash_t *serf_ssl_cert_certificate( BIO_free(bio); /* Get subjectAltNames */ - names = X509_get_ext_d2i(cert->ssl_cert, NID_subject_alt_name, NULL, NULL); - if (names) { - int names_count = sk_GENERAL_NAME_num(names); - - apr_array_header_t *san_arr = apr_array_make(pool, names_count, - sizeof(char*)); + if (!get_subject_alt_names(&san_arr, cert->ssl_cert, EscapeNulAndCopy, pool)) apr_hash_set(tgt, "subjectAltName", APR_HASH_KEY_STRING, san_arr); - for (i = 0; i < names_count; i++) { - char *p = NULL; - GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, i); - - switch (nm->type) { - case GEN_DNS: - p = apr_pstrmemdup(pool, (const char *)nm->d.ia5->data, - nm->d.ia5->length); - break; - default: - /* Don't know what to do - skip. */ - break; - } - if (p) { - APR_ARRAY_PUSH(san_arr, char*) = p; - } - } - sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); - } return tgt; } Modified: vendor/serf/dist/serf.h ============================================================================== --- vendor/serf/dist/serf.h Mon Aug 11 19:19:49 2014 (r269830) +++ vendor/serf/dist/serf.h Mon Aug 11 19:20:30 2014 (r269831) @@ -1062,7 +1062,7 @@ void serf_debug__bucket_alloc_check( /* Version info */ #define SERF_MAJOR_VERSION 1 #define SERF_MINOR_VERSION 3 -#define SERF_PATCH_VERSION 6 +#define SERF_PATCH_VERSION 7 /* Version number string */ #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 19:20:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D353B0 for ; Mon, 11 Aug 2014 19:20:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E02CE26E2 for ; Mon, 11 Aug 2014 19:20:56 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2aac by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 19:20:56 +0000 From: Peter Wemm Date: Mon, 11 Aug 2014 19:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r269832 - in vendor/serf/serf-1.3.7: . buckets X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e91798.2aac.617d7d2c@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 19:20:57 -0000 Author: peter Date: Mon Aug 11 19:20:56 2014 New Revision: 269832 URL: http://svnweb.freebsd.org/changeset/base/269832 Log: Tag serf-1.3.7 import Added: vendor/serf/serf-1.3.7/ - copied from r268959, vendor/serf/dist/ Replaced: vendor/serf/serf-1.3.7/CHANGES - copied unchanged from r269831, vendor/serf/dist/CHANGES vendor/serf/serf-1.3.7/buckets/ssl_buckets.c - copied unchanged from r269831, vendor/serf/dist/buckets/ssl_buckets.c vendor/serf/serf-1.3.7/serf.h - copied unchanged from r269831, vendor/serf/dist/serf.h Copied: vendor/serf/serf-1.3.7/CHANGES (from r269831, vendor/serf/dist/CHANGES) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/serf/serf-1.3.7/CHANGES Mon Aug 11 19:20:56 2014 (r269832, copy of r269831, vendor/serf/dist/CHANGES) @@ -0,0 +1,283 @@ +Serf 1.3.7 [2014-08-11, from /tags/1.3.7, r2411] + Handle NUL bytes in fields of an X.509 certificate. (r2393, r2399) + +Serf 1.3.6 [2014-06-09, from /tags/1.3.6, r2372] + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. + +Serf 1.3.5 [2014-04-27, from /tags/1.3.5, r2355] + Fix issue #125: no reverse lookup during Negotiate authentication for proxies. + Fix a crash caused by incorrect reuse of the ssltunnel CONNECT request (r2316) + Cancel request if response parsing failed + authn callback set (r2319) + Update the expired certificates in the test suite. + + +Serf 1.3.4 [2014-02-08, from /tags/1.3.4, r2310] + Fix issue #119: Endless loop during ssl tunnel setup with Negotiate authn + Fix issue #123: Can't setup ssl tunnel which sends Connection close header + Fix a race condition when initializing OpenSSL from multiple threads (r2263) + Fix issue #138: Incorrect pkg-config file when GSSAPI isn't configured + + +Serf 1.3.3 [2013-12-09, from /tags/1.3.3, r2242] + Fix issue 129: Try more addresses of multihomed servers + Handle X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE correctly (r2225) + Return APR_TIMEUP from poll() to enable detecting connection timeouts (r2183) + + +Serf 1.3.2 [2013-10-04, from /tags/1.3.2, r2195] + Fix issue 130: HTTP headers should be treated case-insensitively + Fix issue 126: Compilation breaks with Codewarrior compiler + Fix crash during cleanup of SSL buckets in apr_terminate() (r2145) + Fix Windows build: Also export functions with capital letters in .def file + Fix host header when url contains a username or password (r2170) + Ensure less TCP package fragmentation on Windows (r2145) + Handle authentication for responses to HEAD requests (r2178,-9) + Improve serf_get: add option to add request headers, allow url with query, + allow HEAD requests (r2143,r2175,-6) + Improve RFC conformance: don't expect body for certain responses (r2011,-2) + Do not invoke progress callback when no data was received (r2144) + And more test suite fixes and build warning cleanups + SCons-related fixes: + Fix build when GSSAPI not in default include path (2155) + Fix OpenBSD build: always map all LIBPATH entries into RPATH (r2156) + Checksum generation in Windows shared libraries for release builds (2162) + Mac OS X: Use MAJOR version only in dylib install name (r2161) + Use both MAJOR and MINOR version for the shared library name (2163) + Fix the .pc file when installing serf in a non-default LIBDIR (r2191) + + +Serf 1.3.1 [2013-08-15, from /tags/1.3.1, r2138] + Fix issue 77: Endless loop if server doesn't accept Negotiate authentication. + Fix issue 114: ssl/tls renegotiation fails + Fix issue 120: error with ssl tunnel over proxy with KeepAlive off and + Basic authentication. + Fixed bugs with authentication (r2057,2115,2118) + SCons-related fixes: + Fix issue 111: add flag to set custom library path + Fix issue 112: add soname + Fix issue 113: add gssapi libs in the serf pc file + Fix issue 115: Setting RPATH on Solaris broken in SConstruct + Fix issue 116: scons check should return non-zero exit staths + Fix issue 121: make CFLAGS, LIBS, LINKFLAGS and CPPFLAGS take a space- + separated list of flags. + Fix issue 122: make scons PREFIX create the folder if it doesn't exist + Mac OS X: Fix scons --install-sandbox + Solaris: Fix build with cc, don't use unsupported compiler flags + Require SCons version 2.3.0 or higher now (for the soname support). + + +Serf 1.3.0 [2013-07-23, from /tags/1.3.0, r2074] + Fix issue 83: use PATH rather than URI within an ssltunnel (r1952) + Fix issue 108: improved error reporting from the underlying socket (r1951) + NEW: Switch to the SCons build system; retire serfmake, serf.mak, autotools + Improved Basic and Digest authentication: + - remember credentials on a per-server basis + - properly manage authentication realms + - continue functioning when a server sets KeepAlive: off + Windows: add support for NTLM authentication + Improved 2617 compliance: always use strongest authentication (r1968,1971) + Fixed bugs with proxy authentication and SSL tunneling through a proxy + Fixed bugs the response parser (r2032,r2036) + SSL connection performance improvements + Huge expansion of the test suite + + +Serf 1.2.1 [2013-06-03, from /tags/1.2.1, r1906] + Fix issue 95: add gssapi switches to configure (r1864, r1900) + Fix issue 97: skip mmap bucket if APR_HAS_MMAP is undefined (r1877) + Fix issue 100: building against an old Windows Platform SDK (r1881) + Fix issue 102: digest authentication failures (r1885) + Improve error return values in SSPI authentication (r1804) + Ensure serf-1.pc is constructed by serfmake (r1865) + Optimize SPNego authentication processing (r1868) + Reject certs that application does not like (r1794) + Fix possible endless loop in serf_linebuf_fetch() (r1816) + Windows build: dereference INTDIR in serf.mak (r1882) + + +Serf 1.2.0 [2013-02-22, from /tags/1.2.0, r1726] + Fixed issue 94: Serf can enter an infinite loop when server aborts conn. + Fixed issue 91: Serf doesn't handle an incoming 408 Timeout Request + Fixed issue 80: Serf is not handling Negotiate authentication correctly + Fixed issue 77: Endless loop if server doesn't accept Negotiate authn + Fixed issue 93: cleanup-after-fork interferes with parent (r1714) + Fixed most of issue 89: Support REAL SPNEGO authentication + Enable Negotiate/Kerberos support for proxy servers. + Return error when C-L, chunked, gzip encoded response bodies were + truncated (due to aborted connection) (r1688) + Add a logging mechanism that can be enabled at compile-time. + Don't lookup server address if a proxy was configured. (r1706) + Fix an off-by-one in buffer sizing (r1695) + Disable SSL compression by default + API to enable it (r1692) + New serf_connection_get_latency() for estimated network latency (r1689) + New error code and RFC compliance for the HTTPS tunnel (r1701, r1644) + Handle EINTR when a user suspends and then backgrounds the app (r1708) + Minor fixes and test suite improvements. + + +Serf 1.1.1 [2012-10-04, from /tags/1.1.1, r1657] + Fixed issue 86: ensure requeued requests are correctly handled. + This fixes: + - infinite loop with multiple connection resets or SIGPIPE errors + - "connection" hang where we would not re-queue requests that are + held after we re-connect + Fixed issue 74: test_all goes in an endless loop + Fix memleak when conn. is closed explicitly/due to pool cleanups (r1623) + Windows: Fix https connection aborts (r1628..-30,-33,-34,-37) + Add new error codes for the SSL bucket + + +Serf 1.1.0 [2012-06-07, from /tags/1.1.0, r1617] + New: serf_bucket_request_set_CL() for C-L based, non-chunked requests + New: serf_ssl_server_cert_chain_callback_set() for full-chain validation + + +Serf 1.0.3 [2012-03-20, from /tags/1.0.3, r1586] + Map more OpenSSL errors into SERF_SSL_CERT_UNKNOWNCA (r1573) + + +Serf 1.0.2 + Not released. + + +Serf 1.0.1 [2012-02-15, from /tags/1.0.1, r1569] + FreeBSD fixes in the test suite (r1560, r1565) + Minor build fixes + + +Serf 1.0.0 [2011-07-15, from /tags/1.0.0, r1540] + Fixed issue 38: enable builds using non-GNU make + Fixed issue 49: support SSL tunnels for HTTPS via a proxy + Fixed issue 56: allow Subject Alternative Name, and enable SNI + Fixed issue 61: include order dependencies + Fixed issue 66: improved error reporting when creating install dirs + Fixed issue 71: handle ECONNREFUSED on Windows + Fixed issue 79: destroy the APR allocator, if we create one + Fixed issue 81: build failed on APR 0.9.x + Major performance improvements and bug fixes for SSL buckets/handling (r1462) + Add a new "iovec" bucket type (r1434) + Minimize network packet writes based on ra_serf analysis (r1467, r1471) + Fix out of order issue with multiple priority requests (r1469) + Work around broken WSAPoll() impl on Windows introduced in APR 1.4.0 (r1506) + Fix 100% CPU usage with many pipelined requests (r1456) + Corrected contents of build/serf.def; it now includes bucket types (r1512) + Removed "snapshot" feature from buckets (r1503) + Various improvements to the test system + Various memory leak fixes + + +Serf 0.7.2 [2011-03-12, from /tags/0.7.2, r1452] + Actually disable Nagle when creating a connection (r1441) + Return error when app asks for HTTPS over proxy connection (r1433) + + +Serf 0.7.1 [2011-01-25, from /tags/0.7.1, r1432] + Fix memory leak when using SSL (r1408, r1416) + Fix build for blank apr-util directory (r1421) + + +Serf 0.7.0 [2010-08-25, from /tags/0.7.0, r1407] + Fix double free abort when destroying request buckets + Fix test server in unit test framework to avoid random test failures + Allow older Serf programs which don't use the new authn framework to still + handle authn without forcing them to switch to the new framework. (r1401) + Remove the SERF_DECLARE macros, preferring a .DEF file for Windows + Barrier buckets now pass read_iovec to their wrapped bucket + Fix HTTP header parsing to allow for empty header values + + +Serf 0.6.1 [2010-05-14, from /tags/0.6.1, r1370] + Generally: this release fixes problems with the 0.4.0 packaging + Small compilation fix in outgoing.c for Windows builds + + +Serf 0.6.0 + Not released. + + +Serf 0.5.0 + Not released. + + +Serf 0.4.0 + WITHDRAWN: this release misstated itself as 0.5.0; use a later release + + Provide authn framework, supporting Basic, Digest, Kerberos (SSPI, GSS), + along with proxy authn using Basic or Digest + Added experimental listener framework, along with test_server.c + Improvements and fixes to SSL support, including connection setup changes + Experimental support for unrequested, arriving ("async") responses + Experimental BWTP support using the async arrival feature + Headers are combined on read (not write), to ease certian classes of parsing + Experimental feature on aggregate buckets for a callback-on-empty + Fix the bucket allocator for when APR is using its pool debugging features + Proxy support in the serf_get testing utility + Fix to include the port number in the Host header + serf_get propagates errors from the response, instead of aborting (Issue 52) + Added serf_lib_version() for runtime version tests + + +Serf 0.3.1 [2010-02-14, from /tags/0.3.1, r1322] + Fix loss of error on request->setup() callback. (Issue 47) + Support APR 2.x. (Issue 48) + Fixed slowdown in aggregate bucket with millions of child buckets + Avoid hang in apr_pollset_poll() by unclosed connections after fork() + + +Serf 0.3.0 [2009-01-26, from /tags/0.3.0, r1217] + Support LTFLAGS override as a config-time env. variable (Issue 44) + Fix CUTest test harness compilation on Solaris (Issue 43) + Fix small race condition in OpenSSL initialization (Issue 39) + Handle content streams larger than 4GB on 32-bit OSes (Issue 41) + Fix test_ssl.c compilation with mingw+msys + Fix conn close segfault by explicitly closing conn when pool is destroyed + Expose the depth of the SSL certificate so the validator can use that info + Fix socket address family issue when opening a connection to a proxy + Provide new API to take snapshots of buckets + Implement snapshot API for simple and aggregate buckets + Build with bundled apr and apr-util VPATH builds + Build with bundled OpenSSL builds + + +Serf 0.2.0 [2008-06-06, from /tags/0.2.0, r1189] + Enable use of external event loop: serf_create_context_ex + Enable adding new requests at the beginning of the request queue + Handle 'Connection:close' headers + Enable limiting the number of outstanding requests + Add readline function to simple buckets + Concatenate repeated headers using comma as separator, as per RFC 2616, + section 4.2. (Issue 29) + Add proxy server support + Add progress feedback support. (Issue 11) + Provide new API to simplify use of proxy and progress feedback support + Add callback to validate SSL server certificates. (Issue 31) + Add new test framework + Send current version string in the test programs (Issue 21) + Bugfixes: + Fix segfault with epoll when removing a NULL socket + Reset OpenSSL thread-safety callbacks when apr_terminate() called + Do not remove the socket from the pollset on pool cleanup + Do not issue double close on skt w/second one being close(-1) (Issue 33) + + +Serf 0.1.2 [2007-06-18, from /tags/0.1.2, r1115] + Enable thread-safety with OpenSSL (Issue 19) + Teach serfmake to install headers into include/serf-0 + Be more tolerant when servers close the connection without telling us + Do not open the connection until we have requests to deliver + Fix serfmake to produce the library that corresponds to the minor version + Fix a memory leak with the socket bucket (Issue 14) + Fix uninitialized branch in serf_spider (Issue 15) + + +Serf 0.1.1 [2007-05-12, from /tags/0.1.1, r1105] + Add SSL client certificate support + Implement optimized iovec reads for header buckets + Fix up 'make clean' and 'make distclean' (Issues 9, 10) + Add SERF_VERSION_AT_LEAST macro + Remove abort() calls (Issue 13) + + +Serf 0.1.0 [2006-12-14, from /tags/0.1.0, r1087] + Initial packaged release Copied: vendor/serf/serf-1.3.7/buckets/ssl_buckets.c (from r269831, vendor/serf/dist/buckets/ssl_buckets.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/serf/serf-1.3.7/buckets/ssl_buckets.c Mon Aug 11 19:20:56 2014 (r269832, copy of r269831, vendor/serf/dist/buckets/ssl_buckets.c) @@ -0,0 +1,1898 @@ +/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ---- + * + * For the OpenSSL thread-safety locking code: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Originally developed by Aaron Bannert and Justin Erenkrantz, eBuilt. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "serf.h" +#include "serf_private.h" +#include "serf_bucket_util.h" + +#include +#include +#include +#include +#include + +#ifndef APR_VERSION_AT_LEAST /* Introduced in APR 1.3.0 */ +#define APR_VERSION_AT_LEAST(major,minor,patch) \ + (((major) < APR_MAJOR_VERSION) \ + || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION) \ + || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && \ + (patch) <= APR_PATCH_VERSION)) +#endif /* APR_VERSION_AT_LEAST */ + +#ifndef APR_ARRAY_PUSH +#define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) +#endif + + +/* + * Here's an overview of the SSL bucket's relationship to OpenSSL and serf. + * + * HTTP request: SSLENCRYPT(REQUEST) + * [context.c reads from SSLENCRYPT and writes out to the socket] + * HTTP response: RESPONSE(SSLDECRYPT(SOCKET)) + * [handler function reads from RESPONSE which in turn reads from SSLDECRYPT] + * + * HTTP request read call path: + * + * write_to_connection + * |- serf_bucket_read on SSLENCRYPT + * |- serf_ssl_read + * |- serf_databuf_read + * |- common_databuf_prep + * |- ssl_encrypt + * |- 1. Try to read pending encrypted data; If available, return. + * |- 2. Try to read from ctx->stream [REQUEST bucket] + * |- 3. Call SSL_write with read data + * |- ... + * |- bio_bucket_read can be called + * |- bio_bucket_write with encrypted data + * |- store in sink + * |- 4. If successful, read pending encrypted data and return. + * |- 5. If fails, place read data back in ctx->stream + * + * HTTP response read call path: + * + * read_from_connection + * |- acceptor + * |- handler + * |- ... + * |- serf_bucket_read(SSLDECRYPT) + * |- serf_ssl_read + * |- serf_databuf_read + * |- ssl_decrypt + * |- 1. SSL_read() for pending decrypted data; if any, return. + * |- 2. Try to read from ctx->stream [SOCKET bucket] + * |- 3. Append data to ssl_ctx->source + * |- 4. Call SSL_read() + * |- ... + * |- bio_bucket_write can be called + * |- bio_bucket_read + * |- read data from ssl_ctx->source + * |- If data read, return it. + * |- If an error, set the STATUS value and return. + * + */ + +typedef struct bucket_list { + serf_bucket_t *bucket; + struct bucket_list *next; +} bucket_list_t; + +typedef struct { + /* Helper to read data. Wraps stream. */ + serf_databuf_t databuf; + + /* Our source for more data. */ + serf_bucket_t *stream; + + /* The next set of buckets */ + bucket_list_t *stream_next; + + /* The status of the last thing we read. */ + apr_status_t status; + apr_status_t exhausted; + int exhausted_reset; + + /* Data we've read but not processed. */ + serf_bucket_t *pending; +} serf_ssl_stream_t; + +struct serf_ssl_context_t { + /* How many open buckets refer to this context. */ + int refcount; + + /* The pool that this context uses. */ + apr_pool_t *pool; + + /* The allocator associated with the above pool. */ + serf_bucket_alloc_t *allocator; + + /* Internal OpenSSL parameters */ + SSL_CTX *ctx; + SSL *ssl; + BIO *bio; + + serf_ssl_stream_t encrypt; + serf_ssl_stream_t decrypt; + + /* Client cert callbacks */ + serf_ssl_need_client_cert_t cert_callback; + void *cert_userdata; + apr_pool_t *cert_cache_pool; + const char *cert_file_success; + + /* Client cert PW callbacks */ + serf_ssl_need_cert_password_t cert_pw_callback; + void *cert_pw_userdata; + apr_pool_t *cert_pw_cache_pool; + const char *cert_pw_success; + + /* Server cert callbacks */ + serf_ssl_need_server_cert_t server_cert_callback; + serf_ssl_server_cert_chain_cb_t server_cert_chain_callback; + void *server_cert_userdata; + + const char *cert_path; + + X509 *cached_cert; + EVP_PKEY *cached_cert_pw; + + apr_status_t pending_err; + + /* Status of a fatal error, returned on subsequent encrypt or decrypt + requests. */ + apr_status_t fatal_err; +}; + +typedef struct { + /* The bucket-independent ssl context that this bucket is associated with */ + serf_ssl_context_t *ssl_ctx; + + /* Pointer to the 'right' databuf. */ + serf_databuf_t *databuf; + + /* Pointer to our stream, so we can find it later. */ + serf_bucket_t **our_stream; +} ssl_context_t; + +struct serf_ssl_certificate_t { + X509 *ssl_cert; + int depth; +}; + +static void disable_compression(serf_ssl_context_t *ssl_ctx); +static char * + pstrdup_escape_nul_bytes(const char *buf, int len, apr_pool_t *pool); + +#if SSL_VERBOSE +/* Log all ssl alerts that we receive from the server. */ +static void +apps_ssl_info_callback(const SSL *s, int where, int ret) +{ + const char *str; + int w; + w = where & ~SSL_ST_MASK; + + if (w & SSL_ST_CONNECT) + str = "SSL_connect"; + else if (w & SSL_ST_ACCEPT) + str = "SSL_accept"; + else + str = "undefined"; + + if (where & SSL_CB_LOOP) { + serf__log(SSL_VERBOSE, __FILE__, "%s:%s\n", str, + SSL_state_string_long(s)); + } + else if (where & SSL_CB_ALERT) { + str = (where & SSL_CB_READ) ? "read" : "write"; + serf__log(SSL_VERBOSE, __FILE__, "SSL3 alert %s:%s:%s\n", + str, + SSL_alert_type_string_long(ret), + SSL_alert_desc_string_long(ret)); + } + else if (where & SSL_CB_EXIT) { + if (ret == 0) + serf__log(SSL_VERBOSE, __FILE__, "%s:failed in %s\n", str, + SSL_state_string_long(s)); + else if (ret < 0) { + serf__log(SSL_VERBOSE, __FILE__, "%s:error in %s\n", str, + SSL_state_string_long(s)); + } + } +} +#endif + +/* Returns the amount read. */ +static int bio_bucket_read(BIO *bio, char *in, int inlen) +{ + serf_ssl_context_t *ctx = bio->ptr; + const char *data; + apr_status_t status; + apr_size_t len; + + serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_read called for %d bytes\n", + inlen); + + if (ctx->encrypt.status == SERF_ERROR_WAIT_CONN + && BIO_should_read(ctx->bio)) { + serf__log(SSL_VERBOSE, __FILE__, + "bio_bucket_read waiting: (%d %d %d)\n", + BIO_should_retry(ctx->bio), BIO_should_read(ctx->bio), + BIO_get_retry_flags(ctx->bio)); + /* Falling back... */ + ctx->encrypt.exhausted_reset = 1; + BIO_clear_retry_flags(bio); + } + + status = serf_bucket_read(ctx->decrypt.pending, inlen, &data, &len); + + ctx->decrypt.status = status; + + serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_read received %d bytes (%d)\n", + len, status); + + if (!SERF_BUCKET_READ_ERROR(status)) { + /* Oh suck. */ + if (len) { + memcpy(in, data, len); + return len; + } + if (APR_STATUS_IS_EOF(status)) { + BIO_set_retry_read(bio); + return -1; + } + } + + return -1; +} + +/* Returns the amount written. */ +static int bio_bucket_write(BIO *bio, const char *in, int inl) +{ + serf_ssl_context_t *ctx = bio->ptr; + serf_bucket_t *tmp; + + serf__log(SSL_VERBOSE, __FILE__, "bio_bucket_write called for %d bytes\n", + inl); + + if (ctx->encrypt.status == SERF_ERROR_WAIT_CONN + && !BIO_should_read(ctx->bio)) { + serf__log(SSL_VERBOSE, __FILE__, + "bio_bucket_write waiting: (%d %d %d)\n", + BIO_should_retry(ctx->bio), BIO_should_read(ctx->bio), + BIO_get_retry_flags(ctx->bio)); + /* Falling back... */ + ctx->encrypt.exhausted_reset = 1; + BIO_clear_retry_flags(bio); + } + + tmp = serf_bucket_simple_copy_create(in, inl, + ctx->encrypt.pending->allocator); + + serf_bucket_aggregate_append(ctx->encrypt.pending, tmp); + + return inl; +} + +/* Returns the amount read. */ +static int bio_file_read(BIO *bio, char *in, int inlen) +{ + apr_file_t *file = bio->ptr; + apr_status_t status; + apr_size_t len; + + BIO_clear_retry_flags(bio); + + len = inlen; + status = apr_file_read(file, in, &len); + + if (!SERF_BUCKET_READ_ERROR(status)) { + /* Oh suck. */ + if (APR_STATUS_IS_EOF(status)) { + BIO_set_retry_read(bio); + return -1; + } else { + return len; + } + } + + return -1; +} + +/* Returns the amount written. */ +static int bio_file_write(BIO *bio, const char *in, int inl) +{ + apr_file_t *file = bio->ptr; + apr_size_t nbytes; + + BIO_clear_retry_flags(bio); + + nbytes = inl; + apr_file_write(file, in, &nbytes); + + return nbytes; +} + +static int bio_file_gets(BIO *bio, char *in, int inlen) +{ + return bio_file_read(bio, in, inlen); +} + +static int bio_bucket_create(BIO *bio) +{ + bio->shutdown = 1; + bio->init = 1; + bio->num = -1; + bio->ptr = NULL; + + return 1; +} + +static int bio_bucket_destroy(BIO *bio) +{ + /* Did we already free this? */ + if (bio == NULL) { + return 0; + } + + return 1; +} + +static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) +{ + long ret = 1; + + switch (cmd) { + default: + /* abort(); */ + break; + case BIO_CTRL_FLUSH: + /* At this point we can't force a flush. */ + break; + case BIO_CTRL_PUSH: + case BIO_CTRL_POP: + ret = 0; + break; + } + return ret; +} + +static BIO_METHOD bio_bucket_method = { + BIO_TYPE_MEM, + "Serf SSL encryption and decryption buckets", + bio_bucket_write, + bio_bucket_read, + NULL, /* Is this called? */ + NULL, /* Is this called? */ + bio_bucket_ctrl, + bio_bucket_create, + bio_bucket_destroy, +#ifdef OPENSSL_VERSION_NUMBER + NULL /* sslc does not have the callback_ctrl field */ +#endif +}; + +static BIO_METHOD bio_file_method = { + BIO_TYPE_FILE, + "Wrapper around APR file structures", + bio_file_write, + bio_file_read, + NULL, /* Is this called? */ + bio_file_gets, /* Is this called? */ + bio_bucket_ctrl, + bio_bucket_create, + bio_bucket_destroy, +#ifdef OPENSSL_VERSION_NUMBER + NULL /* sslc does not have the callback_ctrl field */ +#endif +}; + +typedef enum san_copy_t { + EscapeNulAndCopy = 0, + ErrorOnNul = 1, +} san_copy_t; + + +static apr_status_t +get_subject_alt_names(apr_array_header_t **san_arr, X509 *ssl_cert, + san_copy_t copy_action, apr_pool_t *pool) +{ + STACK_OF(GENERAL_NAME) *names; + + /* assert: copy_action == ErrorOnNul || (san_arr && pool) */ + + if (san_arr) { + *san_arr = NULL; + } + + /* Get subjectAltNames */ + names = X509_get_ext_d2i(ssl_cert, NID_subject_alt_name, NULL, NULL); + if (names) { + int names_count = sk_GENERAL_NAME_num(names); + int name_idx; + + if (san_arr) + *san_arr = apr_array_make(pool, names_count, sizeof(char*)); + for (name_idx = 0; name_idx < names_count; name_idx++) { + char *p = NULL; + GENERAL_NAME *nm = sk_GENERAL_NAME_value(names, name_idx); + + switch (nm->type) { + case GEN_DNS: + if (copy_action == ErrorOnNul && + strlen(nm->d.ia5->data) != nm->d.ia5->length) + return SERF_ERROR_SSL_CERT_FAILED; + if (san_arr && *san_arr) + p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data, + nm->d.ia5->length, + pool); + break; + default: + /* Don't know what to do - skip. */ + break; + } + + if (p) { + APR_ARRAY_PUSH(*san_arr, char*) = p; + } + } + sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); + } + + return APR_SUCCESS; +} + +static apr_status_t validate_cert_hostname(X509 *server_cert, apr_pool_t *pool) +{ + char buf[1024]; + int length; + apr_status_t ret; + + ret = get_subject_alt_names(NULL, server_cert, ErrorOnNul, NULL); + if (ret) { + return ret; + } else { + /* Fail if the subject's CN field contains \0 characters. */ + X509_NAME *subject = X509_get_subject_name(server_cert); + if (!subject) + return SERF_ERROR_SSL_CERT_FAILED; + + length = X509_NAME_get_text_by_NID(subject, NID_commonName, buf, 1024); + if (length != -1) + if (strlen(buf) != length) + return SERF_ERROR_SSL_CERT_FAILED; + } + + return APR_SUCCESS; +} + +static int +validate_server_certificate(int cert_valid, X509_STORE_CTX *store_ctx) +{ + SSL *ssl; + serf_ssl_context_t *ctx; + X509 *server_cert; + int err, depth; + int failures = 0; + apr_status_t status; + + ssl = X509_STORE_CTX_get_ex_data(store_ctx, + SSL_get_ex_data_X509_STORE_CTX_idx()); + ctx = SSL_get_app_data(ssl); + + server_cert = X509_STORE_CTX_get_current_cert(store_ctx); + depth = X509_STORE_CTX_get_error_depth(store_ctx); + + /* If the certification was found invalid, get the error and convert it to + something our caller will understand. */ + if (! cert_valid) { + err = X509_STORE_CTX_get_error(store_ctx); + + switch(err) { + case X509_V_ERR_CERT_NOT_YET_VALID: + failures |= SERF_SSL_CERT_NOTYETVALID; + break; + case X509_V_ERR_CERT_HAS_EXPIRED: + failures |= SERF_SSL_CERT_EXPIRED; + break; + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + failures |= SERF_SSL_CERT_SELF_SIGNED; + break; + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + case X509_V_ERR_CERT_UNTRUSTED: + case X509_V_ERR_INVALID_CA: + case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: + failures |= SERF_SSL_CERT_UNKNOWNCA; + break; + case X509_V_ERR_CERT_REVOKED: + failures |= SERF_SSL_CERT_REVOKED; + break; + default: + failures |= SERF_SSL_CERT_UNKNOWN_FAILURE; + break; + } + } + + /* Validate hostname */ + status = validate_cert_hostname(server_cert, ctx->pool); + if (status) + failures |= SERF_SSL_CERT_UNKNOWN_FAILURE; + + /* Check certificate expiry dates. */ + if (X509_cmp_current_time(X509_get_notBefore(server_cert)) >= 0) { + failures |= SERF_SSL_CERT_NOTYETVALID; + } + else if (X509_cmp_current_time(X509_get_notAfter(server_cert)) <= 0) { + failures |= SERF_SSL_CERT_EXPIRED; + } + + if (ctx->server_cert_callback && + (depth == 0 || failures)) { + serf_ssl_certificate_t *cert; + apr_pool_t *subpool; + + apr_pool_create(&subpool, ctx->pool); + + cert = apr_palloc(subpool, sizeof(serf_ssl_certificate_t)); + cert->ssl_cert = server_cert; + cert->depth = depth; + + /* Callback for further verification. */ + status = ctx->server_cert_callback(ctx->server_cert_userdata, + failures, cert); + if (status == APR_SUCCESS) + cert_valid = 1; + else { + /* Even if openssl found the certificate valid, the application + told us to reject it. */ + cert_valid = 0; + /* Pass the error back to the caller through the context-run. */ + ctx->pending_err = status; + } + apr_pool_destroy(subpool); + } + + if (ctx->server_cert_chain_callback + && (depth == 0 || failures)) { + STACK_OF(X509) *chain; + const serf_ssl_certificate_t **certs; + int certs_len; + apr_pool_t *subpool; + + apr_pool_create(&subpool, ctx->pool); + + /* Borrow the chain to pass to the callback. */ + chain = X509_STORE_CTX_get_chain(store_ctx); + + /* If the chain can't be retrieved, just pass the current + certificate. */ + /* ### can this actually happen with _get_chain() ? */ + if (!chain) { + serf_ssl_certificate_t *cert = apr_palloc(subpool, sizeof(*cert)); + + cert->ssl_cert = server_cert; + cert->depth = depth; + + /* Room for the server_cert and a trailing NULL. */ + certs = apr_palloc(subpool, sizeof(*certs) * 2); + certs[0] = cert; + + certs_len = 1; + } else { + int i; + + certs_len = sk_X509_num(chain); + + /* Room for all the certs and a trailing NULL. */ + certs = apr_palloc(subpool, sizeof(*certs) * (certs_len + 1)); + for (i = 0; i < certs_len; ++i) { + serf_ssl_certificate_t *cert; + + cert = apr_palloc(subpool, sizeof(*cert)); + cert->ssl_cert = sk_X509_value(chain, i); + cert->depth = i; + + certs[i] = cert; + } + } + certs[certs_len] = NULL; + + /* Callback for further verification. */ + status = ctx->server_cert_chain_callback(ctx->server_cert_userdata, + failures, depth, + certs, certs_len); + if (status == APR_SUCCESS) { + cert_valid = 1; + } else { + /* Even if openssl found the certificate valid, the application + told us to reject it. */ + cert_valid = 0; + /* Pass the error back to the caller through the context-run. */ + ctx->pending_err = status; + } + + apr_pool_destroy(subpool); + } + + /* Return a specific error if the server certificate is not accepted by + OpenSSL and the application has not set callbacks to override this. */ + if (!cert_valid && + !ctx->server_cert_chain_callback && + !ctx->server_cert_callback) + { + ctx->pending_err = SERF_ERROR_SSL_CERT_FAILED; + } + + return cert_valid; +} + +/* This function reads an encrypted stream and returns the decrypted stream. */ +static apr_status_t ssl_decrypt(void *baton, apr_size_t bufsize, + char *buf, apr_size_t *len) +{ + serf_ssl_context_t *ctx = baton; + apr_size_t priv_len; + apr_status_t status; + const char *data; + int ssl_len; + + if (ctx->fatal_err) + return ctx->fatal_err; + + serf__log(SSL_VERBOSE, __FILE__, "ssl_decrypt: begin %d\n", bufsize); + + /* Is there some data waiting to be read? */ + ssl_len = SSL_read(ctx->ssl, buf, bufsize); + if (ssl_len > 0) { + serf__log(SSL_VERBOSE, __FILE__, + "ssl_decrypt: %d bytes (%d); status: %d; flags: %d\n", + ssl_len, bufsize, ctx->decrypt.status, + BIO_get_retry_flags(ctx->bio)); + *len = ssl_len; + return APR_SUCCESS; + } + + status = serf_bucket_read(ctx->decrypt.stream, bufsize, &data, &priv_len); + + if (!SERF_BUCKET_READ_ERROR(status) && priv_len) { + serf_bucket_t *tmp; + + serf__log(SSL_VERBOSE, __FILE__, + "ssl_decrypt: read %d bytes (%d); status: %d\n", + priv_len, bufsize, status); + + tmp = serf_bucket_simple_copy_create(data, priv_len, + ctx->decrypt.pending->allocator); + + serf_bucket_aggregate_append(ctx->decrypt.pending, tmp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 20:30:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26445495; Mon, 11 Aug 2014 20:30:04 +0000 (UTC) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Caravan", Issuer "Mail Client CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E087A2007; Mon, 11 Aug 2014 20:30:03 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id D8C6CB22C6; Mon, 11 Aug 2014 20:29:54 +0000 (UTC) Date: Mon, 11 Aug 2014 22:29:54 +0200 From: Jeremie Le Hen To: Jean-Sebastien Pedron Subject: Re: svn commit: r269729 - in head/usr.bin/sed: . tests Message-ID: <20140811202954.GA66720@caravan.chchile.org> Mail-Followup-To: Jean-Sebastien Pedron , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <53e508dd.23d7.7477a7f9@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53e508dd.23d7.7477a7f9@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 20:30:04 -0000 Hi Jean Sebastien, On Fri, Aug 08, 2014 at 05:29:01PM +0000, Jean-Sebastien Pedron wrote: > Author: dumbbell > Date: Fri Aug 8 17:29:01 2014 > New Revision: 269729 > URL: http://svnweb.freebsd.org/changeset/base/269729 > > Log: > sed(1): Don't force a newline on last line, if input stream doesn't have one > > While here, change how we check if the current line is the last one. > Before, we just checked if there were more files after the current one. > Now, we check the actual content of those files: they files may not have > a line at all. This matches the definition of the "last line" by the > Open Group. > > The new behavior is closer to GNU sed. Any plan to MFC this? -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 20:37:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ED35BFA for ; Mon, 11 Aug 2014 20:37:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430A52103 for ; Mon, 11 Aug 2014 20:37:04 +0000 (UTC) Received: from dim (uid 1236) (envelope-from dim@FreeBSD.org) id 2ad9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 20:37:04 +0000 From: Dimitry Andric Date: Mon, 11 Aug 2014 20:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269836 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e92970.2ad9.121cacc3@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 20:37:04 -0000 Author: dim Date: Mon Aug 11 20:37:03 2014 New Revision: 269836 URL: http://svnweb.freebsd.org/changeset/base/269836 Log: MFC r269740: Pull in r214736 from upstream libc++ trunk (by Marshall Clow): Fix PR#20520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm This fixes an issue where std::list<>::remove_if() and remove() could erroneously visit elements twice. Reported by: Dominic Fandrey PR: 192303 Modified: stable/9/contrib/libc++/include/list Directory Properties: stable/9/contrib/libc++/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/libc++/include/list Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/libc++/include/list ============================================================================== --- stable/9/contrib/libc++/include/list Mon Aug 11 20:36:09 2014 (r269835) +++ stable/9/contrib/libc++/include/list Mon Aug 11 20:37:03 2014 (r269836) @@ -2046,6 +2046,8 @@ list<_Tp, _Alloc>::remove(const value_ty for (; __j != __e && *__j == __x; ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; @@ -2065,6 +2067,8 @@ list<_Tp, _Alloc>::remove_if(_Pred __pre for (; __j != __e && __pred(*__j); ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 20:37:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A4D8BFC for ; Mon, 11 Aug 2014 20:37:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 605612104 for ; Mon, 11 Aug 2014 20:37:04 +0000 (UTC) Received: from dim (uid 1236) (envelope-from dim@FreeBSD.org) id 2ae0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 20:37:04 +0000 From: Dimitry Andric Date: Mon, 11 Aug 2014 20:37: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: r269836 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e92970.2ae0.4534a0a4@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 20:37:04 -0000 Author: dim Date: Mon Aug 11 20:37:03 2014 New Revision: 269836 URL: http://svnweb.freebsd.org/changeset/base/269836 Log: MFC r269740: Pull in r214736 from upstream libc++ trunk (by Marshall Clow): Fix PR#20520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm This fixes an issue where std::list<>::remove_if() and remove() could erroneously visit elements twice. Reported by: Dominic Fandrey PR: 192303 Modified: stable/10/contrib/libc++/include/list Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libc++/include/list Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/10/contrib/libc++/include/list ============================================================================== --- stable/10/contrib/libc++/include/list Mon Aug 11 20:36:09 2014 (r269835) +++ stable/10/contrib/libc++/include/list Mon Aug 11 20:37:03 2014 (r269836) @@ -2046,6 +2046,8 @@ list<_Tp, _Alloc>::remove(const value_ty for (; __j != __e && *__j == __x; ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; @@ -2065,6 +2067,8 @@ list<_Tp, _Alloc>::remove_if(_Pred __pre for (; __j != __e && __pred(*__j); ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 20:38:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A2FEEB9 for ; Mon, 11 Aug 2014 20:38:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F339D2126 for ; Mon, 11 Aug 2014 20:38:52 +0000 (UTC) Received: from jlh (uid 1291) (envelope-from jlh@FreeBSD.org) id 2af8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 20:38:52 +0000 From: Jeremie Le Hen Date: Mon, 11 Aug 2014 20:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269837 - stable/10/usr.bin/sed X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e929dc.2af8.5dd58b3e@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 20:38:53 -0000 Author: jlh Date: Mon Aug 11 20:38:52 2014 New Revision: 269837 URL: http://svnweb.freebsd.org/changeset/base/269837 Log: MFC r269302: Fix relative numerical addressing (addr,+N). As a bonus the patch untangles a bit the logic and makes the code easier to grasp. PR: 192108 Modified: stable/10/usr.bin/sed/process.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/process.c ============================================================================== --- stable/10/usr.bin/sed/process.c Mon Aug 11 20:37:03 2014 (r269836) +++ stable/10/usr.bin/sed/process.c Mon Aug 11 20:38:52 2014 (r269837) @@ -288,24 +288,32 @@ applies(struct s_command *cp) r = 1; else if (cp->a2) if (cp->startline > 0) { - if (MATCH(cp->a2)) { - cp->startline = 0; - lastaddr = 1; - r = 1; - } else if (linenum - cp->startline <= cp->a2->u.l) - r = 1; - else if ((cp->a2->type == AT_LINE && - linenum > cp->a2->u.l) || - (cp->a2->type == AT_RELLINE && - linenum - cp->startline > cp->a2->u.l)) { - /* - * We missed the 2nd address due to a branch, - * so just close the range and return false. - */ - cp->startline = 0; - r = 0; - } else - r = 1; + switch (cp->a2->type) { + case AT_RELLINE: + if (linenum - cp->startline <= cp->a2->u.l) + r = 1; + else { + cp->startline = 0; + r = 0; + } + break; + default: + if (MATCH(cp->a2)) { + cp->startline = 0; + lastaddr = 1; + r = 1; + } else if (cp->a2->type == AT_LINE && + linenum > cp->a2->u.l) { + /* + * We missed the 2nd address due to a + * branch, so just close the range and + * return false. + */ + cp->startline = 0; + r = 0; + } else + r = 1; + } } else if (MATCH(cp->a1)) { /* * If the second address is a number less than or From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 20:41:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5985D8 for ; Mon, 11 Aug 2014 20:41:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA93D21C5 for ; Mon, 11 Aug 2014 20:41:14 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 2e52 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 20:41:14 +0000 From: Rui Paulo Date: Mon, 11 Aug 2014 20:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269838 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e92a6a.2e52.856905@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 20:41:15 -0000 Author: rpaulo Date: Mon Aug 11 20:41:14 2014 New Revision: 269838 URL: http://svnweb.freebsd.org/changeset/base/269838 Log: Fix an error in the dependency of the DTrace object file. MFC after: 3 days Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Aug 11 20:38:52 2014 (r269837) +++ head/share/mk/bsd.dep.mk Mon Aug 11 20:41:14 2014 (r269838) @@ -134,7 +134,7 @@ ${_D}.h: ${_DSRC} SRCS:= ${SRCS:S/${_DSRC}/${_D}.h/} OBJS+= ${_D}.o CLEANFILES+= ${_D}.h ${_D}.o -${_D}.o: ${_D.h} ${OBJS:S/${_D}.o//} +${_D}.o: ${_D}.h ${OBJS:S/${_D}.o//} ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ ${OBJS:S/${_D}.o//} .if defined(LIB) From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 20:44:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF10D28F for ; Mon, 11 Aug 2014 20:44:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8433F21E8 for ; Mon, 11 Aug 2014 20:44:57 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 2e69 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 20:44:57 +0000 From: Rui Paulo Date: Mon, 11 Aug 2014 20:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269839 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e92b49.2e69.39ede5a7@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 20:44:57 -0000 Author: rpaulo Date: Mon Aug 11 20:44:57 2014 New Revision: 269839 URL: http://svnweb.freebsd.org/changeset/base/269839 Log: bsd.dep.mk: use the empty() function with the check for .d files. Seems to work better with the old make. MFC after: 3 days Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Aug 11 20:41:14 2014 (r269838) +++ head/share/mk/bsd.dep.mk Mon Aug 11 20:44:57 2014 (r269839) @@ -122,7 +122,7 @@ ${_YC:R}.o: ${_YC} # DTrace probe definitions # libelf is currently needed for drti.o -.if ${SRCS:M*.d} +.if !empty(${SRCS:M*.d}) LDFLAGS+= -lelf LDADD+= ${LIBELF} CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR} From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:14:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0BFFB4E for ; Mon, 11 Aug 2014 21:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A720A25D3 for ; Mon, 11 Aug 2014 21:14:08 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 2b98 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 21:14:08 +0000 From: Rui Paulo Date: Mon, 11 Aug 2014 21:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269840 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e93220.2b98.372dda7a@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:14:08 -0000 Author: rpaulo Date: Mon Aug 11 21:14:08 2014 New Revision: 269840 URL: http://svnweb.freebsd.org/changeset/base/269840 Log: Fix another typoe in the definition of DTrace SOBJS. MFC after: 3 days Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Aug 11 20:44:57 2014 (r269839) +++ head/share/mk/bsd.dep.mk Mon Aug 11 21:14:08 2014 (r269840) @@ -139,7 +139,7 @@ ${_D}.o: ${_D}.h ${OBJS:S/${_D}.o//} ${OBJS:S/${_D}.o//} .if defined(LIB) CLEANFILES+= ${_D}.So ${_D}.po -${_D}.So: ${_D.h} ${SOBJS:S/${_D}.So//} +${_D}.So: ${_D}.h ${SOBJS:S/${_D}.So//} ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ ${SOBJS:S/${_D}.So//} ${_D}.po: ${_D}.h ${POBJS:S/${_D}.po//} From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:28:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0233D373; Mon, 11 Aug 2014 21:28:57 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF9DC2708; Mon, 11 Aug 2014 21:28:56 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C0EAEB968; Mon, 11 Aug 2014 17:28:55 -0400 (EDT) From: John Baldwin To: "Andrey V. Elsukov" Subject: Re: svn commit: r269661 - head/sys/kern Date: Mon, 11 Aug 2014 12:25:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53e353b6.5aa8.4ee2421b@svn.freebsd.org> In-Reply-To: <53e353b6.5aa8.4ee2421b@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201408111225.35190.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 11 Aug 2014 17:28:55 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:28:57 -0000 On Thursday, August 07, 2014 6:23:50 am Andrey V. Elsukov wrote: > Author: ae > Date: Thu Aug 7 10:23:50 2014 > New Revision: 269661 > URL: http://svnweb.freebsd.org/changeset/base/269661 > > Log: > Use cpuset_setithread() to apply cpu mask to taskq threads. > > Sponsored by: Yandex LLC I think this is fine (sorry I didn't reply to your earlier mail). My one comment is we probably should rename cpuset_setithread() as it is now used for non-ithreads. I would suggest cpuset_setkthread(), but it isn't something all kthreads should use, so that isn't really correct either. Something along the lines of what it actually does (cpuset_privateset()) might be best? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:28:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D25C3520; Mon, 11 Aug 2014 21:28:59 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA7E62709; Mon, 11 Aug 2014 21:28:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 924E1B948; Mon, 11 Aug 2014 17:28:58 -0400 (EDT) From: John Baldwin To: Roger Pau MonnXX Subject: Re: svn commit: r269675 - head/sys/x86/isa Date: Mon, 11 Aug 2014 12:27:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53e3b0c2.25ff.29ca9019@svn.freebsd.org> In-Reply-To: <53e3b0c2.25ff.29ca9019@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201408111227.48940.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 11 Aug 2014 17:28:58 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:28:59 -0000 On Thursday, August 07, 2014 1:00:50 pm Roger Pau MonnXX wrote: > Author: royger > Date: Thu Aug 7 17:00:50 2014 > New Revision: 269675 > URL: http://svnweb.freebsd.org/changeset/base/269675 >=20 > Log: > atpic: make sure atpic_init is called after IO APIC initialization > =20 > After r269510 the IO APIC and ATPIC initialization is done at the same > order, which means atpic_init can be called before the IO APIC has > been initalized. In that case the ATPIC will take over the interrupt > sources, preventing the IO APIC from registering them. > =20 > Reported by: David Wolfskill > Tested by: David Wolfskill , > Trond Endrest=C3=B8l > Sponsored by: Citrix Systems R&D I should have caught this earlier, I almost suggested looking at all the=20 SI_SUB_INTR inits to ensure everything was correct. Thanks for tracking it= =20 down! =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:29:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2759B6A7; Mon, 11 Aug 2014 21:29:03 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2376270D; Mon, 11 Aug 2014 21:29:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DD578B94A; Mon, 11 Aug 2014 17:29:01 -0400 (EDT) From: John Baldwin To: Warner Losh Subject: Re: svn commit: r269812 - in head/sys: conf modules modules/aic7xxx/ahc modules/cxgb modules/cxgbe modules/dpt modules/drm modules/drm2 modules/ep modules/if_gif modules/netgraph modules/sound/driver m... Date: Mon, 11 Aug 2014 12:32:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53e8d84a.2d10.3a29d8f5@svn.freebsd.org> In-Reply-To: <53e8d84a.2d10.3a29d8f5@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201408111232.48445.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 11 Aug 2014 17:29:02 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:29:03 -0000 On Monday, August 11, 2014 10:50:50 am Warner Losh wrote: > Author: imp > Date: Mon Aug 11 14:50:49 2014 > New Revision: 269812 > URL: http://svnweb.freebsd.org/changeset/base/269812 > > Log: > Remove dependence on source tree options. Move all kernel module > options into kern.opts.mk and change all the places where we use > src.opts.mk to pull in the options. Conditionally define SYSDIR and > use SYSDIR/conf/kern.opts.mk instead of a CURDIR path. Replace all > instances of CURDIR/../../etc with STSDIR, but only in the affected > files. > > As a special compatibility hack, include bsd.owm.mk at the top of > kern.opts.mk to allow the bare build of sys/modules to work on older > systems. If the defaults ever change between 9.x, 10.x and current for > these options, however, you'll wind up with the host OS' defaults > rather than the -current defaults. This hack will be removed when > we no longer need to support this build scenario. > > Reviewed by: jhb > Differential Revision: https://phabric.freebsd.org/D529 Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:29:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F269787; Mon, 11 Aug 2014 21:29:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC2132710; Mon, 11 Aug 2014 21:29:05 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CC0F3B968; Mon, 11 Aug 2014 17:29:04 -0400 (EDT) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r269474 - in head: share/man/man4 sys/dev/vt Date: Mon, 11 Aug 2014 13:15:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53de340e.52ce.7073778e@svn.freebsd.org> <20140805091730.N2827@besplex.bde.org> In-Reply-To: <20140805091730.N2827@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201408111315.16939.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 11 Aug 2014 17:29:04 -0400 (EDT) Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:29:06 -0000 On Monday, August 04, 2014 8:03:58 pm Bruce Evans wrote: > On Mon, 4 Aug 2014, John Baldwin wrote: > > > On Aug 3, 2014, at 6:07 AM, Aleksandr Rybalko wrote: > > > >> Log: > >> Allow to disable some special key combinations handled by vt(4), like debug > >> request, reboot request. > >> > >> Requested by: Claude Buisson > >> > >> Sponsored by: The FreeBSD Foundation > > > > I realize the API uses 'SPCL' as an abbreviation, but for user-facing things like a sysctl and tunable, I think it might be better to spell it out as "specialkeys" instead? > > It is a bad name, and also gratuitously different from syscons where the > names are: > > hw.syscons.kbd_reboot > hw.syscons.kbd_debug > hw.syscons.sc_no_suspend_vtswitch I would prefer individual nodes for vt along these lines as I think it is clearer to the user ("what exactly constitutes a special key?") -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:38:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6100AF7B for ; Mon, 11 Aug 2014 21:38:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35F48282C for ; Mon, 11 Aug 2014 21:38:42 +0000 (UTC) Received: from jlh (uid 1291) (envelope-from jlh@FreeBSD.org) id 2395 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 21:38:42 +0000 From: Jeremie Le Hen Date: Mon, 11 Aug 2014 21:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269841 - stable/9/usr.bin/sed X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e937e2.2395.50059fa2@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:38:42 -0000 Author: jlh Date: Mon Aug 11 21:38:41 2014 New Revision: 269841 URL: http://svnweb.freebsd.org/changeset/base/269841 Log: MFC r269302: Fix relative numerical addressing (addr,+N). As a bonus the patch untangles a bit the logic and makes the code easier to grasp. PR: 192108 Modified: stable/9/usr.bin/sed/process.c Directory Properties: stable/9/usr.bin/sed/ (props changed) Modified: stable/9/usr.bin/sed/process.c ============================================================================== --- stable/9/usr.bin/sed/process.c Mon Aug 11 21:14:08 2014 (r269840) +++ stable/9/usr.bin/sed/process.c Mon Aug 11 21:38:41 2014 (r269841) @@ -288,24 +288,32 @@ applies(struct s_command *cp) r = 1; else if (cp->a2) if (cp->startline > 0) { - if (MATCH(cp->a2)) { - cp->startline = 0; - lastaddr = 1; - r = 1; - } else if (linenum - cp->startline <= cp->a2->u.l) - r = 1; - else if ((cp->a2->type == AT_LINE && - linenum > cp->a2->u.l) || - (cp->a2->type == AT_RELLINE && - linenum - cp->startline > cp->a2->u.l)) { - /* - * We missed the 2nd address due to a branch, - * so just close the range and return false. - */ - cp->startline = 0; - r = 0; - } else - r = 1; + switch (cp->a2->type) { + case AT_RELLINE: + if (linenum - cp->startline <= cp->a2->u.l) + r = 1; + else { + cp->startline = 0; + r = 0; + } + break; + default: + if (MATCH(cp->a2)) { + cp->startline = 0; + lastaddr = 1; + r = 1; + } else if (cp->a2->type == AT_LINE && + linenum > cp->a2->u.l) { + /* + * We missed the 2nd address due to a + * branch, so just close the range and + * return false. + */ + cp->startline = 0; + r = 0; + } else + r = 1; + } } else if (MATCH(cp->a1)) { /* * If the second address is a number less than or From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 21:42:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B99BE1F6 for ; Mon, 11 Aug 2014 21:42:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9C6528E5 for ; Mon, 11 Aug 2014 21:42:06 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 294f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 21:42:06 +0000 From: Rui Paulo Date: Mon, 11 Aug 2014 21:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269842 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e938ae.294f.5e6e0f22@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 21:42:06 -0000 Author: rpaulo Date: Mon Aug 11 21:42:06 2014 New Revision: 269842 URL: http://svnweb.freebsd.org/changeset/base/269842 Log: Add .d files to the reverse matching pattern in bsd.dep.mk to account for source file dependencies. This follows the .y and .l behaviour. MFC after: 3 days Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Aug 11 21:38:41 2014 (r269841) +++ head/share/mk/bsd.dep.mk Mon Aug 11 21:42:06 2014 (r269842) @@ -73,7 +73,7 @@ tags: ${SRCS} CLEANFILES?= .if !exists(${.OBJDIR}/${DEPENDFILE}) -.for _S in ${SRCS:N*.[hly]} +.for _S in ${SRCS:N*.[dhly]} ${_S:R}.o: ${_S} .endfor .endif From owner-svn-src-all@FreeBSD.ORG Mon Aug 11 22:43:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF1B1CA2 for ; Mon, 11 Aug 2014 22:43:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F4E42FF4 for ; Mon, 11 Aug 2014 22:43:44 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 2270 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 22:43:44 +0000 From: Rui Paulo Date: Mon, 11 Aug 2014 22:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269844 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e94720.2270.50307fa7@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 11 Aug 2014 22:43:44 -0000 Author: rpaulo Date: Mon Aug 11 22:43:44 2014 New Revision: 269844 URL: http://svnweb.freebsd.org/changeset/base/269844 Log: Revert r269839. This doesn't work like I expected and the if clause is never matched. It turns out that the problem with the older make is unrelated. MFC after: 3 days Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Aug 11 22:38:13 2014 (r269843) +++ head/share/mk/bsd.dep.mk Mon Aug 11 22:43:44 2014 (r269844) @@ -122,7 +122,7 @@ ${_YC:R}.o: ${_YC} # DTrace probe definitions # libelf is currently needed for drti.o -.if !empty(${SRCS:M*.d}) +.if ${SRCS:M*.d} LDFLAGS+= -lelf LDADD+= ${LIBELF} CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR} From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 00:53:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B7C78CD for ; Tue, 12 Aug 2014 00:53:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EC0B2BA3 for ; Tue, 12 Aug 2014 00:53:05 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2aa0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 00:53:03 +0000 From: Xin LI Date: Tue, 12 Aug 2014 00:53: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: r269845 - in stable/10: cddl/contrib/opensolaris/common/avl sys/cddl/contrib/opensolaris/common/avl sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/commo... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9656f.2aa0.67bb7fd4@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 00:53:05 -0000 Author: delphij Date: Tue Aug 12 00:53:03 2014 New Revision: 269845 URL: http://svnweb.freebsd.org/changeset/base/269845 Log: MFC r269229,269404,269466: MFV r269223: Change dn->dn_dbufs from linked list to AVL tree. Illumos issues: 4873 zvol unmap calls can take a very long time for larger datasets Modified: stable/10/cddl/contrib/opensolaris/common/avl/avl.c stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/common/avl/avl.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/common/avl/avl.c Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/cddl/contrib/opensolaris/common/avl/avl.c Tue Aug 12 00:53:03 2014 (r269845) @@ -24,6 +24,10 @@ */ /* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + +/* * AVL - generic AVL tree implementation for kernel use * * A complete description of AVL trees can be found in many CS textbooks. @@ -37,7 +41,7 @@ * insertion and deletion relatively efficiently. Searching the tree is * still a fast operation, roughly O(log(N)). * - * The key to insertion and deletion is a set of tree maniuplations called + * The key to insertion and deletion is a set of tree manipulations called * rotations, which bring unbalanced subtrees back into the semi-balanced state. * * This implementation of AVL trees has the following peculiarities: @@ -45,7 +49,7 @@ * - The AVL specific data structures are physically embedded as fields * in the "using" data structures. To maintain generality the code * must constantly translate between "avl_node_t *" and containing - * data structure "void *"s by adding/subracting the avl_offset. + * data structure "void *"s by adding/subtracting the avl_offset. * * - Since the AVL data is always embedded in other structures, there is * no locking or memory allocation in the AVL routines. This must be @@ -85,6 +89,12 @@ * is a modified "avl_node_t *". The bottom bit (normally 0 for a * pointer) is set to indicate if that the new node has a value greater * than the value of the indicated "avl_node_t *". + * + * Note - in addition to userland (e.g. libavl and libutil) and the kernel + * (e.g. genunix), avl.c is compiled into ld.so and kmdb's genunix module, + * which each have their own compilation environments and subsequent + * requirements. Each of these environments must be considered when adding + * dependencies from avl.c. */ #include @@ -94,7 +104,7 @@ #include /* - * Small arrays to translate between balance (or diff) values and child indeces. + * Small arrays to translate between balance (or diff) values and child indices. * * Code that deals with binary tree data structures will randomly use * left and right children when examining a tree. C "if()" statements @@ -114,7 +124,8 @@ static const int avl_balance2child[] = * * - If there is a left child, go to it, then to it's rightmost descendant. * - * - otherwise we return thru parent nodes until we've come from a right child. + * - otherwise we return through parent nodes until we've come from a right + * child. * * Return Value: * NULL - if at the end of the nodes @@ -863,6 +874,24 @@ avl_update(avl_tree_t *t, void *obj) return (B_FALSE); } +void +avl_swap(avl_tree_t *tree1, avl_tree_t *tree2) +{ + avl_node_t *temp_node; + ulong_t temp_numnodes; + + ASSERT3P(tree1->avl_compar, ==, tree2->avl_compar); + ASSERT3U(tree1->avl_offset, ==, tree2->avl_offset); + ASSERT3U(tree1->avl_size, ==, tree2->avl_size); + + temp_node = tree1->avl_root; + temp_numnodes = tree1->avl_numnodes; + tree1->avl_root = tree2->avl_root; + tree1->avl_numnodes = tree2->avl_numnodes; + tree2->avl_root = temp_node; + tree2->avl_numnodes = temp_numnodes; +} + /* * initialize a new AVL tree */ @@ -919,7 +948,7 @@ avl_is_empty(avl_tree_t *tree) /* * Post-order tree walk used to visit all tree nodes and destroy the tree - * in post order. This is used for destroying a tree w/o paying any cost + * in post order. This is used for destroying a tree without paying any cost * for rebalancing it. * * example: Modified: stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/common/avl/avl.c Tue Aug 12 00:53:03 2014 (r269845) @@ -24,6 +24,10 @@ */ /* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + +/* * AVL - generic AVL tree implementation for kernel use * * A complete description of AVL trees can be found in many CS textbooks. @@ -85,6 +89,12 @@ * is a modified "avl_node_t *". The bottom bit (normally 0 for a * pointer) is set to indicate if that the new node has a value greater * than the value of the indicated "avl_node_t *". + * + * Note - in addition to userland (e.g. libavl and libutil) and the kernel + * (e.g. genunix), avl.c is compiled into ld.so and kmdb's genunix module, + * which each have their own compilation environments and subsequent + * requirements. Each of these environments must be considered when adding + * dependencies from avl.c. */ #include @@ -864,6 +874,24 @@ avl_update(avl_tree_t *t, void *obj) return (B_FALSE); } +void +avl_swap(avl_tree_t *tree1, avl_tree_t *tree2) +{ + avl_node_t *temp_node; + ulong_t temp_numnodes; + + ASSERT3P(tree1->avl_compar, ==, tree2->avl_compar); + ASSERT3U(tree1->avl_offset, ==, tree2->avl_offset); + ASSERT3U(tree1->avl_size, ==, tree2->avl_size); + + temp_node = tree1->avl_root; + temp_numnodes = tree1->avl_numnodes; + tree1->avl_root = tree2->avl_root; + tree1->avl_numnodes = tree2->avl_numnodes; + tree2->avl_root = temp_node; + tree2->avl_numnodes = temp_numnodes; +} + /* * initialize a new AVL tree */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Aug 12 00:53:03 2014 (r269845) @@ -69,6 +69,13 @@ dbuf_cons(void *vdb, void *unused, int k mutex_init(&db->db_mtx, NULL, MUTEX_DEFAULT, NULL); cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL); refcount_create(&db->db_holds); + +#if defined(illumos) || !defined(_KERNEL) + db->db_creation = gethrtime(); +#else + db->db_creation = cpu_ticks() ^ ((uint64_t)CPU_SEQID << 48); +#endif + return (0); } @@ -330,7 +337,7 @@ dbuf_verify(dmu_buf_impl_t *db) ASSERT3U(db->db_level, <, dn->dn_nlevels); ASSERT(db->db_blkid == DMU_BONUS_BLKID || db->db_blkid == DMU_SPILL_BLKID || - !list_is_empty(&dn->dn_dbufs)); + !avl_is_empty(&dn->dn_dbufs)); } if (db->db_blkid == DMU_BONUS_BLKID) { ASSERT(dn != NULL); @@ -803,18 +810,30 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) * receive; see comment below for details. */ void -dbuf_free_range(dnode_t *dn, uint64_t start, uint64_t end, dmu_tx_t *tx) +dbuf_free_range(dnode_t *dn, uint64_t start_blkid, uint64_t end_blkid, + dmu_tx_t *tx) { - dmu_buf_impl_t *db, *db_next; + dmu_buf_impl_t *db, *db_next, db_search; uint64_t txg = tx->tx_txg; + avl_index_t where; - if (end > dn->dn_maxblkid && (end != DMU_SPILL_BLKID)) - end = dn->dn_maxblkid; - dprintf_dnode(dn, "start=%llu end=%llu\n", start, end); + if (end_blkid > dn->dn_maxblkid && (end_blkid != DMU_SPILL_BLKID)) + end_blkid = dn->dn_maxblkid; + dprintf_dnode(dn, "start=%llu end=%llu\n", start_blkid, end_blkid); + + db_search.db_level = 0; + db_search.db_blkid = start_blkid; + db_search.db_creation = 0; mutex_enter(&dn->dn_dbufs_mtx); - if (start >= dn->dn_unlisted_l0_blkid * dn->dn_datablksz) { + if (start_blkid >= dn->dn_unlisted_l0_blkid) { /* There can't be any dbufs in this range; no need to search. */ +#ifdef DEBUG + db = avl_find(&dn->dn_dbufs, &db_search, &where); + ASSERT3P(db, ==, NULL); + db = avl_nearest(&dn->dn_dbufs, where, AVL_AFTER); + ASSERT(db == NULL || db->db_level > 0); +#endif mutex_exit(&dn->dn_dbufs_mtx); return; } else if (dmu_objset_is_receiving(dn->dn_objset)) { @@ -828,14 +847,18 @@ dbuf_free_range(dnode_t *dn, uint64_t st atomic_inc_64(&zfs_free_range_recv_miss); } - for (db = list_head(&dn->dn_dbufs); db != NULL; db = db_next) { - db_next = list_next(&dn->dn_dbufs, db); + db = avl_find(&dn->dn_dbufs, &db_search, &where); + ASSERT3P(db, ==, NULL); + db = avl_nearest(&dn->dn_dbufs, where, AVL_AFTER); + + for (; db != NULL; db = db_next) { + db_next = AVL_NEXT(&dn->dn_dbufs, db); ASSERT(db->db_blkid != DMU_BONUS_BLKID); - if (db->db_level != 0) - continue; - if (db->db_blkid < start || db->db_blkid > end) - continue; + if (db->db_level != 0 || db->db_blkid > end_blkid) { + break; + } + ASSERT3U(db->db_blkid, >=, start_blkid); /* found a level 0 buffer in the range */ mutex_enter(&db->db_mtx); @@ -1585,7 +1608,7 @@ dbuf_clear(dmu_buf_impl_t *db) dn = DB_DNODE(db); dndb = dn->dn_dbuf; if (db->db_blkid != DMU_BONUS_BLKID && MUTEX_HELD(&dn->dn_dbufs_mtx)) { - list_remove(&dn->dn_dbufs, db); + avl_remove(&dn->dn_dbufs, db); (void) atomic_dec_32_nv(&dn->dn_dbufs_count); membar_producer(); DB_DNODE_EXIT(db); @@ -1748,7 +1771,7 @@ dbuf_create(dnode_t *dn, uint8_t level, mutex_exit(&dn->dn_dbufs_mtx); return (odb); } - list_insert_head(&dn->dn_dbufs, db); + avl_add(&dn->dn_dbufs, db); if (db->db_level == 0 && db->db_blkid >= dn->dn_unlisted_l0_blkid) dn->dn_unlisted_l0_blkid = db->db_blkid + 1; @@ -1807,7 +1830,7 @@ dbuf_destroy(dmu_buf_impl_t *db) DB_DNODE_ENTER(db); dn = DB_DNODE(db); mutex_enter(&dn->dn_dbufs_mtx); - list_remove(&dn->dn_dbufs, db); + avl_remove(&dn->dn_dbufs, db); (void) atomic_dec_32_nv(&dn->dn_dbufs_count); mutex_exit(&dn->dn_dbufs_mtx); DB_DNODE_EXIT(db); @@ -1825,7 +1848,6 @@ dbuf_destroy(dmu_buf_impl_t *db) db->db_parent = NULL; db->db_buf = NULL; - ASSERT(!list_link_active(&db->db_link)); ASSERT(db->db.db_data == NULL); ASSERT(db->db_hash_next == NULL); ASSERT(db->db_blkptr == NULL); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Aug 12 00:53:03 2014 (r269845) @@ -61,6 +61,43 @@ int zfs_default_ibs = DN_MAX_INDBLKSHIFT static kmem_cbrc_t dnode_move(void *, void *, size_t, void *); #endif +static int +dbuf_compare(const void *x1, const void *x2) +{ + const dmu_buf_impl_t *d1 = x1; + const dmu_buf_impl_t *d2 = x2; + + if (d1->db_level < d2->db_level) { + return (-1); + } else if (d1->db_level > d2->db_level) { + return (1); + } + + if (d1->db_blkid < d2->db_blkid) { + return (-1); + } else if (d1->db_blkid > d2->db_blkid) { + return (1); + } + + /* + * If a dbuf is being evicted while dn_dbufs_mutex is not held, we set + * the db_state to DB_EVICTING but do not remove it from dn_dbufs. If + * another thread creates a dbuf of the same blkid before the dbuf is + * removed from dn_dbufs, we can reach a state where there are two + * dbufs of the same blkid and level in db_dbufs. To maintain the avl + * invariant that there cannot be duplicate items, we distinguish + * between these two dbufs based on the time they were created. + */ + if (d1->db_creation < d2->db_creation) { + return (-1); + } else if (d1->db_creation > d2->db_creation) { + return (1); + } else { + ASSERT3P(d1, ==, d2); + return (0); + } +} + /* ARGSUSED */ static int dnode_cons(void *arg, void *unused, int kmflag) @@ -115,7 +152,7 @@ dnode_cons(void *arg, void *unused, int dn->dn_dbufs_count = 0; dn->dn_unlisted_l0_blkid = 0; - list_create(&dn->dn_dbufs, sizeof (dmu_buf_impl_t), + avl_create(&dn->dn_dbufs, dbuf_compare, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); dn->dn_moved = 0; @@ -169,7 +206,7 @@ dnode_dest(void *arg, void *unused) ASSERT0(dn->dn_dbufs_count); ASSERT0(dn->dn_unlisted_l0_blkid); - list_destroy(&dn->dn_dbufs); + avl_destroy(&dn->dn_dbufs); } void @@ -505,7 +542,7 @@ dnode_allocate(dnode_t *dn, dmu_object_t ASSERT0(dn->dn_assigned_txg); ASSERT(refcount_is_zero(&dn->dn_tx_holds)); ASSERT3U(refcount_count(&dn->dn_holds), <=, 1); - ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL); + ASSERT(avl_is_empty(&dn->dn_dbufs)); for (i = 0; i < TXG_SIZE; i++) { ASSERT0(dn->dn_next_nblkptr[i]); @@ -690,8 +727,8 @@ dnode_move_impl(dnode_t *odn, dnode_t *n ndn->dn_dirtyctx_firstset = odn->dn_dirtyctx_firstset; ASSERT(refcount_count(&odn->dn_tx_holds) == 0); refcount_transfer(&ndn->dn_holds, &odn->dn_holds); - ASSERT(list_is_empty(&ndn->dn_dbufs)); - list_move_tail(&ndn->dn_dbufs, &odn->dn_dbufs); + ASSERT(avl_is_empty(&ndn->dn_dbufs)); + avl_swap(&ndn->dn_dbufs, &odn->dn_dbufs); ndn->dn_dbufs_count = odn->dn_dbufs_count; ndn->dn_unlisted_l0_blkid = odn->dn_unlisted_l0_blkid; ndn->dn_bonus = odn->dn_bonus; @@ -725,7 +762,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n */ odn->dn_dbuf = NULL; odn->dn_handle = NULL; - list_create(&odn->dn_dbufs, sizeof (dmu_buf_impl_t), + avl_create(&odn->dn_dbufs, dbuf_compare, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); odn->dn_dbufs_count = 0; odn->dn_unlisted_l0_blkid = 0; @@ -1236,7 +1273,8 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx return; } - ASSERT(!refcount_is_zero(&dn->dn_holds) || list_head(&dn->dn_dbufs)); + ASSERT(!refcount_is_zero(&dn->dn_holds) || + !avl_is_empty(&dn->dn_dbufs)); ASSERT(dn->dn_datablksz != 0); ASSERT0(dn->dn_next_bonuslen[txg&TXG_MASK]); ASSERT0(dn->dn_next_blksz[txg&TXG_MASK]); @@ -1309,7 +1347,7 @@ dnode_free(dnode_t *dn, dmu_tx_t *tx) int dnode_set_blksz(dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx) { - dmu_buf_impl_t *db, *db_next; + dmu_buf_impl_t *db; int err; if (size == 0) @@ -1332,9 +1370,8 @@ dnode_set_blksz(dnode_t *dn, uint64_t si goto fail; mutex_enter(&dn->dn_dbufs_mtx); - for (db = list_head(&dn->dn_dbufs); db; db = db_next) { - db_next = list_next(&dn->dn_dbufs, db); - + for (db = avl_first(&dn->dn_dbufs); db != NULL; + db = AVL_NEXT(&dn->dn_dbufs, db)) { if (db->db_blkid != 0 && db->db_blkid != DMU_BONUS_BLKID && db->db_blkid != DMU_SPILL_BLKID) { mutex_exit(&dn->dn_dbufs_mtx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Tue Aug 12 00:53:03 2014 (r269845) @@ -400,16 +400,13 @@ dnode_evict_dbufs(dnode_t *dn) int pass = 0; do { - dmu_buf_impl_t *db, marker; + dmu_buf_impl_t *db, *db_next; int evicting = FALSE; progress = FALSE; mutex_enter(&dn->dn_dbufs_mtx); - list_insert_tail(&dn->dn_dbufs, &marker); - db = list_head(&dn->dn_dbufs); - for (; db != ▮ db = list_head(&dn->dn_dbufs)) { - list_remove(&dn->dn_dbufs, db); - list_insert_tail(&dn->dn_dbufs, db); + for (db = avl_first(&dn->dn_dbufs); db != NULL; db = db_next) { + db_next = AVL_NEXT(&dn->dn_dbufs, db); #ifdef DEBUG DB_DNODE_ENTER(db); ASSERT3P(DB_DNODE(db), ==, dn); @@ -429,7 +426,6 @@ dnode_evict_dbufs(dnode_t *dn) } } - list_remove(&dn->dn_dbufs, &marker); /* * NB: we need to drop dn_dbufs_mtx between passes so * that any DB_EVICTING dbufs can make progress. @@ -500,7 +496,7 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *t dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]); dnode_evict_dbufs(dn); - ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL); + ASSERT(avl_is_empty(&dn->dn_dbufs)); ASSERT3P(dn->dn_bonus, ==, NULL); /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Tue Aug 12 00:53:03 2014 (r269845) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -213,11 +213,14 @@ typedef struct dmu_buf_impl { /* pointer to most recent dirty record for this buffer */ dbuf_dirty_record_t *db_last_dirty; + /* Creation time of dbuf (see comment in dbuf_compare). */ + hrtime_t db_creation; + /* * Our link on the owner dnodes's dn_dbufs list. * Protected by its dn_dbufs_mtx. */ - list_node_t db_link; + avl_node_t db_link; /* Data which is unique to data (leaf) blocks: */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Tue Aug 12 00:53:03 2014 (r269845) @@ -211,7 +211,7 @@ typedef struct dnode { refcount_t dn_holds; kmutex_t dn_dbufs_mtx; - list_t dn_dbufs; /* descendent dbufs */ + avl_tree_t dn_dbufs; /* descendent dbufs */ /* protected by dn_struct_rwlock */ struct dmu_buf_impl *dn_bonus; /* bonus buffer dbuf */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Mon Aug 11 22:43:44 2014 (r269844) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Tue Aug 12 00:53:03 2014 (r269845) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + #ifndef _AVL_H #define _AVL_H @@ -260,6 +264,11 @@ extern boolean_t avl_update_lt(avl_tree_ extern boolean_t avl_update_gt(avl_tree_t *, void *); /* + * Swaps the contents of the two trees. + */ +extern void avl_swap(avl_tree_t *tree1, avl_tree_t *tree2); + +/* * Return the number of nodes in the tree */ extern ulong_t avl_numnodes(avl_tree_t *tree); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 00:59:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCDC9A4B for ; Tue, 12 Aug 2014 00:59:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B24FD2BD1 for ; Tue, 12 Aug 2014 00:59:19 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2ac0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 00:59:19 +0000 From: Xin LI Date: Tue, 12 Aug 2014 00:59: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: r269846 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e966e7.2ac0.3d7c5f0d@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 00:59:19 -0000 Author: delphij Date: Tue Aug 12 00:59:19 2014 New Revision: 269846 URL: http://svnweb.freebsd.org/changeset/base/269846 Log: MFC r269230: MFV r269224: Increase default ARC buf_hash_table size. When typical block size is small, the hash table could be too small, which would lead to long hash chains and limit performance for cached reads. A new loader tunable, vfs.zfs.arc_average_blocksize, have been added which allows users to override the default assumption of average (typical) block size. Old default was 65536 (64 KiB) and new default is 8192 (8 KiB). Illumos issue: 5034 ARC's buf_hash_table is too small Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 12 00:53:03 2014 (r269845) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Aug 12 00:59:19 2014 (r269846) @@ -203,15 +203,20 @@ int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; int zfs_disable_dup_eviction = 0; +uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */ TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max); TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min); TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit); +TUNABLE_QUAD("vfs.zfs.arc_average_blocksize", &zfs_arc_average_blocksize); SYSCTL_DECL(_vfs_zfs); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0, "Maximum ARC size"); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RDTUN, &zfs_arc_min, 0, "Minimum ARC size"); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_average_blocksize, CTLFLAG_RDTUN, + &zfs_arc_average_blocksize, 0, + "ARC average blocksize"); /* * Note that buffers can be in one of 6 states: @@ -1056,10 +1061,11 @@ buf_init(void) /* * The hash table is big enough to fill all of physical memory - * with an average 64K block size. The table will take up - * totalmem*sizeof(void*)/64K (eg. 128KB/GB with 8-byte pointers). + * with an average block size of zfs_arc_average_blocksize (default 8K). + * By default, the table will take up + * totalmem * sizeof(void*) / 8K (1MB per GB with 8-byte pointers). */ - while (hsize * 65536 < (uint64_t)physmem * PAGESIZE) + while (hsize * zfs_arc_average_blocksize < (uint64_t)physmem * PAGESIZE) hsize <<= 1; retry: buf_hash_table.ht_mask = hsize - 1; From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 01:40:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38CC8EB for ; Tue, 12 Aug 2014 01:40:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 211892103 for ; Tue, 12 Aug 2014 01:40:14 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2d6c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 01:40:12 +0000 From: Peter Wemm Date: Tue, 12 Aug 2014 01:40: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: r269847 - in stable/10: contrib/apr contrib/apr/docs contrib/apr/encoding contrib/apr/file_io/unix contrib/apr/include contrib/apr/include/arch/unix contrib/apr/include/private contrib/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9707c.2d6c.2d976b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 01:40:14 -0000 Author: peter Date: Tue Aug 12 01:40:11 2014 New Revision: 269847 URL: http://svnweb.freebsd.org/changeset/base/269847 Log: MFC r266728,266731,266735,266736,268135,268960,269833 Update apr 1.4.8 -> 1.5.1 Update apr-util 1.5.2 -> 1.5.3 Update serf 1.3.4 -> 1.3.7 Update svnlite 1.8.8 -> 1.8.10 Deal with svnlite.1 manpage. Added: stable/10/contrib/apr/CMakeLists.txt - copied unchanged from r266735, head/contrib/apr/CMakeLists.txt stable/10/contrib/apr/README.cmake - copied unchanged from r266735, head/contrib/apr/README.cmake stable/10/contrib/apr/encoding/ - copied from r266735, head/contrib/apr/encoding/ stable/10/contrib/apr/include/apr.hwc - copied unchanged from r266735, head/contrib/apr/include/apr.hwc stable/10/contrib/apr/include/apr_escape.h - copied unchanged from r266735, head/contrib/apr/include/apr_escape.h stable/10/contrib/apr/include/apr_skiplist.h - copied unchanged from r266735, head/contrib/apr/include/apr_skiplist.h stable/10/contrib/apr/include/private/ - copied from r266735, head/contrib/apr/include/private/ stable/10/contrib/apr/poll/unix/z_asio.c - copied unchanged from r266735, head/contrib/apr/poll/unix/z_asio.c stable/10/contrib/apr/tables/apr_skiplist.c - copied unchanged from r266735, head/contrib/apr/tables/apr_skiplist.c stable/10/contrib/apr/tools/ - copied from r266735, head/contrib/apr/tools/ stable/10/contrib/subversion/subversion/include/private/svn_cert.h - copied unchanged from r269833, head/contrib/subversion/subversion/include/private/svn_cert.h Modified: stable/10/contrib/apr/CHANGES stable/10/contrib/apr/LICENSE stable/10/contrib/apr/Makefile.in stable/10/contrib/apr/Makefile.win stable/10/contrib/apr/NOTICE stable/10/contrib/apr/apr.dep stable/10/contrib/apr/apr.dsp stable/10/contrib/apr/apr.mak stable/10/contrib/apr/apr.spec stable/10/contrib/apr/build-outputs.mk stable/10/contrib/apr/build.conf stable/10/contrib/apr/configure stable/10/contrib/apr/configure.in stable/10/contrib/apr/docs/canonical_filenames.html stable/10/contrib/apr/file_io/unix/filedup.c stable/10/contrib/apr/file_io/unix/filestat.c stable/10/contrib/apr/file_io/unix/mktemp.c stable/10/contrib/apr/file_io/unix/open.c stable/10/contrib/apr/file_io/unix/pipe.c stable/10/contrib/apr/file_io/unix/readwrite.c stable/10/contrib/apr/include/apr.h.in stable/10/contrib/apr/include/apr_allocator.h stable/10/contrib/apr/include/apr_errno.h stable/10/contrib/apr/include/apr_file_info.h stable/10/contrib/apr/include/apr_file_io.h stable/10/contrib/apr/include/apr_fnmatch.h stable/10/contrib/apr/include/apr_hash.h stable/10/contrib/apr/include/apr_inherit.h stable/10/contrib/apr/include/apr_lib.h stable/10/contrib/apr/include/apr_mmap.h stable/10/contrib/apr/include/apr_network_io.h stable/10/contrib/apr/include/apr_poll.h stable/10/contrib/apr/include/apr_pools.h stable/10/contrib/apr/include/apr_shm.h stable/10/contrib/apr/include/apr_strings.h stable/10/contrib/apr/include/apr_tables.h stable/10/contrib/apr/include/apr_thread_mutex.h stable/10/contrib/apr/include/apr_thread_proc.h stable/10/contrib/apr/include/apr_time.h stable/10/contrib/apr/include/apr_user.h stable/10/contrib/apr/include/apr_version.h stable/10/contrib/apr/include/arch/unix/apr_arch_poll_private.h stable/10/contrib/apr/include/arch/unix/apr_arch_threadproc.h stable/10/contrib/apr/include/arch/unix/apr_private.h.in stable/10/contrib/apr/libapr.dep stable/10/contrib/apr/libapr.dsp stable/10/contrib/apr/libapr.mak stable/10/contrib/apr/locks/unix/proc_mutex.c stable/10/contrib/apr/network_io/unix/sendrecv.c stable/10/contrib/apr/network_io/unix/sockaddr.c stable/10/contrib/apr/network_io/unix/socket_util.c stable/10/contrib/apr/network_io/unix/sockets.c stable/10/contrib/apr/network_io/unix/sockopt.c stable/10/contrib/apr/passwd/apr_getpass.c stable/10/contrib/apr/poll/unix/pollcb.c stable/10/contrib/apr/poll/unix/pollset.c stable/10/contrib/apr/shmem/unix/shm.c stable/10/contrib/apr/strings/apr_cpystrn.c stable/10/contrib/apr/strings/apr_strings.c stable/10/contrib/apr/support/unix/waitio.c stable/10/contrib/apr/tables/apr_hash.c stable/10/contrib/apr/tables/apr_tables.c stable/10/contrib/serf/CHANGES stable/10/contrib/serf/auth/auth_spnego.c stable/10/contrib/serf/buckets/ssl_buckets.c stable/10/contrib/serf/serf.h stable/10/contrib/serf/ssltunnel.c stable/10/contrib/subversion/CHANGES stable/10/contrib/subversion/NOTICE stable/10/contrib/subversion/build-outputs.mk stable/10/contrib/subversion/build.conf stable/10/contrib/subversion/configure stable/10/contrib/subversion/configure.ac stable/10/contrib/subversion/get-deps.sh stable/10/contrib/subversion/subversion/include/private/svn_cache.h stable/10/contrib/subversion/subversion/include/private/svn_dep_compat.h stable/10/contrib/subversion/subversion/include/svn_version.h stable/10/contrib/subversion/subversion/libsvn_client/commit_util.c stable/10/contrib/subversion/subversion/libsvn_client/delete.c stable/10/contrib/subversion/subversion/libsvn_client/export.c stable/10/contrib/subversion/subversion/libsvn_client/externals.c stable/10/contrib/subversion/subversion/libsvn_client/merge.c stable/10/contrib/subversion/subversion/libsvn_client/prop_commands.c stable/10/contrib/subversion/subversion/libsvn_delta/svndiff.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/commit.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/locks.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/log.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/options.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/update.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/util.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/protocol stable/10/contrib/subversion/subversion/libsvn_repos/dump.c stable/10/contrib/subversion/subversion/libsvn_repos/fs-wrap.c stable/10/contrib/subversion/subversion/libsvn_subr/cache-memcache.c stable/10/contrib/subversion/subversion/libsvn_subr/config_auth.c stable/10/contrib/subversion/subversion/libsvn_subr/config_file.c stable/10/contrib/subversion/subversion/libsvn_subr/dirent_uri.c stable/10/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/10/contrib/subversion/subversion/libsvn_subr/io.c stable/10/contrib/subversion/subversion/libsvn_subr/opt.c stable/10/contrib/subversion/subversion/libsvn_subr/prompt.c stable/10/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/10/contrib/subversion/subversion/libsvn_subr/version.c stable/10/contrib/subversion/subversion/libsvn_wc/status.c stable/10/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c stable/10/contrib/subversion/subversion/svn/conflict-callbacks.c stable/10/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c stable/10/contrib/subversion/subversion/svnrdump/util.c stable/10/contrib/subversion/subversion/svnserve/serve.c stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/svn/lib/libapr/Makefile stable/10/usr.bin/svn/lib/libapr/apr.h stable/10/usr.bin/svn/lib/libapr/apr_private.h stable/10/usr.bin/svn/svn/Makefile stable/10/usr.bin/svn/svn_private_config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/apr/CHANGES ============================================================================== --- stable/10/contrib/apr/CHANGES Tue Aug 12 00:59:19 2014 (r269846) +++ stable/10/contrib/apr/CHANGES Tue Aug 12 01:40:11 2014 (r269847) @@ -1,235 +1,124 @@ -*- coding: utf-8 -*- -Changes for APR 1.4.8 +Changes for APR 1.5.1 - *) Fix compiltation with FreeBSD on ARM. [Olli Hauer ] + *) apr_os_proc_mutex_get() on Unix: Avoid segfault for cross- + process pthread mutexes. [Yann Ylavic ] - *) Fix 1.4.7 regression in apr_mcast_hops() and apr_mcast_loopback() - for AF_INET (IPv4) sockets on most Unix platforms. [Joe Orton] + *) When using shmget-based shared memory, the ID used for ftok is + now an APR hash of the filename instead of the constant '1'. + We do this to help avoid collisions. PR 53996 [Jim Jagielski] - *) Fix the return value of apr_threadattr_detach_get() on some - platforms like OS X and Solaris. [Rainer Jung, ] + *) apr_socket_atreadeof(): Fix breakage on OS X. [Jim Jagielski] -Changes for APR 1.4.7 + *) Fix POSIX shared memory (shm_open) use for named shared memory. + Includes adding '--enable-posix-shm' to force POSIX shm if + available, and OS X compatibility. PR 55928. + [Jozef Hatala , Jim Jagielski] - *) Fix apr_sockaddr_info_get() not returning an error in some cases. - PR 54779. [Jan Kaluža ] + *) Fix race condition when calling apr_dir_make_recursive from + multiple threads on Windows. + [Bert Huijben] - *) Fix amd64 assembler version of apr_atomic_xchgptr(). PR 51851. [Mattias - EngdegÃ¥rd ] + *) Fix apr_escape.c compilation errors on EBCDIC platforms. + [Eric Covener] - *) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias EngdegÃ¥rd - ] + *) FreeBSD 10: Correct a regression in 1.5.0 which affected non- + blocking sockets in some applications, including httpd. [Jeff + Trawick] - *) configure: Fix detection of O_NONBLOCK inheritance on busy - systems. [Rainer Jung] + *) Windows cmake build: Fix incorrect installation of some .pdb + files. Fix incorrect use of some logic intended for Windows 9x, + including legacy filesystem interfaces and dynamic loading of + some Windows APIs. [Jeff Trawick] - *) Remove unused code, fix strict C compliance bug in SHA-256 - implementation. [Jan Kaluza ] - - *) Fix apr_ipsubnet_test() false positives when comparing IPv4 - subnet representation against an IPv6 address. PR 54047. [Joe Orton] - - *) apr_socket_accept_filter: Return success when trying to again set - the filter to the same value as before, avoiding an unhelpful - APR_EINVAL. PR 37863. [Jeff Trawick] - - *) configure: Fix Linux 3.x detection. PR 54001. [Gilles Espinasse - ] - - *) apr_time_exp_*() on Windows: Fix error in the tm_yday field of - apr_time_exp_t for times within leap years. PR 53175. + *) apr_skiplist: Add compatibility with C++ applications. [Jeff Trawick] - *) Improve platform detection by updating config.guess and config.sub. - [Rainer Jung] - - *) Add support for OSX Mountain Lion (10.8) [Jim Jagielski] - - *) Add various gcc function attributes. [Stefan Fritsch] - - *) Fix some problems in apr_sockaddr_info_get() when trying to resolve - the loopback addresses of a protocol family that is not otherwise - configured on the system. PR 52709. [Nirgal Vourgère - , Stefan Fritsch] - - *) Fix file not being unlocked if truncate call on a file fails. - [Mladen Turk] - - *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte - instead integer for setsockopt. [Mladen Turk] - - *) Windows: Fix compile-time checks for 64-bit builds, resolving a - crash in httpd's mod_rewrite. PR 49155. [] - -Changes for APR 1.4.6 - - *) Flush write buffer before truncate call on a file. - [Mladen Turk] - - *) Randomise hashes by providing a seed. - Assigned CVE-2012-0840, oCERT-2011-003, but not known to be exploitable. - [Bojan Smojver, Branko ÄŒibej, Ruediger Pluem et al.] - - *) apr_random: Prevent segfault if pool used to initialize apr_random is - destroyed before forking. [Stefan Fritsch] - - *) testrand: Improve child randomness test case. [Rainer Jung] - - *) apr_proc_fork, apr_random_after_fork: disambiguate what happens to the - proc structure passed in, and ensure that the pid is set correctly in - a newly created child; note that merely mixing a PID into the random - seed of a new child doesn't markedly increase entropy. [Sander Temme] - - *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. - PR 48557. [Mike Frysinger ] - - *) apr_dir_make_recursive: Fix race condition that could lead to EEXIST - being returned. PR 51254. [William Lee , - Wim Lewis ] - - *) configure: Fix APR_RESTORE_THE_ENVIRONMENT if the original variable was - a single space. PR 50334. [Nathan Phillip Brink ] - - *) apr_proc_create: Don't close any of the new stdin/stdout/stderr in the - child if it already has the correct FD. PR 51995. - [Dan Ports ] - - *) Fix flag character '#' in combination with format character 'x' in - apr snprintf implementations. [Rainer Jung] - - *) Improve platform detection by updating config.guess and config.sub. - [Rainer Jung] - - *) Add libtool2 files to extraclean make target. [Rainer Jung] + *) Correct a regression in 1.5.0 which affected out-of-tree + builds on Unix. [Rainer Jung] - *) Don't overwrite our config.guess and config.sub - when running buildconf. [Rainer Jung] + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] - *) Silence autoconf 2.68 warnings. [Rainer Jung] +Changes for APR 1.5.0 -Changes for APR 1.4.5 - - *) Security: CVE-2011-1928 - apr_fnmatch(): Fix high CPU loop. [William Rowe] - - *) Fix top_builddir in installed apr_rules.mk. [Bojan Smojver] - -Changes for APR 1.4.4 - - *) Windows: Fix command-line builds. [William Rowe] - -Changes for APR 1.4.3 - - *) Security: CVE-2011-0419 - Reimplement apr_fnmatch() from scratch using a non-recursive - algorithm; now has improved compliance with the fnmatch() spec. - [William Rowe] - - *) Fix environment-related crash using some non-standard builds on - Windows 7/Server 2008. [Steve Hay ] - - *) poll, pollset, pollcb on Windows: Handle calls with no file/socket - descriptors. PR 49882. [Stefan Ruppert , Jeff Trawick] - - *) Fix APR_IPV6_V6ONLY issues on Windows related to run-time behavior - on Windows older than Vista and SDK/MinGW levels without IPV6_V6ONLY. - PR 45321. [Sob ] - - *) Fix address handling when accepting an AF_INET socket from a socket - bound as AF_INET6. PR 49678. [Joe Orton] + *) Fix Linux kernel version check to recognize more versions, + including versions 3.10 and later. PR 55690. [Joe Orton, + Arfrever Frehtes Taifersar Arahesis ] + + *) Add apr_sockaddr_is_wildcard() to check if a socket address + refers to the wildcard address for the protocol family (e.g., + 0.0.0.0/INADDR_ANY for IPv4). [Jeff Trawick] + + *) apr_file_dup2() on Windows: Fix debug RTL assertion when + attempting to _commit(stdout) or _commit(stderr). [Mike Rumph + ] + + *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. + [, Jeff Trawick] + + *) z/OS: threadsafe apr_pollset_poll support for sockets [Greg Ames] + + *) Windows: Don't obtain a mutex for buffered file I/O unless the + file was opened with the APR_FOPEN_XTHREAD flag. [Ivan Zhakov + ] + + *) Windows: Create named shared memory segments under the "Local" + namespace if the caller is unprivileged, fixing an inability of + unprivileged callers to use apr_shm_create() with named shared + memory segments under recent Windows. As before, shared memory + segments are created under the "Global" namespace for privileged + callers. Add apr_shm_create_ex() and apr_shm_attach_ex(), which + provide the ability to override the normal namespace selection. + [Jeff Trawick] - *) Fix error return values from apr_sockaddr_info_get() on Windows for - IPv6 builds. [Ivan Zhakov ] + *) Update compile settings for MINT OS. PR 47181. [Alan Hourihane + ] - *) Add new experimental configure option --enable-allocator-uses-mmap to - use mmap instead of malloc in apr_allocator_alloc(). This greatly reduces - memory fragmentation with malloc implementations (e.g. glibc) that - don't handle allocationss of a page-size-multiples in an efficient way. - It also makes apr_allocator_max_free_set() actually have some effect - on such platforms. [Stefan Fritsch] + *) Files and pipes on Windows: Don't create an unused pollset when + files and pipes are opened. [Mladen Turk] - *) configure: Support 64 and 32 bit universal builds for Darwin/ - OS X 10.6+. [Jim Jagielski] + *) apr_socket_timeout_set() on Windows: If the socket was in a non- + blocking state before, disable that setting so that timeouts work. + [Jeff Trawick] - *) apr_sockaddr_info_get() on AIX: Fix a problem which could set - the port field in the native socket address to 1 when 0 was - specified. PR 46964. [Jeff Trawick] + *) File info APIs: Fix calculation of atime and mtime on AIX. PR 51146. + [Ruediger Pluem] - *) configure: Make definition of apr_ino_t independent of - _FILE_OFFSET_BITS even on platforms where ino_t is 'unsigned int'. - [Stefan Fritsch] + *) Add the apr_escape interface. [Graham Leggett] - *) apr_ring: Workaround for aliasing problem that causes gcc 4.5 to - miscompile some brigade related code. PR 50190. [Stefan Fritsch] + *) Cygwin build fixes. PRs 51016 and 55586. [Carlo Bramini + ] - *) apr_file_flush_locked(): Handle short writes. [Stefan Fritsch] + *) Add apr_skiplist family. [Jim Jagielski] - *) apr_pollset_create_ex(): Trap errors from pollset providers. - PR 49094. [Sami Tolvanen ] + *) Add experimental cmake-based build system for Windows. Refer to + README.cmake for more information. [Jeff Trawick, Tom Donovan] - *) apr_pollset_create*(): Fix memory lifetime problem with the wakeup - pipe when the pollset was created with APR_POLLSET_NOCOPY. - [Neil Conway ] + *) Add the apr_table_getm() call, which transparently handles the + merging of keys with multiple values. [Graham Leggett] - *) Fix detection of some Linux variants when configure is built with - recent GNU tools. [Eric Covener] + *) Add apr_hash_this_key(), apr_hash_this_key_len(), and + apr_hash_this_val() for easier access to those attributes from + a hash iterator. [Hyrum K. Wright ] - *) Avoid a redundant fcntl() call in apr_file_open() where O_CLOEXEC - is supported. PR 46297. [Joe Orton] + *) MinGW/MSYS: Support shared builds of APR, other general improvements + to support of this toolchain. PR 46175. [Carlo Bramini + ] *) Improve platform detection by updating config.guess and config.sub. [Rainer Jung] -Changes for APR 1.4.2 - - *) Undo a crash-bug introduced in 1.4.1 affecting some applications of - the apr hash and table structures, reported to affect Subversion - by Bert Huijben . [Graham Leggett] - -Changes for APR 1.4.1 - - *) Win32: Properly handle the ERROR_DIRECTORY system error code. - [Brane ÄŒibej] - -Changes for APR 1.4.0 - - *) Windows: Default build configurations assume NT or higher at run-time. - - *) Add apr_global_mutex_lockfile() for retrieving the file, if any, - associated with the mutex. Add apr_global_mutex_name() for retrieving - the name of the lock mechanism used by the underlying proc mutex. - [Jeff Trawick] - - *) Add apr_socket_atreadeof to determine whether the receive part of the - socket has been closed by the peer. - [Ruediger Pluem, Mladen Turk, Joe Orton] - - *) Make apr_pollset and apr_pollcb implementations using providers. - Added apr_pollset_create_ex and apr_pollcb_create_ex that allows - choosing non-default providers. - [Mladen Turk] - - *) Win32: Use WSAPoll as default pollset method if supported and found - inside winsock dll. [Mladen Turk] - - *) apr_temp_dir_get() now checks the TMPDIR environment variable first, - instead of third. [Jim Jagielski] - - *) Add apr_file_sync() and apr_file_datasync() calls. [Bojan Smojver] - - *) apr_pollset_wakeup() on Windows: Fix core caused by closing the - file_socket_pipe with standard file_close. - [Arsen Chaloyan, Mladen Turk] - - *) Introduce apr_hash_do() for iterating over a hash table. [Mladen Turk] + *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389. + [Armin Müller ] - *) Make sure WIN32 behaves the same as posix for file-backed shared memory - by removing the file on cleanup/remove. [Mladen Turk] + *) Enable platform specific support for the opening of a file or + pipe in non-blocking mode through the APR_FOPEN_NONBLOCK flag. + [Graham Leggett] - *) Introduce apr_pollset_wakeup() for interrupting the blocking - apr_pollset_poll() call. [Mladen Turk] +Changes for APR 1.4.x and later: - *) Add apr_file_link() function. PR 44841. [Mark Heily ] + *) http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?view=markup Changes for APR 1.3.x and later: Copied: stable/10/contrib/apr/CMakeLists.txt (from r266735, head/contrib/apr/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/apr/CMakeLists.txt Tue Aug 12 01:40:11 2014 (r269847, copy of r266735, head/contrib/apr/CMakeLists.txt) @@ -0,0 +1,434 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Read README.cmake before using this. + +PROJECT(APR C) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) +OPTION(APR_HAVE_IPV6 "IPv6 support" ON) +OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) +OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) +SET(MIN_WINDOWS_VER "Vista" + CACHE STRING "Minimum Windows version") + +# create 1-or-0 representation of feature tests for apr.h + +SET(apr_have_ipv6_10 0) + +IF(APR_HAVE_IPV6) + SET(apr_have_ipv6_10 1) +ENDIF() + +IF("${MIN_WINDOWS_VER}" STREQUAL "") + SET(win32_winnt_str "0x0600") +ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Vista") + SET(win32_winnt_str "0x0600") +ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Windows7") + SET(win32_winnt_str "0x0601") +ELSE() + SET(win32_winnt_str ${MIN_WINDOWS_VER}) +ENDIF() + +CONFIGURE_FILE(include/apr.hwc + ${PROJECT_BINARY_DIR}/apr.h) + +ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c) +GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) +ADD_CUSTOM_COMMAND( + COMMENT "Generating character tables, apr_escape_test_char.h, for current locale" + DEPENDS gen_test_char + COMMAND ${GEN_TEST_CHAR_EXE} > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h + OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h +) +ADD_CUSTOM_TARGET( + test_char_header ALL + DEPENDS ${PROJECT_BINARY_DIR}/apr_escape_test_char.h +) + +# Generated .h files are stored in PROJECT_BINARY_DIR, not the +# source tree. +# +# BROKEN: not searching PROJECT_BINARY_DIR first, so you have to +# manually delete apr.h in PROJECT_SOURCE_DIR/include if +# you've generated apr.h before using a different build + +SET(APR_INCLUDE_DIRECTORIES + ${PROJECT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/win32 + ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/unix + ${CMAKE_CURRENT_SOURCE_DIR}/include/private +) + +SET(APR_SYSTEM_LIBS + ws2_32 + mswsock + rpcrt4 +) + +INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES}) + +SET(APR_PUBLIC_HEADERS_STATIC + include/apr_allocator.h + include/apr_atomic.h + include/apr_dso.h + include/apr_env.h + include/apr_errno.h + include/apr_escape.h + include/apr_file_info.h + include/apr_file_io.h + include/apr_fnmatch.h + include/apr_general.h + include/apr_getopt.h + include/apr_global_mutex.h + include/apr_hash.h + include/apr_inherit.h + include/apr_lib.h + include/apr_mmap.h + include/apr_network_io.h + include/apr_poll.h + include/apr_pools.h + include/apr_portable.h + include/apr_proc_mutex.h + include/apr_random.h + include/apr_ring.h + include/apr_shm.h + include/apr_signal.h + include/apr_skiplist.h + include/apr_strings.h + include/apr_support.h + include/apr_tables.h + include/apr_thread_cond.h + include/apr_thread_mutex.h + include/apr_thread_proc.h + include/apr_thread_rwlock.h + include/apr_time.h + include/apr_user.h + include/apr_version.h + include/apr_want.h +) +SET(APR_PUBLIC_HEADERS_GENERATED + ${PROJECT_BINARY_DIR}/apr.h +) + +SET(APR_SOURCES + atomic/win32/apr_atomic.c + dso/win32/dso.c + encoding/apr_escape.c + file_io/unix/copy.c + file_io/unix/fileacc.c + file_io/unix/filepath_util.c + file_io/unix/fullrw.c + file_io/unix/mktemp.c + file_io/unix/tempdir.c + file_io/win32/buffer.c + file_io/win32/dir.c + file_io/win32/filedup.c + file_io/win32/filepath.c + file_io/win32/filestat.c + file_io/win32/filesys.c + file_io/win32/flock.c + file_io/win32/open.c + file_io/win32/pipe.c + file_io/win32/readwrite.c + file_io/win32/seek.c + locks/win32/proc_mutex.c + locks/win32/thread_cond.c + locks/win32/thread_mutex.c + locks/win32/thread_rwlock.c + memory/unix/apr_pools.c + misc/unix/errorcodes.c + misc/unix/getopt.c + misc/unix/otherchild.c + misc/unix/version.c + misc/win32/charset.c + misc/win32/env.c + misc/win32/internal.c + misc/win32/misc.c + misc/win32/rand.c + misc/win32/start.c + misc/win32/utf8.c + mmap/unix/common.c + mmap/win32/mmap.c + network_io/unix/inet_ntop.c + network_io/unix/inet_pton.c + network_io/unix/multicast.c + network_io/unix/sockaddr.c + network_io/unix/socket_util.c + network_io/win32/sendrecv.c + network_io/win32/sockets.c + network_io/win32/sockopt.c + passwd/apr_getpass.c + poll/unix/poll.c + poll/unix/pollcb.c + poll/unix/pollset.c + poll/unix/select.c + random/unix/apr_random.c + random/unix/sha2.c + random/unix/sha2_glue.c + shmem/win32/shm.c + strings/apr_cpystrn.c + strings/apr_fnmatch.c + strings/apr_snprintf.c + strings/apr_strings.c + strings/apr_strnatcmp.c + strings/apr_strtok.c + tables/apr_hash.c + tables/apr_skiplist.c + tables/apr_tables.c + threadproc/win32/proc.c + threadproc/win32/signals.c + threadproc/win32/thread.c + threadproc/win32/threadpriv.c + time/win32/time.c + time/win32/timestr.c + user/win32/groupinfo.c + user/win32/userinfo.c +) + +SET(APR_TEST_SOURCES + test/abts.c + test/testargs.c + test/testatomic.c + test/testcond.c + test/testdir.c + test/testdso.c + test/testdup.c + test/testenv.c + test/testescape.c + test/testfile.c + test/testfilecopy.c + test/testfileinfo.c + test/testflock.c + test/testfmt.c + test/testfnmatch.c + test/testglobalmutex.c + test/testhash.c + test/testipsub.c + test/testlfs.c + test/testlock.c + test/testmmap.c + test/testnames.c + test/testoc.c + test/testpath.c + test/testpipe.c + test/testpoll.c + test/testpools.c + test/testproc.c + test/testprocmutex.c + test/testrand.c + test/testshm.c + test/testsleep.c + test/testsock.c + test/testsockets.c + test/testsockopt.c + test/teststr.c + test/teststrnatcmp.c + test/testtable.c + test/testtemp.c + test/testthread.c + test/testtime.c + test/testud.c + test/testuser.c + test/testutil.c + test/testvsn.c +) + +SET(install_targets) +SET(install_bin_pdb) +SET(install_lib_pdb) + +# libapr-1 is shared, apr-1 is static +ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc) +SET(install_targets ${install_targets} libapr-1) +SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-1.pdb) +TARGET_LINK_LIBRARIES(libapr-1 ${APR_SYSTEM_LIBS}) +SET_TARGET_PROPERTIES(libapr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;WINNT") +ADD_DEPENDENCIES(libapr-1 test_char_header) + +ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} apr-1) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/apr-1.pdb) +TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS}) +SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT") +ADD_DEPENDENCIES(apr-1 test_char_header) + +# libaprapp-1 and aprapp-1 are static +ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} libaprapp-1) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/libaprapp-1.pdb) +SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT") + +ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} aprapp-1) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-1.pdb) +SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT") + +IF(APR_BUILD_TESTAPR) + ENABLE_TESTING() + # Create a "check" target that displays test program output to the console. + ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) + + # copy data files to build directory so that we can run programs from there + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory + ${PROJECT_BINARY_DIR}/data) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/file_datafile.txt + ${PROJECT_BINARY_DIR}/data/file_datafile.txt) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/mmap_datafile.txt + ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) + + IF(TEST_STATIC_LIBS) + SET(whichapr apr-1) + SET(whichaprapp aprapp-1) + SET(apiflag -DAPR_DECLARE_STATIC) + ELSE() + SET(whichapr libapr-1) + SET(whichaprapp libaprapp-1) + SET(apiflag) + ENDIF() + + ADD_EXECUTABLE(testapp test/testapp.c) + TARGET_LINK_LIBRARIES(testapp ${whichapr} ${whichaprapp} ${APR_SYSTEM_LIBS}) + SET_TARGET_PROPERTIES(testapp PROPERTIES LINK_FLAGS /entry:wmainCRTStartup) + IF(apiflag) + SET_TARGET_PROPERTIES(testapp PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testapp COMMAND testapp) + + ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) + TARGET_LINK_LIBRARIES(testall ${whichapr} ${APR_SYSTEM_LIBS}) + IF(apiflag) + SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testall COMMAND testall) + + ADD_LIBRARY(mod_test MODULE test/mod_test.c) + TARGET_LINK_LIBRARIES(mod_test ${whichapr} ${APR_SYSTEM_LIBS}) + SET_PROPERTY(TARGET mod_test APPEND PROPERTY LINK_FLAGS /export:print_hello) + # nasty work-around for difficulties adding more than one additional flag + # (they get joined in a bad way behind the scenes) + GET_PROPERTY(link_flags TARGET mod_test PROPERTY LINK_FLAGS) + SET(link_flags "${link_flags} /export:count_reps") + SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) + IF(apiflag) + SET_TARGET_PROPERTIES(mod_test PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + + # Build all the single-source executable files with no special build + # requirements. + SET(single_source_programs + test/echod.c + test/sendfile.c + test/sockperf.c + test/testlockperf.c + test/testmutexscope.c + test/globalmutexchild.c + test/occhild.c + test/proc_child.c + test/readchild.c + test/sockchild.c + test/testshmproducer.c + test/testshmconsumer.c + test/tryread.c + test/internal/testucs.c + ) + + FOREACH(sourcefile ${single_source_programs}) + STRING(REGEX REPLACE ".*/([^\\]+)\\.c" "\\1" proggie ${sourcefile}) + ADD_EXECUTABLE(${proggie} ${sourcefile}) + TARGET_LINK_LIBRARIES(${proggie} ${whichapr} ${APR_SYSTEM_LIBS}) + IF(apiflag) + SET_TARGET_PROPERTIES(${proggie} PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ENDFOREACH() + + # Add tests for programs that run by themselves with no arguments. + SET(simple_tests + testmutexscope + testucs + ) + + FOREACH(simple ${simple_tests}) + ADD_TEST(NAME ${simple} COMMAND ${simple}) + ENDFOREACH() + + # testlockperf takes forever on Windows with default counter limit + ADD_TEST(NAME testlockperf COMMAND testlockperf -c 50000) + + # sendfile runs multiple times with different parameters. + FOREACH(sendfile_mode blocking nonblocking timeout) + ADD_TEST(NAME sendfile-${sendfile_mode} COMMAND sendfile client ${sendfile_mode} startserver) + ENDFOREACH() + + # No test is added for echod+sockperf. Those will have to be run manually. + +ENDIF (APR_BUILD_TESTAPR) + +# Installation + +INSTALL(TARGETS ${install_targets} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +IF(INSTALL_PDB) + INSTALL(FILES ${install_bin_pdb} + DESTINATION bin + CONFIGURATIONS RelWithDebInfo Debug) + + INSTALL(FILES ${install_lib_pdb} + DESTINATION lib + CONFIGURATIONS RelWithDebInfo Debug) +ENDIF() + +INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) +IF(APR_INSTALL_PRIVATE_H) + # Kludges for unexpected dependencies of httpd 2.x, not installed by default + SET(APR_PRIVATE_H_FOR_HTTPD + include/arch/win32/apr_arch_file_io.h + include/arch/win32/apr_arch_misc.h + include/arch/win32/apr_arch_utf8.h + include/arch/win32/apr_private.h + ) + INSTALL(FILES ${APR_PRIVATE_H_FOR_HTTPD} DESTINATION include/arch/win32) + INSTALL(FILES include/arch/apr_private_common.h DESTINATION include/arch) +ENDIF() + +STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) +MESSAGE(STATUS "") +MESSAGE(STATUS "") +MESSAGE(STATUS "APR configuration summary:") +MESSAGE(STATUS "") + +MESSAGE(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}") +MESSAGE(STATUS " Install .pdb (if available)...... : ${INSTALL_PDB}") +MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") +MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") +MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") +MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +IF(TEST_STATIC_LIBS) +MESSAGE(STATUS " (testing static libraries)") +ELSE() +MESSAGE(STATUS " (testing dynamic libraries)") +ENDIF() +MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") Modified: stable/10/contrib/apr/LICENSE ============================================================================== --- stable/10/contrib/apr/LICENSE Tue Aug 12 00:59:19 2014 (r269846) +++ stable/10/contrib/apr/LICENSE Tue Aug 12 01:40:11 2014 (r269847) @@ -206,8 +206,8 @@ APACHE PORTABLE RUNTIME SUBCOMPONENTS: The Apache Portable Runtime includes a number of subcomponents with separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. +code for these subcomponents is subject to the terms and conditions +of the following licenses. From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c, file_io/unix/mktemp.c, strings/apr_strings.c: Modified: stable/10/contrib/apr/Makefile.in ============================================================================== --- stable/10/contrib/apr/Makefile.in Tue Aug 12 00:59:19 2014 (r269846) +++ stable/10/contrib/apr/Makefile.in Tue Aug 12 01:40:11 2014 (r269847) @@ -18,7 +18,7 @@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ INCDIR=./include OSDIR=$(top_srcdir)/include/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private -I$(top_blddir)/include/private # # Macros for target determination @@ -36,7 +36,7 @@ INSTALL_DATA = @INSTALL_DATA@ # Rules for building specific targets, starting with 'all' for # building the entire package. # -TARGETS = $(TARGET_LIB) apr.exp apr-config.out build/apr_rules.out +TARGETS = $(TARGET_LIB) include/private/apr_escape_test_char.h apr.exp apr-config.out build/apr_rules.out LT_VERSION = @LT_VERSION@ @@ -45,7 +45,9 @@ LT_VERSION = @LT_VERSION@ @INCLUDE_OUTPUTS@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ - build/apr_rules.out + build/apr_rules.out tools/gen_test_char@EXEEXT@ \ + tools/gen_test_char.o tools/gen_test_char.lo \ + include/private/apr_escape_test_char.h DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \ @@ -99,6 +101,8 @@ install: $(TARGETS) $(TARGET_LIB): $(OBJECTS) $(LINK) @lib_target@ $(ALL_LIBS) +encoding/apr_escape.lo: include/private/apr_escape_test_char.h + exports.c: $(HEADERS) $(APR_MKEXPORT) $(HEADERS) > $@ @@ -125,5 +129,20 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` +make_tools_dir: + $(APR_MKDIR) tools + +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char.lo: make_tools_dir +tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) + $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) + +include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ + $(APR_MKDIR) include/private + tools/gen_test_char@EXEEXT@ > $@ + +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \ + @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ + # DO NOT REMOVE docs: $(INCDIR)/*.h Modified: stable/10/contrib/apr/Makefile.win ============================================================================== --- stable/10/contrib/apr/Makefile.win Tue Aug 12 00:59:19 2014 (r269846) +++ stable/10/contrib/apr/Makefile.win Tue Aug 12 01:40:11 2014 (r269847) @@ -7,7 +7,7 @@ # install - compile everything # clean - mop up everything # -# You can override the build mechansim, choose only one; +# You can override the build mechanism, choose only one; # # USEMAK=1 - compile from exported make files # USEDSW=1 - compile from .dsw / .dsp VC6 projects Modified: stable/10/contrib/apr/NOTICE ============================================================================== --- stable/10/contrib/apr/NOTICE Tue Aug 12 00:59:19 2014 (r269846) +++ stable/10/contrib/apr/NOTICE Tue Aug 12 01:40:11 2014 (r269847) @@ -1,7 +1,7 @@ Apache Portable Runtime -Copyright (c) 2011 The Apache Software Foundation. +Copyright (c) 2000-2014 The Apache Software Foundation. -This product includes software developed by +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at the National Center Copied: stable/10/contrib/apr/README.cmake (from r266735, head/contrib/apr/README.cmake) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/apr/README.cmake Tue Aug 12 01:40:11 2014 (r269847, copy of r266735, head/contrib/apr/README.cmake) @@ -0,0 +1,112 @@ +Experimental cmake-based build support for APR on Microsoft Windows + +Status +------ + +This build support is currently intended only for Microsoft Windows. +Only Windows NT-based systems can be targeted. (The traditional +Windows build support for APR can target Windows 9x as well.) + +This build support is experimental. Specifically, + +* It does not support all features of APR. +* Some components may not be built correctly and/or in a manner + compatible with the previous Windows build support. +* Build interfaces, such as the mechanisms which are used to enable + optional functionality or specify prerequisites, may change from + release to release as feedback is received from users and bugs and + limitations are resolved. + +Important: Refer to the "Known Bugs and Limitations" section for further + information. + + It is beyond the scope of this document to document or explain + how to utilize the various cmake features, such as different + build backends or provisions for finding support libraries. + + Please refer to the cmake documentation for additional information + that applies to building any project with cmake. + +Prerequisites +------------- + +The following tools must be in PATH: + +* cmake, version 2.8 or later +* If using a command-line compiler: compiler and linker and related tools + (Refer to the cmake documentation for more information.) + +How to build +------------ + +1. cd to a clean directory for building (i.e., don't build in your + source tree) + +2. Some cmake backends may want your compile tools in PATH. (Hint: "Visual + Studio Command Prompt") + +3. cmake -G "some backend, like 'NMake Makefiles'" + -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst + -DAPR-specific-flags + d:/path/to/aprsource + + Alternately, use cmake-gui and update settings in the GUI. + + APR feature flags: + + APR_INSTALL_PRIVATE_H Install extra .h files which are required when + building httpd and Subversion but which aren't + intended for use by applications. + Default: OFF + APR_HAVE_IPV6 Enable IPv6 support + Default: ON + APR_BUILD_TESTAPR Build APR test suite + Default: OFF + TEST_STATIC_LIBS Build the test suite to test the APR static + library instead of the APR dynamic library. + Default: OFF + In order to build the test suite against both + static and dynamic libraries, separate builds + will be required, one with TEST_STATIC_LIBS + set to ON. + MIN_WINDOWS_VER Minimum Windows version supported by this build + (This controls the setting of _WIN32_WINNT.) + "Vista" or "Windows7" or a numeric value like + "0x0601" + Default: "Vista" + For desktop/server equivalence or other values, + refer to + http://msdn.microsoft.com/en-us/library/windows/ + desktop/aa383745(v=vs.85).aspx + INSTALL_PDB Install .pdb files if generated. + Default: ON + + CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL + + CMAKE_BUILD_TYPE + + For NMake Makefiles the choices are at least DEBUG, RELEASE, + RELWITHDEBINFO, and MINSIZEREL + Other backends make have other selections. + +4. build using chosen backend (e.g., "nmake install") + +Known Bugs and Limitations +-------------------------- + +* If include/apr.h or other generated files have been created in the source + directory by another build system, they will be used unexpectedly and + cause the build to fail. +* Options should be provided for remaining features: + + APR_POOL_DEBUG +* APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, + though perhaps that is a job for a higher-level script. + +Generally: + +* Many APR features have not been tested with this build. +* Developers need to examine the existing Windows build in great detail and see + what is missing from the cmake-based build, whether a feature or some build + nuance. +* Any feedback you can provide on your experiences with this build will be + helpful. Modified: stable/10/contrib/apr/apr.dep ============================================================================== --- stable/10/contrib/apr/apr.dep Tue Aug 12 00:59:19 2014 (r269846) +++ stable/10/contrib/apr/apr.dep Tue Aug 12 01:40:11 2014 (r269847) @@ -1,558 +1,1916 @@ -# Microsoft Developer Studio Generated Dependency File, included by apr.mak - -.\atomic\win32\apr_atomic.c : \ - ".\include\apr_atomic.h"\ - - -.\dso\win32\dso.c : \ - ".\include\apr_getopt.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_poll.h"\ - ".\include\apr_portable.h"\ - ".\include\apr_strings.h"\ - ".\include\arch\win32\apr_arch_dso.h"\ - ".\include\arch\win32\apr_arch_file_io.h"\ - ".\include\arch\win32\apr_arch_utf8.h"\ - - -.\file_io\win32\buffer.c : \ - ".\include\apr_getopt.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_poll.h"\ - ".\include\apr_portable.h"\ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 02:02:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CF1B645 for ; Tue, 12 Aug 2014 02:02:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 249DD23DA for ; Tue, 12 Aug 2014 02:02:53 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2a77 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 02:02:53 +0000 From: Peter Wemm Date: Tue, 12 Aug 2014 02:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r269848 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e975cd.2a77.19026dcf@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 02:02:53 -0000 Author: peter Date: Tue Aug 12 02:02:52 2014 New Revision: 269848 URL: http://svnweb.freebsd.org/changeset/base/269848 Log: Temp size limit boost due to an import. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Tue Aug 12 01:40:11 2014 (r269847) +++ svnadmin/conf/sizelimit.conf Tue Aug 12 02:02:52 2014 (r269848) @@ -31,6 +31,7 @@ jeff kmacy lstewart obrien +peter roberto rwatson sam From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 02:03:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C956F783 for ; Tue, 12 Aug 2014 02:03:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B545F23E9 for ; Tue, 12 Aug 2014 02:03:24 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2ac8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 02:03:24 +0000 From: Peter Wemm Date: Tue, 12 Aug 2014 02:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r269849 - vendor/sqlite3/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e975ec.2ac8.7baaf8ff@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 02:03:25 -0000 Author: peter Date: Tue Aug 12 02:03:24 2014 New Revision: 269849 URL: http://svnweb.freebsd.org/changeset/base/269849 Log: Vendor import sqlite-3.8.5 (sqlite-autoconf-3080500), minus tea/* Modified: vendor/sqlite3/dist/INSTALL vendor/sqlite3/dist/Makefile.in vendor/sqlite3/dist/aclocal.m4 vendor/sqlite3/dist/config.guess vendor/sqlite3/dist/config.sub vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/depcomp vendor/sqlite3/dist/install-sh vendor/sqlite3/dist/ltmain.sh vendor/sqlite3/dist/missing vendor/sqlite3/dist/shell.c vendor/sqlite3/dist/sqlite3.1 vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/sqlite3ext.h Modified: vendor/sqlite3/dist/INSTALL ============================================================================== --- vendor/sqlite3/dist/INSTALL Tue Aug 12 02:02:52 2014 (r269848) +++ vendor/sqlite3/dist/INSTALL Tue Aug 12 02:03:24 2014 (r269849) @@ -1,16 +1,25 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== -These are generic installation instructions. + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -23,9 +32,9 @@ debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is +the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale -cache files.) +cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -35,30 +44,37 @@ some point `config.cache' contains resul may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. + `./configure' to configure the package for your system. - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. - 5. You can remove the program binaries and object files from the + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,45 +83,69 @@ The simplest way to compile this package all sorts of other programs in order to regenerate files that came with the distribution. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + Compilers and Options ===================== -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== -You can compile the package for more than one kind of computer at the + You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the +own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. Installation Names ================== -By default, `make install' installs the package's commands under + By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -116,16 +156,47 @@ Documentation and other data files still In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to + Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -137,14 +208,58 @@ find the X include and library files aut you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: @@ -152,7 +267,8 @@ type, such as `sun4', or a canonical nam where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -170,9 +286,9 @@ eventually be run) with `--host=TYPE'. Sharing Defaults ================ -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. @@ -181,7 +297,7 @@ A warning: not all `configure' scripts l Defining Variables ================== -Variables not defined in a site shell script can be set in the + Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set @@ -190,21 +306,29 @@ them in the `configure' command line, us ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: +overridden in the site shell script). - /bin/bash ./configure CONFIG_SHELL=/bin/bash +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== -`configure' recognizes the following options to control how it operates. + `configure' recognizes the following options to control how it +operates. `--help' `-h' - Print a summary of the options to `configure', and exit. + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. `--version' `-V' @@ -231,6 +355,16 @@ configuration-related scripts to be exec Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. Modified: vendor/sqlite3/dist/Makefile.in ============================================================================== --- vendor/sqlite3/dist/Makefile.in Tue Aug 12 02:02:52 2014 (r269848) +++ vendor/sqlite3/dist/Makefile.in Tue Aug 12 02:03:24 2014 (r269849) @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,15 +18,29 @@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,56 +55,84 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sqlite3$(EXEEXT) +subdir = . DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \ config.guess config.sub depcomp install-sh ltmain.sh missing -subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno + configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = sqlite3.pc +CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" -libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libsqlite3_la_LIBADD = am_libsqlite3_la_OBJECTS = sqlite3.lo libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +libsqlite3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_sqlite3_OBJECTS = shell.$(OBJEXT) sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) -pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) -includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags @@ -97,16 +140,18 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCE distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -119,57 +164,65 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ -ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -181,6 +234,7 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -208,8 +262,12 @@ program_transform_name = @program_transf psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c @@ -226,21 +284,21 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -256,28 +314,34 @@ $(top_builddir)/config.status: $(top_src $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: @@ -288,39 +352,57 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libsqlite3_la_LDFLAGS) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) +libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) $(EXTRA_libsqlite3_la_DEPENDENCIES) + $(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) $(EXTRA_sqlite3_DEPENDENCIES) @rm -f sqlite3$(EXEEXT) - $(LINK) $(sqlite3_LDFLAGS) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) + $(LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -332,22 +414,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -359,177 +441,215 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-man1: $(man1_MANS) $(man_MANS) + -rm -f libtool config.lt +install-man1: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + uninstall-man1: @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" - @list='$(pkgconfig_DATA)'; for p in $$list; do \ + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ - $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ - done + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; for p in $$list; do \ + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ - $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ - rm -f "$(DESTDIR)$(includedir)/$$f"; \ - done + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 02:04:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D84528C2 for ; Tue, 12 Aug 2014 02:04:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAFF423F8 for ; Tue, 12 Aug 2014 02:04:48 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2ad8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 02:04:48 +0000 From: Peter Wemm Date: Tue, 12 Aug 2014 02:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r269850 - vendor/sqlite3/sqlite-3080500 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e97640.2ad8.67451558@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 02:04:48 -0000 Author: peter Date: Tue Aug 12 02:04:48 2014 New Revision: 269850 URL: http://svnweb.freebsd.org/changeset/base/269850 Log: Tag sqlite-3.8.5 import Added: vendor/sqlite3/sqlite-3080500/ - copied from r269849, vendor/sqlite3/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 02:09:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84475A35 for ; Tue, 12 Aug 2014 02:09:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7052A2418 for ; Tue, 12 Aug 2014 02:09:01 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 2b28 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 02:09:01 +0000 From: Peter Wemm Date: Tue, 12 Aug 2014 02:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269851 - head/contrib/sqlite3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9773d.2b28.2c0d30db@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 02:09:01 -0000 Author: peter Date: Tue Aug 12 02:09:00 2014 New Revision: 269851 URL: http://svnweb.freebsd.org/changeset/base/269851 Log: Update sqlite-3.7.17 -> 3.8.5 Modified: head/contrib/sqlite3/INSTALL head/contrib/sqlite3/Makefile.in head/contrib/sqlite3/aclocal.m4 head/contrib/sqlite3/config.guess head/contrib/sqlite3/config.sub head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/depcomp head/contrib/sqlite3/install-sh head/contrib/sqlite3/ltmain.sh head/contrib/sqlite3/missing head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.1 head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/INSTALL ============================================================================== --- head/contrib/sqlite3/INSTALL Tue Aug 12 02:04:48 2014 (r269850) +++ head/contrib/sqlite3/INSTALL Tue Aug 12 02:09:00 2014 (r269851) @@ -1,16 +1,25 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== -These are generic installation instructions. + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -23,9 +32,9 @@ debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is +the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale -cache files.) +cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -35,30 +44,37 @@ some point `config.cache' contains resul may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. + `./configure' to configure the package for your system. - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. - 5. You can remove the program binaries and object files from the + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,45 +83,69 @@ The simplest way to compile this package all sorts of other programs in order to regenerate files that came with the distribution. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + Compilers and Options ===================== -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== -You can compile the package for more than one kind of computer at the + You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the +own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. Installation Names ================== -By default, `make install' installs the package's commands under + By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -116,16 +156,47 @@ Documentation and other data files still In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to + Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -137,14 +208,58 @@ find the X include and library files aut you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: @@ -152,7 +267,8 @@ type, such as `sun4', or a canonical nam where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -170,9 +286,9 @@ eventually be run) with `--host=TYPE'. Sharing Defaults ================ -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. @@ -181,7 +297,7 @@ A warning: not all `configure' scripts l Defining Variables ================== -Variables not defined in a site shell script can be set in the + Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set @@ -190,21 +306,29 @@ them in the `configure' command line, us ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: +overridden in the site shell script). - /bin/bash ./configure CONFIG_SHELL=/bin/bash +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== -`configure' recognizes the following options to control how it operates. + `configure' recognizes the following options to control how it +operates. `--help' `-h' - Print a summary of the options to `configure', and exit. + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. `--version' `-V' @@ -231,6 +355,16 @@ configuration-related scripts to be exec Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. Modified: head/contrib/sqlite3/Makefile.in ============================================================================== --- head/contrib/sqlite3/Makefile.in Tue Aug 12 02:04:48 2014 (r269850) +++ head/contrib/sqlite3/Makefile.in Tue Aug 12 02:09:00 2014 (r269851) @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,15 +18,29 @@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,56 +55,84 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sqlite3$(EXEEXT) +subdir = . DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \ config.guess config.sub depcomp install-sh ltmain.sh missing -subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno + configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = sqlite3.pc +CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" -libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libsqlite3_la_LIBADD = am_libsqlite3_la_OBJECTS = sqlite3.lo libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +libsqlite3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_sqlite3_OBJECTS = shell.$(OBJEXT) sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) -pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) -includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags @@ -97,16 +140,18 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCE distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -119,57 +164,65 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ -ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -181,6 +234,7 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -208,8 +262,12 @@ program_transform_name = @program_transf psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c @@ -226,21 +284,21 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -256,28 +314,34 @@ $(top_builddir)/config.status: $(top_src $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: @@ -288,39 +352,57 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libsqlite3_la_LDFLAGS) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) +libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) $(EXTRA_libsqlite3_la_DEPENDENCIES) + $(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) $(EXTRA_sqlite3_DEPENDENCIES) @rm -f sqlite3$(EXEEXT) - $(LINK) $(sqlite3_LDFLAGS) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) + $(LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -332,22 +414,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -359,177 +441,215 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-man1: $(man1_MANS) $(man_MANS) + -rm -f libtool config.lt +install-man1: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + uninstall-man1: @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" - @list='$(pkgconfig_DATA)'; for p in $$list; do \ + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ - $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ - done + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; for p in $$list; do \ + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ - $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ - rm -f "$(DESTDIR)$(includedir)/$$f"; \ - done + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 03:18:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C13AC3A9; Tue, 12 Aug 2014 03:18:06 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 82A562A97; Tue, 12 Aug 2014 03:18:06 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id D13B5D409A4; Tue, 12 Aug 2014 13:17:56 +1000 (EST) Date: Tue, 12 Aug 2014 13:17:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r269474 - in head: share/man/man4 sys/dev/vt In-Reply-To: <201408111315.16939.jhb@freebsd.org> Message-ID: <20140812121718.U1185@besplex.bde.org> References: <53de340e.52ce.7073778e@svn.freebsd.org> <20140805091730.N2827@besplex.bde.org> <201408111315.16939.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=9sZAoq1AbeMA:10 a=252g7Ztp5P0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=BvYZXN6Kv6LMIY-lhhQA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 03:18:06 -0000 On Mon, 11 Aug 2014, John Baldwin wrote: > On Monday, August 04, 2014 8:03:58 pm Bruce Evans wrote: >> On Mon, 4 Aug 2014, John Baldwin wrote: >>> I realize the API uses 'SPCL' as an abbreviation, but for user-facing things like a sysctl and tunable, I think it might be better to spell it out as > "specialkeys" instead? >> >> It is a bad name, and also gratuitously different from syscons where the >> names are: >> >> hw.syscons.kbd_reboot >> hw.syscons.kbd_debug >> hw.syscons.sc_no_suspend_vtswitch > > I would prefer individual nodes for vt along these lines as I think it is > clearer to the user ("what exactly constitutes a special key?") But rename them a bit so it is clearer that they give limited access control. The sysctl -d descriptions are no better about this: % hw.syscons.kbd_reboot: enable keyboard reboot % hw.syscons.kbd_debug: enable keyboard debug % hw.syscons.sc_no_suspend_vtswitch: Disable VT switch before suspend. These also have some style bugs ("enable" is not capitalized; the last description is terminated). The option name SC_DISABLE_KDBKEY is better. It more clearly controls a key, not debugging. The option name SC_DISABLE_REBOOT is no better. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 09:07:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7CC61CA; Tue, 12 Aug 2014 09:07:40 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6092E52; Tue, 12 Aug 2014 09:07:40 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s7C97XPw062587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Aug 2014 12:07:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s7C97XPw062587 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s7C97W2b062586; Tue, 12 Aug 2014 12:07:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 Aug 2014 12:07:32 +0300 From: Konstantin Belousov To: Alan Cox Subject: Re: svn commit: r269782 - in head/sys/sparc64: include sparc64 Message-ID: <20140812090732.GC2737@kib.kiev.ua> References: <53e7a4fc.2898.352aa941@svn.freebsd.org> <53E8F0D9.9080900@rice.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+xNpyl7Qekk2NvDX" Content-Disposition: inline In-Reply-To: <53E8F0D9.9080900@rice.edu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 09:07:41 -0000 --+xNpyl7Qekk2NvDX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 11, 2014 at 11:35:37AM -0500, Alan Cox wrote: > On 08/10/2014 11:59, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Aug 10 16:59:39 2014 > > New Revision: 269782 > > URL: http://svnweb.freebsd.org/changeset/base/269782 > > > > Log: > > On sparc64, do not keep mappings for the destroyed sf_bufs. Sparc64 > > pmap, unlike i386, and similar to i386/xen pv, does not tolerate > > abandoned mappings for the freed pages. > > =20 > > Reported and tested by: dumbbell > > Diagnosed and reviewed by: alc > > Sponsored by: The FreeBSD Foundation >=20 >=20 > This change fixes things on sparc64, but there is also an opportunity > here to make sf_buf operations much faster on newer sparc64 hardware.=20 > If someone is interested in doing this, then please e-mail me.=20 > Basically, if dcache_color_ignore is non-zero, then sparc64's direct map > can be used. It shouldn't be a difficult change. The following patch should implement use of dcache_color_ignore, like hw_direct_map on powerpc aim. I did not found a way around the machine/tlb.h hack. The patch compiled on ppc64 and sparc64. diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h index c46f395..965f8e4 100644 --- a/sys/powerpc/include/vmparam.h +++ b/sys/powerpc/include/vmparam.h @@ -210,5 +210,6 @@ struct pmap_physseg { #define SFBUF #define SFBUF_NOMD #define SFBUF_OPTIONAL_DIRECT_MAP hw_direct_map +#define SFBUF_PHYS_DMAP(x) (x) =20 #endif /* _MACHINE_VMPARAM_H_ */ diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h index 8e7d76c..cc97ade 100644 --- a/sys/sparc64/include/vmparam.h +++ b/sys/sparc64/include/vmparam.h @@ -241,5 +241,8 @@ extern vm_offset_t vm_max_kernel_address; =20 #define SFBUF #define SFBUF_MAP +#define SFBUF_OPTIONAL_DIRECT_MAP dcache_color_ignore +#include +#define SFBUF_PHYS_DMAP(x) TLB_DIRECT_TO_PHYS(x) =20 #endif /* !_MACHINE_VMPARAM_H_ */ diff --git a/sys/sys/sf_buf.h b/sys/sys/sf_buf.h index 8a6c56f..de164a1 100644 --- a/sys/sys/sf_buf.h +++ b/sys/sys/sf_buf.h @@ -112,7 +112,7 @@ sf_buf_kva(struct sf_buf *sf) { #ifdef SFBUF_OPTIONAL_DIRECT_MAP if (SFBUF_OPTIONAL_DIRECT_MAP) - return (VM_PAGE_TO_PHYS((vm_page_t)sf)); + return (SFBUF_PHYS_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); #endif =20 return (sf->kva); --+xNpyl7Qekk2NvDX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT6dlUAAoJEJDCuSvBvK1Bu8kP+gIjsYUdftvk7YMY7moi4Pf7 FLY6+SOAi5ZlGNvyPXTVi/yeca73Vz15YSU1aS3X6LQXOLhX3CJ1EI39X/kSDMHc Q3gxhu4ICxRvonX19ygUS1ET1clV8J32eSbDC1AVVAzqq5eunkSzAjFnFUSSqvwx YChm8V3ZvnNR/4vCMc0NcpRu0L4ljWQzlj3WT5Zr66MayrJw37yTbLm1XfnZS70H jdWneJ81FnUhDLHdK3XoPWwFFlhixZnA0NX5QwYATFD7Uw3VZDz5RTNJPXaj81l6 UCu5nyiBBeYGJkgWFFn2XWu5s9PHng1UNMs5hYopUBH3qQx4wWCM2rVq4bEQiLhS jKDKjZPaQlvfpCO2Cwiby5UWNTguNW/exegyaSCVbom60h1PUHR315tv9wkQs8NK dlDWuDXVFFP64kTTkqIid+i873qRA1/9v2Qa7s5Rotz4clGoS1iAjWrnaQjyj/TF C+eSFVNLVXEg31HgENpzuLCWwv98JA3L66E0aPldL0QAPMsCRhTjlivQl45nRTXj Fj/ioMJPEjYKbBXyw8sr02Y97nHcftGuNo2G8KTwGL5IA31ipDevHEJaTZR06kj8 pqogwbrhT59peTAUG0V++uhZt2D7ehZkVJosZcLbO/a3rsc4YcgvKGKEZvXW/oFg pf8Igfi2TVpOtjj4GV4e =6B2s -----END PGP SIGNATURE----- --+xNpyl7Qekk2NvDX-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 09:10:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB3E94DD for ; Tue, 12 Aug 2014 09:10:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 801B62E76 for ; Tue, 12 Aug 2014 09:10:14 +0000 (UTC) Received: from ae (uid 1226) (envelope-from ae@FreeBSD.org) id 6050 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 09:10:14 +0000 From: Andrey V. Elsukov Date: Tue, 12 Aug 2014 09:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269852 - in head: sbin/geom/class/part sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9d9f6.6050.76e4ac5b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 09:10:14 -0000 Author: ae Date: Tue Aug 12 09:10:13 2014 New Revision: 269852 URL: http://svnweb.freebsd.org/changeset/base/269852 Log: Add sysctl and loader tunable kern.geom.part.mbr.enforce_chs that is set by default. It can be used to disable automatic alignment to CHS geometry, that GEOM_PART_MBR does. Reviewed by: wblock MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part_mbr.c Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue Aug 12 02:09:00 2014 (r269851) +++ head/sbin/geom/class/part/gpart.8 Tue Aug 12 09:10:13 2014 (r269852) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2014 +.Dd August 12, 2014 .Dt GPART 8 .Os .Sh NAME @@ -1183,6 +1183,12 @@ If this variable set to 1 each component present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. +.It Va kern.geom.part.mbr.enforce_chs : No 1 +Specify how the Master Boot Record (MBR) module does alignment. +If this variable is set to a non-zero value, the module will automatically +recalculate the user-specified offset and size for alignment with the CHS +geometry. +Otherwise the values will be left unchanged. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Aug 12 02:09:00 2014 (r269851) +++ head/sys/geom/part/g_part_mbr.c Tue Aug 12 09:10:13 2014 (r269852) @@ -49,6 +49,14 @@ __FBSDID("$FreeBSD$"); FEATURE(geom_part_mbr, "GEOM partitioning class for MBR support"); +SYSCTL_DECL(_kern_geom_part); +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, mbr, CTLFLAG_RW, 0, + "GEOM_PART_MBR Master Boot Record"); + +static u_int enforce_chs = 1; +SYSCTL_UINT(_kern_geom_part_mbr, OID_AUTO, enforce_chs, + CTLFLAG_RWTUN, &enforce_chs, 1, "Enforce alignment to CHS addressing"); + #define MBRSIZE 512 struct g_part_mbr_table { @@ -200,6 +208,8 @@ mbr_align(struct g_part_table *basetable { uint32_t sectors; + if (enforce_chs == 0) + return (0); sectors = basetable->gpt_sectors; if (*size < sectors) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 09:33:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E616CA0 for ; Tue, 12 Aug 2014 09:33:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E96421F4 for ; Tue, 12 Aug 2014 09:33:01 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 69f6 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 09:33:01 +0000 From: Konstantin Belousov Date: Tue, 12 Aug 2014 09:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269853 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9df4d.69f6.3503b168@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 09:33:01 -0000 Author: kib Date: Tue Aug 12 09:33:00 2014 New Revision: 269853 URL: http://svnweb.freebsd.org/changeset/base/269853 Log: Revision r269457 removed the Giant around mount and unmount code, but r269533, which was tested before r269457 was committed, implicitely relied on the Giant to protect the manipulations of the softdepmounts list. Use softdep global lock consistently to guarantee the list structure now. Insert the new struct mount_softdeps into the softdepmounts only after it is sufficiently initialized, to prevent softdep_speedup() from accessing bare memory. Similarly, remove struct mount_softdeps for the unmounted filesystem from the tailq before destroying structure rwlock. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Aug 12 09:10:13 2014 (r269852) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Aug 12 09:33:00 2014 (r269853) @@ -2453,7 +2453,6 @@ softdep_mount(devvp, mp, fs, cred) ump->um_softdep = sdp; MNT_IUNLOCK(mp); rw_init(LOCK_PTR(ump), "Per-Filesystem Softdep Lock"); - TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); sdp->sd_ump = ump; LIST_INIT(&ump->softdep_workitem_pending); LIST_INIT(&ump->softdep_journal_pending); @@ -2479,6 +2478,9 @@ softdep_mount(devvp, mp, fs, cred) ump->indir_hash_size = i - 1; for (i = 0; i <= ump->indir_hash_size; i++) TAILQ_INIT(&ump->indir_hashtbl[i]); + ACQUIRE_GBLLOCK(&lk); + TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); + FREE_GBLLOCK(&lk); if ((fs->fs_flags & FS_SUJ) && (error = journal_mount(mp, fs, cred)) != 0) { printf("Failed to start journal: %d\n", error); @@ -2562,8 +2564,10 @@ softdep_unmount(mp) /* * Free up our resources. */ - rw_destroy(LOCK_PTR(ump)); + ACQUIRE_GBLLOCK(&lk); TAILQ_REMOVE(&softdepmounts, ump->um_softdep, sd_next); + FREE_GBLLOCK(&lk); + rw_destroy(LOCK_PTR(ump)); hashdestroy(ump->pagedep_hashtbl, M_PAGEDEP, ump->pagedep_hash_size); hashdestroy(ump->inodedep_hashtbl, M_INODEDEP, ump->inodedep_hash_size); hashdestroy(ump->newblk_hashtbl, M_NEWBLK, ump->newblk_hash_size); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 09:34:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97D1BE08 for ; Tue, 12 Aug 2014 09:34:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6955D220D for ; Tue, 12 Aug 2014 09:34:53 +0000 (UTC) Received: from ae (uid 1226) (envelope-from ae@FreeBSD.org) id 6a0b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 09:34:53 +0000 From: Andrey V. Elsukov Date: Tue, 12 Aug 2014 09:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269854 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9dfbd.6a0b.74cdab5c@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 09:34:53 -0000 Author: ae Date: Tue Aug 12 09:34:53 2014 New Revision: 269854 URL: http://svnweb.freebsd.org/changeset/base/269854 Log: Remove duplicate entry. Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue Aug 12 09:33:00 2014 (r269853) +++ head/sbin/geom/class/part/gpart.8 Tue Aug 12 09:34:53 2014 (r269854) @@ -659,13 +659,6 @@ Another symbolic names that can be used .Cm gpart utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" -.It Cm apple-boot -An Apple Mac OS X partition dedicated to bootloader. -The scheme-specific types are -.Qq Li "!Apple_Bootstrap" -for APM and -.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac" -for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 10:31:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E356C08 for ; Tue, 12 Aug 2014 10:31:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44AFA27FB for ; Tue, 12 Aug 2014 10:31:32 +0000 (UTC) Received: from ae (uid 1226) (envelope-from ae@FreeBSD.org) id 6a65 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 10:31:32 +0000 From: Andrey V. Elsukov Date: Tue, 12 Aug 2014 10:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269857 - in head: sbin/geom/class/part sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9ed04.6a65.3bc68d43@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 10:31:32 -0000 Author: ae Date: Tue Aug 12 10:31:31 2014 New Revision: 269857 URL: http://svnweb.freebsd.org/changeset/base/269857 Log: Turn off kern.geom.part.mbr.enforce_chs by default. Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part_mbr.c Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue Aug 12 10:22:46 2014 (r269856) +++ head/sbin/geom/class/part/gpart.8 Tue Aug 12 10:31:31 2014 (r269857) @@ -1176,7 +1176,7 @@ If this variable set to 1 each component present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. -.It Va kern.geom.part.mbr.enforce_chs : No 1 +.It Va kern.geom.part.mbr.enforce_chs : No 0 Specify how the Master Boot Record (MBR) module does alignment. If this variable is set to a non-zero value, the module will automatically recalculate the user-specified offset and size for alignment with the CHS Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Aug 12 10:22:46 2014 (r269856) +++ head/sys/geom/part/g_part_mbr.c Tue Aug 12 10:31:31 2014 (r269857) @@ -53,9 +53,9 @@ SYSCTL_DECL(_kern_geom_part); static SYSCTL_NODE(_kern_geom_part, OID_AUTO, mbr, CTLFLAG_RW, 0, "GEOM_PART_MBR Master Boot Record"); -static u_int enforce_chs = 1; +static u_int enforce_chs = 0; SYSCTL_UINT(_kern_geom_part_mbr, OID_AUTO, enforce_chs, - CTLFLAG_RWTUN, &enforce_chs, 1, "Enforce alignment to CHS addressing"); + CTLFLAG_RWTUN, &enforce_chs, 0, "Enforce alignment to CHS addressing"); #define MBRSIZE 512 From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 11:30:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35FA3BD0 for ; Tue, 12 Aug 2014 11:30:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 219262073 for ; Tue, 12 Aug 2014 11:30:20 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 6e09 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 11:30:17 +0000 From: Michael Tuexen Date: Tue, 12 Aug 2014 11:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269858 - in head: lib/libc/net sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9fac9.6e09.1cc546b0@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 11:30:20 -0000 Author: tuexen Date: Tue Aug 12 11:30:16 2014 New Revision: 269858 URL: http://svnweb.freebsd.org/changeset/base/269858 Log: Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED socket options. Add also a sysctl to control the support of ASCONF. MFC after: 1 week Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/lib/libc/net/sctp_sys_calls.c Tue Aug 12 11:30:16 2014 (r269858) @@ -356,6 +356,12 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PR_SUPPORTED: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; + case SCTP_AUTH_SUPPORTED: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; + case SCTP_ASCONF_SUPPORTED: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; case SCTP_RECONFIG_SUPPORTED: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; @@ -590,6 +596,7 @@ sctp_sendmsg(int s, cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); sinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); + memset(sinfo, 0, sizeof(struct sctp_sndrcvinfo)); sinfo->sinfo_stream = stream_no; sinfo->sinfo_ssn = 0; sinfo->sinfo_flags = flags; Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp.h Tue Aug 12 11:30:16 2014 (r269858) @@ -123,9 +123,11 @@ struct sctp_paramhdr { #define SCTP_REMOTE_UDP_ENCAPS_PORT 0x00000024 #define SCTP_ECN_SUPPORTED 0x00000025 #define SCTP_PR_SUPPORTED 0x00000026 -#define SCTP_NRSACK_SUPPORTED 0x00000027 -#define SCTP_PKTDROP_SUPPORTED 0x00000028 +#define SCTP_AUTH_SUPPORTED 0x00000027 +#define SCTP_ASCONF_SUPPORTED 0x00000028 #define SCTP_RECONFIG_SUPPORTED 0x00000029 +#define SCTP_NRSACK_SUPPORTED 0x00000030 +#define SCTP_PKTDROP_SUPPORTED 0x00000031 /* * read-only options Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_asconf.c Tue Aug 12 11:30:16 2014 (r269858) @@ -724,13 +724,11 @@ sctp_handle_asconf(struct mbuf *m, unsig } switch (param_type) { case SCTP_ADD_IP_ADDRESS: - asoc->peer_supports_asconf = 1; m_result = sctp_process_asconf_add_ip(src, aph, stcb, (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); cnt++; break; case SCTP_DEL_IP_ADDRESS: - asoc->peer_supports_asconf = 1; m_result = sctp_process_asconf_delete_ip(src, aph, stcb, error); break; @@ -738,7 +736,6 @@ sctp_handle_asconf(struct mbuf *m, unsig /* not valid in an ASCONF chunk */ break; case SCTP_SET_PRIM_ADDR: - asoc->peer_supports_asconf = 1; m_result = sctp_process_asconf_set_primary(src, aph, stcb, error); break; @@ -930,8 +927,6 @@ sctp_addr_match(struct sctp_paramhdr *ph void sctp_asconf_cleanup(struct sctp_tcb *stcb, struct sctp_nets *net) { - /* mark peer as ASCONF incapable */ - stcb->asoc.peer_supports_asconf = 0; /* * clear out any existing asconfs going out */ @@ -1340,7 +1335,7 @@ sctp_asconf_queue_add(struct sctp_tcb *s int pending_delete_queued = 0; /* see if peer supports ASCONF */ - if (stcb->asoc.peer_supports_asconf == 0) { + if (stcb->asoc.asconf_supported == 0) { return (-1); } /* @@ -1430,7 +1425,7 @@ sctp_asconf_queue_sa_delete(struct sctp_ return (-1); } /* see if peer supports ASCONF */ - if (stcb->asoc.peer_supports_asconf == 0) { + if (stcb->asoc.asconf_supported == 0) { return (-1); } /* make sure the request isn't already in the queue */ @@ -1550,7 +1545,7 @@ sctp_asconf_find_param(struct sctp_tcb * * notifications based on the error response */ static void -sctp_asconf_process_error(struct sctp_tcb *stcb, +sctp_asconf_process_error(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_asconf_paramhdr *aph) { struct sctp_error_cause *eh; @@ -1588,10 +1583,7 @@ sctp_asconf_process_error(struct sctp_tc switch (param_type) { case SCTP_ADD_IP_ADDRESS: case SCTP_DEL_IP_ADDRESS: - stcb->asoc.peer_supports_asconf = 0; - break; case SCTP_SET_PRIM_ADDR: - stcb->asoc.peer_supports_asconf = 0; break; default: break; @@ -1627,8 +1619,6 @@ sctp_asconf_process_param_ack(struct sct SCTPDBG(SCTP_DEBUG_ASCONF1, "process_param_ack: set primary IP address\n"); /* nothing to do... peer may start using this addr */ - if (flag == 0) - stcb->asoc.peer_supports_asconf = 0; break; default: /* should NEVER happen */ @@ -1646,11 +1636,11 @@ sctp_asconf_process_param_ack(struct sct * cleanup from a bad asconf ack parameter */ static void -sctp_asconf_ack_clear(struct sctp_tcb *stcb) +sctp_asconf_ack_clear(struct sctp_tcb *stcb SCTP_UNUSED) { /* assume peer doesn't really know how to do asconfs */ - stcb->asoc.peer_supports_asconf = 0; /* XXX we could free the pending queue here */ + } void @@ -1988,7 +1978,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * /* queue an asconf for this address add/delete */ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* does the peer do asconf? */ - if (stcb->asoc.peer_supports_asconf) { + if (stcb->asoc.asconf_supported) { /* queue an asconf for this addr */ status = sctp_asconf_queue_add(stcb, ifa, type); @@ -2238,7 +2228,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } /* queue an asconf for this address add/delete */ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_DO_ASCONF) && - stcb->asoc.peer_supports_asconf) { + stcb->asoc.asconf_supported == 1) { /* queue an asconf for this addr */ status = sctp_asconf_queue_add(stcb, ifa, type); /* @@ -2886,7 +2876,7 @@ sctp_process_initack_addresses(struct sc /* are ASCONFs allowed ? */ if ((sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DO_ASCONF)) && - stcb->asoc.peer_supports_asconf) { + stcb->asoc.asconf_supported) { /* queue an ASCONF DEL_IP_ADDRESS */ status = sctp_asconf_queue_sa_delete(stcb, sa); /* Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_auth.c Tue Aug 12 11:30:16 2014 (r269858) @@ -133,11 +133,6 @@ sctp_auth_delete_chunk(uint8_t chunk, sc if (list == NULL) return (-1); - /* is chunk restricted? */ - if ((chunk == SCTP_ASCONF) || - (chunk == SCTP_ASCONF_ACK)) { - return (-1); - } if (list->chunks[chunk] == 1) { list->chunks[chunk] = 0; list->num_chunks--; @@ -158,16 +153,6 @@ sctp_auth_get_chklist_size(const sctp_au } /* - * set the default list of chunks requiring AUTH - */ -void -sctp_auth_set_default_chunks(sctp_auth_chklist_t * list) -{ - (void)sctp_auth_add_chunk(SCTP_ASCONF, list); - (void)sctp_auth_add_chunk(SCTP_ASCONF_ACK, list); -} - -/* * return the current number and list of required chunks caller must * guarantee ptr has space for up to 256 bytes */ Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_auth.h Tue Aug 12 11:30:16 2014 (r269858) @@ -112,7 +112,6 @@ extern sctp_auth_chklist_t *sctp_copy_ch extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list); extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list); extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list); -extern void sctp_auth_set_default_chunks(sctp_auth_chklist_t * list); extern int sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_input.c Tue Aug 12 11:30:16 2014 (r269858) @@ -480,7 +480,7 @@ sctp_process_init_ack(struct mbuf *m, in return (-1); } /* if the peer doesn't support asconf, flush the asconf queue */ - if (asoc->peer_supports_asconf == 0) { + if (asoc->asconf_supported == 0) { struct sctp_asconf_addr *param, *nparam; TAILQ_FOREACH_SAFE(param, &asoc->asconf_queue, next, nparam) { @@ -756,7 +756,7 @@ sctp_handle_nat_missing_state(struct sct * return 0 means we want you to proceed with the abort non-zero * means no abort processing */ - if (stcb->asoc.peer_supports_auth == 0) { + if (stcb->asoc.auth_supported == 0) { SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_nat_missing_state: Peer does not support AUTH, cannot send an asconf\n"); return (0); } @@ -1096,6 +1096,7 @@ sctp_process_unrecog_chunk(struct sctp_t * Skip past the param header and then we will find the param that caused the * problem. There are a number of param's in a ASCONF OR the prsctp param * these will turn of specific features. + * XXX: Is this the right thing to do? */ static void sctp_process_unrecog_param(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr) @@ -1117,14 +1118,14 @@ sctp_process_unrecog_param(struct sctp_t case SCTP_ADD_IP_ADDRESS: case SCTP_DEL_IP_ADDRESS: case SCTP_SET_PRIM_ADDR: - stcb->asoc.peer_supports_asconf = 0; + stcb->asoc.asconf_supported = 0; break; case SCTP_SUCCESS_REPORT: case SCTP_ERROR_CAUSE_IND: SCTPDBG(SCTP_DEBUG_INPUT2, "Huh, the peer does not support success? or error cause?\n"); SCTPDBG(SCTP_DEBUG_INPUT2, "Turning off ASCONF to this strange peer\n"); - stcb->asoc.peer_supports_asconf = 0; + stcb->asoc.asconf_supported = 0; break; default: SCTPDBG(SCTP_DEBUG_INPUT2, @@ -2787,6 +2788,8 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; + inp->auth_supported = (*inp_p)->auth_supported; + inp->asconf_supported = (*inp_p)->asconf_supported; inp->reconfig_supported = (*inp_p)->reconfig_supported; inp->nrsack_supported = (*inp_p)->nrsack_supported; inp->pktdrop_supported = (*inp_p)->pktdrop_supported; @@ -2966,7 +2969,7 @@ sctp_handle_cookie_ack(struct sctp_cooki * in flight) */ if ((sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DO_ASCONF)) && - (stcb->asoc.peer_supports_asconf) && + (stcb->asoc.asconf_supported == 1) && (!TAILQ_EMPTY(&stcb->asoc.asconf_queue))) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, @@ -4439,7 +4442,7 @@ __attribute__((noinline)) */ if ((ch->chunk_type == SCTP_AUTHENTICATION) && (stcb == NULL) && - !SCTP_BASE_SYSCTL(sctp_auth_disable)) { + (inp->auth_supported == 1)) { /* save this chunk for later processing */ auth_skipped = 1; auth_offset = *offset; @@ -4706,7 +4709,7 @@ process_control_chunks: /* check to see if this chunk required auth, but isn't */ if ((stcb != NULL) && - !SCTP_BASE_SYSCTL(sctp_auth_disable) && + (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(ch->chunk_type, stcb->asoc.local_auth_chunks) && !stcb->asoc.authenticated) { /* "silently" ignore */ @@ -5225,6 +5228,9 @@ process_control_chunks: return (NULL); } if (stcb) { + if (stcb->asoc.ecn_supported == 0) { + goto unknown_chunk; + } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, stcb->asoc.overall_error_count, @@ -5250,6 +5256,9 @@ process_control_chunks: return (NULL); } if (stcb) { + if (stcb->asoc.ecn_supported == 0) { + goto unknown_chunk; + } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, stcb->asoc.overall_error_count, @@ -5283,6 +5292,9 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF\n"); /* He's alive so give him credit */ if (stcb) { + if (stcb->asoc.asconf_supported == 0) { + goto unknown_chunk; + } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, stcb->asoc.overall_error_count, @@ -5307,6 +5319,9 @@ process_control_chunks: return (NULL); } if ((stcb) && netp && *netp) { + if (stcb->asoc.asconf_supported == 0) { + goto unknown_chunk; + } /* He's alive so give him credit */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, @@ -5336,6 +5351,9 @@ process_control_chunks: if (stcb) { int abort_flag = 0; + if (stcb->asoc.prsctp_supported == 0) { + goto unknown_chunk; + } stcb->asoc.overall_error_count = 0; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, @@ -5391,12 +5409,7 @@ process_control_chunks: return (NULL); } if (stcb->asoc.reconfig_supported == 0) { - /* - * hmm, peer should have announced this, but - * we will turn it on since he is sending us - * a stream reset. - */ - stcb->asoc.reconfig_supported = 1; + goto unknown_chunk; } if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ @@ -5416,18 +5429,17 @@ process_control_chunks: return (NULL); } if (ch && (stcb) && netp && (*netp)) { + if (stcb->asoc.pktdrop_supported == 0) { + goto unknown_chunk; + } sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, min(chk_length, (sizeof(chunk_buf) - 4))); } break; - case SCTP_AUTHENTICATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_AUTHENTICATION\n"); - if (SCTP_BASE_SYSCTL(sctp_auth_disable)) - goto unknown_chunk; - if (stcb == NULL) { /* save the first AUTH for later processing */ if (auth_skipped == 0) { @@ -5438,6 +5450,9 @@ process_control_chunks: /* skip this chunk (temporarily) */ goto next_chunk; } + if (stcb->asoc.auth_supported == 0) { + goto unknown_chunk; + } if ((chk_length < (sizeof(struct sctp_auth_chunk))) || (chk_length > (sizeof(struct sctp_auth_chunk) + SCTP_AUTH_DIGEST_LEN_MAX))) { @@ -5778,7 +5793,7 @@ sctp_common_input_processing(struct mbuf * chunks */ if ((stcb != NULL) && - !SCTP_BASE_SYSCTL(sctp_auth_disable) && + (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); @@ -5820,7 +5835,7 @@ sctp_common_input_processing(struct mbuf */ if ((length > offset) && (stcb != NULL) && - !SCTP_BASE_SYSCTL(sctp_auth_disable) && + (stcb->asoc.auth_supported == 1) && sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks) && !stcb->asoc.authenticated) { /* "silently" ignore */ Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_output.c Tue Aug 12 11:30:16 2014 (r269858) @@ -4753,12 +4753,6 @@ sctp_send_initiate(struct sctp_inpcb *in } chunk_len = (uint16_t) sizeof(struct sctp_init_chunk); padding_len = 0; - /* - * assume peer supports asconf in order to be able to queue local - * address changes while an INIT is in flight and before the assoc - * is established. - */ - stcb->asoc.peer_supports_asconf = 1; /* Now lets put the chunk header in place */ init = mtod(m, struct sctp_init_chunk *); /* now the chunk header */ @@ -4811,31 +4805,34 @@ sctp_send_initiate(struct sctp_inpcb *in /* And now tell the peer which extensions we support */ num_ext = 0; pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); - pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT); - pr_supported->chunk_types[num_ext++] = SCTP_ASCONF; - pr_supported->chunk_types[num_ext++] = SCTP_ASCONF_ACK; if (stcb->asoc.prsctp_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_FORWARD_CUM_TSN; } - if (stcb->asoc.pktdrop_supported == 1) { - pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + if (stcb->asoc.auth_supported == 1) { + pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; + } + if (stcb->asoc.asconf_supported == 1) { + pr_supported->chunk_types[num_ext++] = SCTP_ASCONF; + pr_supported->chunk_types[num_ext++] = SCTP_ASCONF_ACK; } if (stcb->asoc.reconfig_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; } - if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { - pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; - } if (stcb->asoc.nrsack_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } - parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; - pr_supported->ph.param_length = htons(parameter_len); - padding_len = SCTP_SIZE32(parameter_len) - parameter_len; - chunk_len += parameter_len; - + if (stcb->asoc.pktdrop_supported == 1) { + pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + } + if (num_ext > 0) { + parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; + pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT); + pr_supported->ph.param_length = htons(parameter_len); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; + } /* add authentication parameters */ - if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { + if (stcb->asoc.auth_supported) { /* attach RANDOM parameter, if available */ if (stcb->asoc.authinfo.random != NULL) { struct sctp_auth_random *randp; @@ -4853,8 +4850,7 @@ sctp_send_initiate(struct sctp_inpcb *in chunk_len += parameter_len; } /* add HMAC_ALGO parameter */ - if ((stcb->asoc.local_hmacs != NULL) && - (stcb->asoc.local_hmacs->num_algo > 0)) { + if (stcb->asoc.local_hmacs != NULL) { struct sctp_auth_hmac_algo *hmacs; if (padding_len > 0) { @@ -4872,7 +4868,7 @@ sctp_send_initiate(struct sctp_inpcb *in chunk_len += parameter_len; } /* add CHUNKS parameter */ - if (sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks) > 0) { + if (stcb->asoc.local_auth_chunks != NULL) { struct sctp_auth_chunk_list *chunks; if (padding_len > 0) { @@ -5917,35 +5913,41 @@ do_a_abort: /* And now tell the peer which extensions we support */ num_ext = 0; pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); - pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT); - pr_supported->chunk_types[num_ext++] = SCTP_ASCONF; - pr_supported->chunk_types[num_ext++] = SCTP_ASCONF_ACK; if (((asoc != NULL) && (asoc->prsctp_supported == 1)) || ((asoc == NULL) && (inp->prsctp_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_FORWARD_CUM_TSN; } - if (((asoc != NULL) && (asoc->pktdrop_supported == 1)) || - ((asoc == NULL) && (inp->pktdrop_supported == 1))) { - pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + if (((asoc != NULL) && (asoc->auth_supported == 1)) || + ((asoc == NULL) && (inp->auth_supported == 1))) { + pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; + } + if (((asoc != NULL) && (asoc->asconf_supported == 1)) || + ((asoc == NULL) && (inp->asconf_supported == 1))) { + pr_supported->chunk_types[num_ext++] = SCTP_ASCONF; + pr_supported->chunk_types[num_ext++] = SCTP_ASCONF_ACK; } if (((asoc != NULL) && (asoc->reconfig_supported == 1)) || ((asoc == NULL) && (inp->reconfig_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; } - if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { - pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; - } if (((asoc != NULL) && (asoc->nrsack_supported == 1)) || ((asoc == NULL) && (inp->nrsack_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } - parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; - pr_supported->ph.param_length = htons(parameter_len); - padding_len = SCTP_SIZE32(parameter_len) - parameter_len; - chunk_len += parameter_len; - + if (((asoc != NULL) && (asoc->pktdrop_supported == 1)) || + ((asoc == NULL) && (inp->pktdrop_supported == 1))) { + pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + } + if (num_ext > 0) { + parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; + pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT); + pr_supported->ph.param_length = htons(parameter_len); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; + } /* add authentication parameters */ - if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { + if (((asoc != NULL) && (asoc->auth_supported == 1)) || + ((asoc == NULL) && (inp->auth_supported == 1))) { struct sctp_auth_random *randp; struct sctp_auth_hmac_algo *hmacs; struct sctp_auth_chunk_list *chunks; @@ -7806,7 +7808,6 @@ sctp_med_chunk_output(struct sctp_inpcb *num_out = 0; auth_keyid = stcb->asoc.authinfo.active_keyid; - if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED) || (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { @@ -13417,12 +13418,7 @@ sctp_add_auth_chunk(struct mbuf *m, stru (stcb == NULL)) return (m); - /* sysctl disabled auth? */ - if (SCTP_BASE_SYSCTL(sctp_auth_disable)) - return (m); - - /* peer doesn't do auth... */ - if (!stcb->asoc.peer_supports_auth) { + if (stcb->asoc.auth_supported == 0) { return (m); } /* does the requested chunk require auth? */ Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_pcb.c Tue Aug 12 11:30:16 2014 (r269858) @@ -2485,6 +2485,12 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); + if (SCTP_BASE_SYSCTL(sctp_auth_disable)) { + inp->auth_supported = 0; + } else { + inp->auth_supported = 1; + } + inp->asconf_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_asconf_enable); inp->reconfig_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_reconfig_enable); inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable); inp->pktdrop_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pktdrop_enable); @@ -2651,12 +2657,15 @@ sctp_inpcb_alloc(struct socket *so, uint */ m->local_hmacs = sctp_default_supported_hmaclist(); m->local_auth_chunks = sctp_alloc_chunklist(); + if (inp->asconf_supported) { + sctp_auth_add_chunk(SCTP_ASCONF, m->local_auth_chunks); + sctp_auth_add_chunk(SCTP_ASCONF_ACK, m->local_auth_chunks); + } m->default_dscp = 0; #ifdef INET6 m->default_flowlabel = 0; #endif m->port = 0; /* encapsulation disabled by default */ - sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ null_key = sctp_alloc_sharedkey(); @@ -6085,11 +6094,14 @@ sctp_load_addresses_from_init(struct sct sctp_key_t *new_key; uint32_t keylen; int got_random = 0, got_hmacs = 0, got_chklist = 0; - uint8_t ecn_supported; - uint8_t prsctp_supported; - uint8_t reconfig_supported; - uint8_t nrsack_supported; - uint8_t pktdrop_supported; + uint8_t peer_supports_ecn; + uint8_t peer_supports_prsctp; + uint8_t peer_supports_auth; + uint8_t peer_supports_asconf; + uint8_t peer_supports_asconf_ack; + uint8_t peer_supports_reconfig; + uint8_t peer_supports_nrsack; + uint8_t peer_supports_pktdrop; #ifdef INET struct sockaddr_in sin; @@ -6118,11 +6130,14 @@ sctp_load_addresses_from_init(struct sct } else { sa = src; } - ecn_supported = 0; - prsctp_supported = 0; - reconfig_supported = 0; - nrsack_supported = 0; - pktdrop_supported = 0; + peer_supports_ecn = 0; + peer_supports_prsctp = 0; + peer_supports_auth = 0; + peer_supports_asconf = 0; + peer_supports_asconf = 0; + peer_supports_reconfig = 0; + peer_supports_nrsack = 0; + peer_supports_pktdrop = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { /* mark all addresses that we have currently on the list */ net->dest_state |= SCTP_ADDR_NOT_IN_ASSOC; @@ -6172,12 +6187,6 @@ sctp_load_addresses_from_init(struct sct /* the assoc was freed? */ return (-4); } - /* - * peer must explicitly turn this on. This may have been initialized - * to be "on" in order to allow local addr changes while INIT's are - * in flight. - */ - stcb->asoc.peer_supports_asconf = 0; /* now we must go through each of the params. */ phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); while (phdr) { @@ -6371,7 +6380,7 @@ sctp_load_addresses_from_init(struct sct } else #endif if (ptype == SCTP_ECN_CAPABLE) { - ecn_supported = 1; + peer_supports_ecn = 1; } else if (ptype == SCTP_ULP_ADAPTATION) { if (stcb->asoc.state != SCTP_STATE_OPEN) { struct sctp_adaptation_layer_indication ai, @@ -6395,7 +6404,9 @@ sctp_load_addresses_from_init(struct sct #endif - stcb->asoc.peer_supports_asconf = 1; + if (stcb->asoc.asconf_supported == 0) { + return (-100); + } if (plen > sizeof(lstore)) { return (-23); } @@ -6447,7 +6458,7 @@ sctp_load_addresses_from_init(struct sct stcb->asoc.peer_supports_nat = 1; } else if (ptype == SCTP_PRSCTP_SUPPORTED) { /* Peer supports pr-sctp */ - prsctp_supported = 1; + peer_supports_prsctp = 1; } else if (ptype == SCTP_SUPPORTED_CHUNK_EXT) { /* A supported extension chunk */ struct sctp_supported_chunk_types_param *pr_supported; @@ -6459,30 +6470,29 @@ sctp_load_addresses_from_init(struct sct if (phdr == NULL) { return (-25); } - stcb->asoc.peer_supports_asconf = 0; - stcb->asoc.peer_supports_auth = 0; pr_supported = (struct sctp_supported_chunk_types_param *)phdr; num_ent = plen - sizeof(struct sctp_paramhdr); for (i = 0; i < num_ent; i++) { switch (pr_supported->chunk_types[i]) { case SCTP_ASCONF: + peer_supports_asconf = 1; case SCTP_ASCONF_ACK: - stcb->asoc.peer_supports_asconf = 1; + peer_supports_asconf_ack = 1; break; case SCTP_FORWARD_CUM_TSN: - prsctp_supported = 1; + peer_supports_prsctp = 1; break; case SCTP_PACKET_DROPPED: - pktdrop_supported = 1; + peer_supports_pktdrop = 1; break; case SCTP_NR_SELECTIVE_ACK: - nrsack_supported = 1; + peer_supports_nrsack = 1; break; case SCTP_STREAM_RESET: - reconfig_supported = 1; + peer_supports_reconfig = 1; break; case SCTP_AUTHENTICATION: - stcb->asoc.peer_supports_auth = 1; + peer_supports_auth = 1; break; default: /* one I have not learned yet */ @@ -6619,25 +6629,47 @@ next_param: } } } - stcb->asoc.ecn_supported &= ecn_supported; - stcb->asoc.prsctp_supported &= prsctp_supported; - stcb->asoc.reconfig_supported &= reconfig_supported; - stcb->asoc.nrsack_supported &= nrsack_supported; - stcb->asoc.pktdrop_supported &= pktdrop_supported; - /* validate authentication required parameters */ - if (got_random && got_hmacs) { - stcb->asoc.peer_supports_auth = 1; - } else { - stcb->asoc.peer_supports_auth = 0; + if ((stcb->asoc.ecn_supported == 1) && + (peer_supports_ecn == 0)) { + stcb->asoc.ecn_supported = 0; + } + if ((stcb->asoc.prsctp_supported == 1) && + (peer_supports_prsctp == 0)) { + stcb->asoc.prsctp_supported = 0; + } + if ((stcb->asoc.auth_supported == 1) && + ((peer_supports_auth == 0) || + (got_random == 0) || (got_hmacs == 0))) { + stcb->asoc.auth_supported = 0; + } + if ((stcb->asoc.asconf_supported == 1) && + ((peer_supports_asconf == 0) || (peer_supports_asconf_ack == 0) || + (stcb->asoc.auth_supported == 0) || + (saw_asconf == 0) || (saw_asconf_ack == 0))) { + stcb->asoc.asconf_supported = 0; + } + if ((stcb->asoc.reconfig_supported == 1) && + (peer_supports_reconfig == 0)) { + stcb->asoc.reconfig_supported = 0; + } + if ((stcb->asoc.nrsack_supported == 1) && + (peer_supports_nrsack == 0)) { + stcb->asoc.nrsack_supported = 0; + } + if ((stcb->asoc.pktdrop_supported == 1) && + (peer_supports_pktdrop == 0)) { + stcb->asoc.pktdrop_supported = 0; } - if (!stcb->asoc.peer_supports_auth && got_chklist) { + /* validate authentication required parameters */ + if ((peer_supports_auth == 0) && (got_chklist == 1)) { /* peer does not support auth but sent a chunks list? */ return (-31); } - if (stcb->asoc.peer_supports_asconf && !stcb->asoc.peer_supports_auth) { + if ((peer_supports_asconf == 1) && (peer_supports_auth == 0)) { /* peer supports asconf but not auth? */ return (-32); - } else if ((stcb->asoc.peer_supports_asconf) && (stcb->asoc.peer_supports_auth) && + } else if ((peer_supports_asconf == 1) && + (peer_supports_auth == 1) && ((saw_asconf == 0) || (saw_asconf_ack == 0))) { return (-33); } Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_pcb.h Tue Aug 12 11:30:16 2014 (r269858) @@ -408,6 +408,8 @@ struct sctp_inpcb { uint32_t sctp_cmt_on_off; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t auth_supported; + uint8_t asconf_supported; uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_peeloff.c Tue Aug 12 11:30:16 2014 (r269858) @@ -120,6 +120,8 @@ sctp_do_peeloff(struct socket *head, str n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->ecn_supported = inp->ecn_supported; n_inp->prsctp_supported = inp->prsctp_supported; + n_inp->auth_supported = inp->auth_supported; + n_inp->asconf_supported = inp->asconf_supported; n_inp->reconfig_supported = inp->reconfig_supported; n_inp->nrsack_supported = inp->nrsack_supported; n_inp->pktdrop_supported = inp->pktdrop_supported; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_structs.h Tue Aug 12 11:30:16 2014 (r269858) @@ -1153,6 +1153,8 @@ struct sctp_association { /* Flags whether an extension is supported or not */ uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t auth_supported; + uint8_t asconf_supported; uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; @@ -1160,10 +1162,6 @@ struct sctp_association { /* Did the peer make the stream config (add out) request */ uint8_t peer_req_out; - /* flag to indicate if peer can do asconf */ - uint8_t peer_supports_asconf; - /* peer authentication support flag */ - uint8_t peer_supports_auth; uint8_t local_strreset_support; uint8_t peer_supports_nat; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_sysctl.c Tue Aug 12 11:30:16 2014 (r269858) @@ -55,6 +55,8 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_reconfig_enable) = SCTPCTL_RECONFIG_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pktdrop_enable) = SCTPCTL_PKTDROP_ENABLE_DEFAULT; @@ -90,7 +92,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_use_dac) = SCTPCTL_CMT_USE_DAC_DEFAULT; SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) = SCTPCTL_CWND_MAXBURST_DEFAULT; - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nat_friendly) = SCTPCTL_NAT_FRIENDLY_DEFAULT; SCTP_BASE_SYSCTL(sctp_L2_abc_variable) = SCTPCTL_ABC_L_VAR_DEFAULT; SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) = SCTPCTL_MAX_CHAINED_MBUFS_DEFAULT; @@ -638,7 +639,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_auth_disable), SCTPCTL_AUTH_DISABLE_MIN, SCTPCTL_AUTH_DISABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_L2_abc_variable), SCTPCTL_ABC_L_VAR_MIN, SCTPCTL_ABC_L_VAR_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), SCTPCTL_MAX_CHAINED_MBUFS_MIN, SCTPCTL_MAX_CHAINED_MBUFS_MAX); @@ -677,6 +677,56 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) return (error); } +static int +sysctl_sctp_auth_check(SYSCTL_HANDLER_ARGS) +{ + int error; + + error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); + if (error == 0) { + if (SCTP_BASE_SYSCTL(sctp_auth_disable) < SCTPCTL_AUTH_DISABLE_MIN) { + SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MIN; + } + if (SCTP_BASE_SYSCTL(sctp_auth_disable) > SCTPCTL_AUTH_DISABLE_MAX) { + SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MAX; + } + if ((SCTP_BASE_SYSCTL(sctp_auth_disable) == 1) && + (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1)) { + /* + * You can't disable AUTH with disabling ASCONF + * first + */ + SCTP_BASE_SYSCTL(sctp_auth_disable) = 0; + } + } + return (error); +} + +static int +sysctl_sctp_asconf_check(SYSCTL_HANDLER_ARGS) +{ + int error; + + error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); + if (error == 0) { + if (SCTP_BASE_SYSCTL(sctp_asconf_enable) < SCTPCTL_ASCONF_ENABLE_MIN) { + SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_MIN; + } + if (SCTP_BASE_SYSCTL(sctp_asconf_enable) > SCTPCTL_ASCONF_ENABLE_MAX) { + SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_MAX; + } + if ((SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1) && + (SCTP_BASE_SYSCTL(sctp_auth_disable) == 1)) { + /* + * You can't enable ASCONF without enabling AUTH + * first + */ + SCTP_BASE_SYSCTL(sctp_asconf_enable) = 0; + } + } + return (error); +} + #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) static int sysctl_stat_get(SYSCTL_HANDLER_ARGS) @@ -869,6 +919,14 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_PR_ENABLE_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_auth_check, "IU", + SCTPCTL_AUTH_DISABLE_DESC); + +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_enable, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_asconf_enable), 0, sysctl_sctp_asconf_check, "IU", + SCTPCTL_ASCONF_ENABLE_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, reconfig_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_reconfig_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_RECONFIG_ENABLE_DESC); @@ -1010,10 +1068,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", - SCTPCTL_AUTH_DISABLE_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_sysctl.h Tue Aug 12 11:30:16 2014 (r269858) @@ -46,6 +46,8 @@ struct sctp_sysctl { uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; uint32_t sctp_pr_enable; + uint32_t sctp_auth_disable; + uint32_t sctp_asconf_enable; uint32_t sctp_reconfig_enable; uint32_t sctp_nrsack_enable; uint32_t sctp_pktdrop_enable; @@ -81,7 +83,6 @@ struct sctp_sysctl { uint32_t sctp_cmt_on_off; uint32_t sctp_cmt_use_dac; uint32_t sctp_use_cwnd_based_maxburst; - uint32_t sctp_auth_disable; uint32_t sctp_nat_friendly; uint32_t sctp_L2_abc_variable; uint32_t sctp_mbuf_threshold_count; @@ -162,6 +163,18 @@ struct sctp_sysctl { #define SCTPCTL_PR_ENABLE_MAX 1 #define SCTPCTL_PR_ENABLE_DEFAULT 1 +/* auth_disable: Disable SCTP AUTH function */ +#define SCTPCTL_AUTH_DISABLE_DESC "Disable SCTP AUTH function" +#define SCTPCTL_AUTH_DISABLE_MIN 0 +#define SCTPCTL_AUTH_DISABLE_MAX 1 +#define SCTPCTL_AUTH_DISABLE_DEFAULT 0 + +/* asconf_enable: Enable SCTP ASCONF */ +#define SCTPCTL_ASCONF_ENABLE_DESC "Enable SCTP ASCONF" +#define SCTPCTL_ASCONF_ENABLE_MIN 0 +#define SCTPCTL_ASCONF_ENABLE_MAX 1 +#define SCTPCTL_ASCONF_ENABLE_DEFAULT 1 + /* reconfig_enable: Enable SCTP RE-CONFIG */ #define SCTPCTL_RECONFIG_ENABLE_DESC "Enable SCTP RE-CONFIG" #define SCTPCTL_RECONFIG_ENABLE_MIN 0 @@ -379,12 +392,6 @@ struct sctp_sysctl { #define SCTPCTL_CWND_MAXBURST_MAX 1 #define SCTPCTL_CWND_MAXBURST_DEFAULT 1 -/* auth_disable: Disable SCTP AUTH function */ -#define SCTPCTL_AUTH_DISABLE_DESC "Disable SCTP AUTH function" -#define SCTPCTL_AUTH_DISABLE_MIN 0 -#define SCTPCTL_AUTH_DISABLE_MAX 1 -#define SCTPCTL_AUTH_DISABLE_DEFAULT 0 - /* nat_friendly: SCTP NAT friendly operation */ #define SCTPCTL_NAT_FRIENDLY_DESC "SCTP NAT friendly operation" #define SCTPCTL_NAT_FRIENDLY_MIN 0 Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Aug 12 10:31:31 2014 (r269857) +++ head/sys/netinet/sctp_usrreq.c Tue Aug 12 11:30:16 2014 (r269858) @@ -3348,6 +3348,60 @@ flags_out: } break; } + case SCTP_AUTH_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.auth_supported; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->auth_supported; + SCTP_INP_RUNLOCK(inp); + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 11:45:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56EB6FFD for ; Tue, 12 Aug 2014 11:45:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4398321A6 for ; Tue, 12 Aug 2014 11:45:58 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 649f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 11:45:58 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 11:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269859 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e9fe76.649f.38b47800@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 11:45:58 -0000 Author: hselasky Date: Tue Aug 12 11:45:57 2014 New Revision: 269859 URL: http://svnweb.freebsd.org/changeset/base/269859 Log: - Fix radix tree memory leakage when unloading modules using radix trees. This happens because the logic inserting items into the radix tree is allocating empty radix levels, when index zero does not contain any items. - Add proper error case handling, so that the radix tree does not end up in a bad state, if memory cannot be allocated during insertion of an item. - Add check for inserting NULL items into the radix tree. - Add check for radix tree getting too big. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/linux_radix.c Modified: head/sys/ofed/include/linux/linux_radix.c ============================================================================== --- head/sys/ofed/include/linux/linux_radix.c Tue Aug 12 11:30:16 2014 (r269858) +++ head/sys/ofed/include/linux/linux_radix.c Tue Aug 12 11:45:57 2014 (r269859) @@ -123,40 +123,84 @@ int radix_tree_insert(struct radix_tree_root *root, unsigned long index, void *item) { struct radix_tree_node *node; + struct radix_tree_node *temp[RADIX_TREE_MAX_HEIGHT - 1]; int height; int idx; - /* - * Expand the tree to fit indexes as big as requested. - */ - while (root->rnode == NULL || radix_max(root) < index) { + /* bail out upon insertion of a NULL item */ + if (item == NULL) + return (-EINVAL); + + /* get root node, if any */ + node = root->rnode; + + /* allocate root node, if any */ + if (node == NULL) { node = malloc(sizeof(*node), M_RADIX, root->gfp_mask | M_ZERO); if (node == NULL) return (-ENOMEM); - node->slots[0] = root->rnode; - if (root->rnode) - node->count++; root->rnode = node; root->height++; } - node = root->rnode; - height = root->height - 1; - /* - * Walk down the tree finding the correct node and allocating any - * missing nodes along the way. - */ - while (height) { - idx = radix_pos(index, height); - if (node->slots[idx] == NULL) { - node->slots[idx] = malloc(sizeof(*node), M_RADIX, - root->gfp_mask | M_ZERO); - if (node->slots[idx] == NULL) + + /* expand radix tree as needed */ + while (radix_max(root) < index) { + + /* check if the radix tree is getting too big */ + if (root->height == RADIX_TREE_MAX_HEIGHT) + return (-E2BIG); + + /* + * If the root radix level is not empty, we need to + * allocate a new radix level: + */ + if (node->count != 0) { + node = malloc(sizeof(*node), M_RADIX, root->gfp_mask | M_ZERO); + if (node == NULL) return (-ENOMEM); + node->slots[0] = root->rnode; node->count++; + root->rnode = node; } + root->height++; + } + + /* get radix tree height index */ + height = root->height - 1; + + /* walk down the tree until the first missing node, if any */ + for ( ; height != 0; height--) { + idx = radix_pos(index, height); + if (node->slots[idx] == NULL) + break; + node = node->slots[idx]; + } + + /* allocate the missing radix levels, if any */ + for (idx = 0; idx != height; idx++) { + temp[idx] = malloc(sizeof(*node), M_RADIX, + root->gfp_mask | M_ZERO); + if (temp[idx] == NULL) { + while(idx--) + free(temp[idx], M_RADIX); + /* check if we should free the root node aswell */ + if (root->rnode->count == 0) { + free(root->rnode, M_RADIX); + root->rnode = NULL; + root->height = 0; + } + return (-ENOMEM); + } + } + + /* setup new radix levels, if any */ + for ( ; height != 0; height--) { + idx = radix_pos(index, height); + node->slots[idx] = temp[height - 1]; + node->count++; node = node->slots[idx]; - height--; } + /* * Insert and adjust count if the item does not already exist. */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:06:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7055C9E3 for ; Tue, 12 Aug 2014 12:06:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51AB62500 for ; Tue, 12 Aug 2014 12:06:22 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 6b2e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:06:22 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 12:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269860 - stable/10/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea033e.6b2e.2182b9e@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:06:22 -0000 Author: hselasky Date: Tue Aug 12 12:06:21 2014 New Revision: 269860 URL: http://svnweb.freebsd.org/changeset/base/269860 Log: MFC r268314: Fix some compile warnings. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/qp.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Tue Aug 12 11:45:57 2014 (r269859) +++ stable/10/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Tue Aug 12 12:06:21 2014 (r269860) @@ -264,7 +264,7 @@ static void post_nop_wqe(struct mlx4_ib_ /* Pad the remainder of the WQE with an inline data segment. */ if (size > s) { inl = wqe + s; - inl->byte_count = cpu_to_be32(1 << 31 | (size - s - sizeof *inl)); + inl->byte_count = cpu_to_be32(1U << 31 | (size - s - sizeof *inl)); } ctrl->srcrb_flags = 0; ctrl->fence_size = size / 16; @@ -1146,7 +1146,7 @@ static void mlx4_ib_lock_cqs(struct mlx4 { if (send_cq == recv_cq) { spin_lock_irq(&send_cq->lock); - __acquire(&recv_cq->lock); + (void) __acquire(&recv_cq->lock); } else if (send_cq->mcq.cqn < recv_cq->mcq.cqn) { spin_lock_irq(&send_cq->lock); spin_lock_nested(&recv_cq->lock, SINGLE_DEPTH_NESTING); @@ -1160,7 +1160,7 @@ static void mlx4_ib_unlock_cqs(struct ml __releases(&send_cq->lock) __releases(&recv_cq->lock) { if (send_cq == recv_cq) { - __release(&recv_cq->lock); + (void) __release(&recv_cq->lock); spin_unlock_irq(&send_cq->lock); } else if (send_cq->mcq.cqn < recv_cq->mcq.cqn) { spin_unlock(&recv_cq->lock); @@ -2422,11 +2422,11 @@ static int build_sriov_qp0_header(struct spc = MLX4_INLINE_ALIGN - ((unsigned long) (inl + 1) & (MLX4_INLINE_ALIGN - 1)); if (header_size <= spc) { - inl->byte_count = cpu_to_be32(1 << 31 | header_size); + inl->byte_count = cpu_to_be32(1U << 31 | header_size); memcpy(inl + 1, sqp->header_buf, header_size); i = 1; } else { - inl->byte_count = cpu_to_be32(1 << 31 | spc); + inl->byte_count = cpu_to_be32(1U << 31 | spc); memcpy(inl + 1, sqp->header_buf, spc); inl = (void *) (inl + 1) + spc; @@ -2445,7 +2445,7 @@ static int build_sriov_qp0_header(struct * of 16 mod 64. */ wmb(); - inl->byte_count = cpu_to_be32(1 << 31 | (header_size - spc)); + inl->byte_count = cpu_to_be32(1U << 31 | (header_size - spc)); i = 2; } @@ -2629,11 +2629,11 @@ static int build_mlx_header(struct mlx4_ spc = MLX4_INLINE_ALIGN - ((unsigned long) (inl + 1) & (MLX4_INLINE_ALIGN - 1)); if (header_size <= spc) { - inl->byte_count = cpu_to_be32(1 << 31 | header_size); + inl->byte_count = cpu_to_be32(1U << 31 | header_size); memcpy(inl + 1, sqp->header_buf, header_size); i = 1; } else { - inl->byte_count = cpu_to_be32(1 << 31 | spc); + inl->byte_count = cpu_to_be32(1U << 31 | spc); memcpy(inl + 1, sqp->header_buf, spc); inl = (void *) (inl + 1) + spc; @@ -2652,7 +2652,7 @@ static int build_mlx_header(struct mlx4_ * of 16 mod 64. */ wmb(); - inl->byte_count = cpu_to_be32(1 << 31 | (header_size - spc)); + inl->byte_count = cpu_to_be32(1U << 31 | (header_size - spc)); i = 2; } @@ -2797,17 +2797,17 @@ static void build_tunnel_header(struct i if (sizeof (hdr) <= spc) { memcpy(inl + 1, &hdr, sizeof (hdr)); wmb(); - inl->byte_count = cpu_to_be32(1 << 31 | sizeof (hdr)); + inl->byte_count = cpu_to_be32(1U << 31 | sizeof (hdr)); i = 1; } else { memcpy(inl + 1, &hdr, spc); wmb(); - inl->byte_count = cpu_to_be32(1 << 31 | spc); + inl->byte_count = cpu_to_be32(1U << 31 | spc); inl = (void *) (inl + 1) + spc; memcpy(inl + 1, (void *) &hdr + spc, sizeof (hdr) - spc); wmb(); - inl->byte_count = cpu_to_be32(1 << 31 | (sizeof (hdr) - spc)); + inl->byte_count = cpu_to_be32(1U << 31 | (sizeof (hdr) - spc)); i = 2; } From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:07:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0786C18 for ; Tue, 12 Aug 2014 12:07:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76E6A251B for ; Tue, 12 Aug 2014 12:07:57 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 6b59 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:07:57 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 12:07: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: r269861 - stable/10/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea039d.6b59.686e4d34@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:07:57 -0000 Author: hselasky Date: Tue Aug 12 12:07:57 2014 New Revision: 269861 URL: http://svnweb.freebsd.org/changeset/base/269861 Log: MFC r268315: Fix compile warning. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c Tue Aug 12 12:06:21 2014 (r269860) +++ stable/10/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c Tue Aug 12 12:07:57 2014 (r269861) @@ -665,7 +665,7 @@ static void mlx4_ib_mcg_work_handler(str if (!list_empty(&group->pending_list)) req = list_first_entry(&group->pending_list, struct mcast_req, group_list); - if ((method == IB_MGMT_METHOD_GET_RESP)) { + if (method == IB_MGMT_METHOD_GET_RESP) { if (req) { send_reply_to_slave(req->func, group, &req->sa_mad, status); --group->func[req->func].num_pend_reqs; From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:10:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E4DCD7C for ; Tue, 12 Aug 2014 12:10:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51EDA25B6 for ; Tue, 12 Aug 2014 12:10:30 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 6e9c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:10:29 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 12:10: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: r269862 - in stable/10/sys/ofed: drivers/infiniband/hw/mlx4 drivers/net/mlx4 include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea0436.6e9c.2b42d4e5@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:10:30 -0000 Author: hselasky Date: Tue Aug 12 12:10:29 2014 New Revision: 269862 URL: http://svnweb.freebsd.org/changeset/base/269862 Log: MFC r268316: Fix OFED startup order: All SYSINIT()'s and modules should be loaded prior to starting "/sbin/init" which will run all the "/etc/rc.d/xxx" scripts. Else there can be a race configuring the interfaces via "/etc/rc.conf". Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c stable/10/sys/ofed/drivers/net/mlx4/en_main.c stable/10/sys/ofed/drivers/net/mlx4/main.c stable/10/sys/ofed/include/linux/module.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Aug 12 12:07:57 2014 (r269861) +++ stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Aug 12 12:10:29 2014 (r269862) @@ -2414,6 +2414,6 @@ static moduledata_t mlx4ib_mod = { .evhand = mlx4ib_evhand, }; -DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); MODULE_DEPEND(mlx4ib, mlx4, 1, 1, 1); MODULE_DEPEND(mlx4ib, ibcore, 1, 1, 1); Modified: stable/10/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_main.c Tue Aug 12 12:07:57 2014 (r269861) +++ stable/10/sys/ofed/drivers/net/mlx4/en_main.c Tue Aug 12 12:10:29 2014 (r269862) @@ -383,5 +383,5 @@ static moduledata_t mlxen_mod = { .name = "mlxen", .evhand = mlxen_evhand, }; -DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); MODULE_DEPEND(mlxen, mlx4, 1, 1, 1); Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/main.c Tue Aug 12 12:07:57 2014 (r269861) +++ stable/10/sys/ofed/drivers/net/mlx4/main.c Tue Aug 12 12:10:29 2014 (r269862) @@ -2875,4 +2875,4 @@ static moduledata_t mlx4_mod = { .evhand = mlx4_evhand, }; MODULE_VERSION(mlx4, 1); -DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); Modified: stable/10/sys/ofed/include/linux/module.h ============================================================================== --- stable/10/sys/ofed/include/linux/module.h Tue Aug 12 12:07:57 2014 (r269861) +++ stable/10/sys/ofed/include/linux/module.h Tue Aug 12 12:10:29 2014 (r269862) @@ -44,6 +44,11 @@ #define EXPORT_SYMBOL(name) #define EXPORT_SYMBOL_GPL(name) +/* OFED pre-module initialization */ +#define SI_SUB_OFED_PREINIT (SI_SUB_KTHREAD_INIT - 2) +/* OFED default module initialization */ +#define SI_SUB_OFED_MODINIT (SI_SUB_KTHREAD_INIT - 1) + #include static inline void @@ -68,17 +73,17 @@ _module_run(void *arg) } #define module_init(fn) \ - SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed to work around not having a module * load order resolver built in. */ #define module_init_order(fn, order) \ - SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn)) + SYSINIT(fn, SI_SUB_OFED_MODINIT, (order), _module_run, (fn)) #define module_exit(fn) \ - SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) + SYSUNINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn)) #define module_get(module) #define module_put(module) From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:18:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17BF516F for ; Tue, 12 Aug 2014 12:18:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5E60262B for ; Tue, 12 Aug 2014 12:18:44 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 6ee1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:18:44 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 12:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269863 - in stable/9/sys/ofed: drivers/infiniband/hw/mlx4 drivers/net/mlx4 include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea0624.6ee1.2d8f4b2a@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:18:45 -0000 Author: hselasky Date: Tue Aug 12 12:18:43 2014 New Revision: 269863 URL: http://svnweb.freebsd.org/changeset/base/269863 Log: MFC r268316: Fix OFED startup order: All SYSINIT()'s and modules should be loaded prior to starting "/sbin/init" which will run all the "/etc/rc.d/xxx" scripts. Else there can be a race configuring the interfaces via "/etc/rc.conf". Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/drivers/infiniband/hw/mlx4/main.c stable/9/sys/ofed/drivers/net/mlx4/en_main.c stable/9/sys/ofed/drivers/net/mlx4/main.c stable/9/sys/ofed/include/linux/module.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Aug 12 12:10:29 2014 (r269862) +++ stable/9/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Aug 12 12:18:43 2014 (r269863) @@ -1576,5 +1576,5 @@ static moduledata_t mlx4ib_mod = { .name = "mlx4ib", .evhand = mlx4ib_evhand, }; -DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); MODULE_DEPEND(mlx4ib, mlx4, 1, 1, 1); Modified: stable/9/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_main.c Tue Aug 12 12:10:29 2014 (r269862) +++ stable/9/sys/ofed/drivers/net/mlx4/en_main.c Tue Aug 12 12:18:43 2014 (r269863) @@ -379,5 +379,5 @@ static moduledata_t mlxen_mod = { .name = "mlxen", .evhand = mlxen_evhand, }; -DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); MODULE_DEPEND(mlxen, mlx4, 1, 1, 1); Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/main.c Tue Aug 12 12:10:29 2014 (r269862) +++ stable/9/sys/ofed/drivers/net/mlx4/main.c Tue Aug 12 12:18:43 2014 (r269863) @@ -1699,4 +1699,4 @@ static moduledata_t mlx4_mod = { .evhand = mlx4_evhand, }; MODULE_VERSION(mlx4, 1); -DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); Modified: stable/9/sys/ofed/include/linux/module.h ============================================================================== --- stable/9/sys/ofed/include/linux/module.h Tue Aug 12 12:10:29 2014 (r269862) +++ stable/9/sys/ofed/include/linux/module.h Tue Aug 12 12:18:43 2014 (r269863) @@ -44,6 +44,11 @@ #define EXPORT_SYMBOL(name) #define EXPORT_SYMBOL_GPL(name) +/* OFED pre-module initialization */ +#define SI_SUB_OFED_PREINIT (SI_SUB_KTHREAD_INIT - 2) +/* OFED default module initialization */ +#define SI_SUB_OFED_MODINIT (SI_SUB_KTHREAD_INIT - 1) + #include static inline void @@ -68,17 +73,17 @@ _module_run(void *arg) } #define module_init(fn) \ - SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed to work around not having a module * load order resolver built in. */ #define module_init_order(fn, order) \ - SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn)) + SYSINIT(fn, SI_SUB_OFED_MODINIT, (order), _module_run, (fn)) #define module_exit(fn) \ - SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) + SYSUNINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn)) #define module_get(module) #define module_put(module) From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:22:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A370E329 for ; Tue, 12 Aug 2014 12:22:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77EFE26D9 for ; Tue, 12 Aug 2014 12:22:39 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 622e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:22:39 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 12:22: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: r269864 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea070f.622e.6d125182@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:22:39 -0000 Author: hselasky Date: Tue Aug 12 12:22:39 2014 New Revision: 269864 URL: http://svnweb.freebsd.org/changeset/base/269864 Log: MFC r257594: Add description of two EHCI PCI IDs. Modified: stable/10/sys/dev/usb/controller/ehci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_pci.c Tue Aug 12 12:18:43 2014 (r269863) +++ stable/10/sys/dev/usb/controller/ehci_pci.c Tue Aug 12 12:22:39 2014 (r269864) @@ -154,6 +154,10 @@ ehci_pci_match(device_t self) return ("Intel PCH USB 2.0 controller USB-A"); case 0x3b3c8086: return ("Intel PCH USB 2.0 controller USB-B"); + case 0x8c268086: + return ("Intel Lynx Point USB 2.0 controller USB-A"); + case 0x8c2d8086: + return ("Intel Lynx Point USB 2.0 controller USB-B"); case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:25:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA6DD4AB for ; Tue, 12 Aug 2014 12:25:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB5982707 for ; Tue, 12 Aug 2014 12:25:56 +0000 (UTC) Received: from ume (uid 812) (envelope-from ume@FreeBSD.org) id 6244 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:25:56 +0000 From: Hajimu UMEMOTO Date: Tue, 12 Aug 2014 12:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269865 - in head/lib/libc: . md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea07d4.6244.7ff9af9b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:25:57 -0000 Author: ume Date: Tue Aug 12 12:25:56 2014 New Revision: 269865 URL: http://svnweb.freebsd.org/changeset/base/269865 Log: Bring the md5 functions into libc for internal use only. It is required to support ID randomization for our stub resolver. Added: head/lib/libc/md/ head/lib/libc/md/Makefile.inc (contents, props changed) Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Aug 12 12:22:39 2014 (r269864) +++ head/lib/libc/Makefile Tue Aug 12 12:25:56 2014 (r269865) @@ -75,6 +75,7 @@ NOASM= .include "${LIBC_SRCTOP}/inet/Makefile.inc" .include "${LIBC_SRCTOP}/isc/Makefile.inc" .include "${LIBC_SRCTOP}/locale/Makefile.inc" +.include "${LIBC_SRCTOP}/md/Makefile.inc" .include "${LIBC_SRCTOP}/nameser/Makefile.inc" .include "${LIBC_SRCTOP}/net/Makefile.inc" .include "${LIBC_SRCTOP}/nls/Makefile.inc" Added: head/lib/libc/md/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/md/Makefile.inc Tue Aug 12 12:25:56 2014 (r269865) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +.PATH: ${LIBC_SRCTOP}/../libmd + +SRCS+= md5c.c From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:26:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13EEE5ED for ; Tue, 12 Aug 2014 12:26:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8C022711 for ; Tue, 12 Aug 2014 12:26:13 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 6267 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:26:13 +0000 From: Hans Petter Selasky Date: Tue, 12 Aug 2014 12:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269866 - in stable/9/sys/dev: ahci ata ata/chipsets usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea07e5.6267.68439810@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:26:14 -0000 Author: hselasky Date: Tue Aug 12 12:26:12 2014 New Revision: 269866 URL: http://svnweb.freebsd.org/changeset/base/269866 Log: MFC r258162 and r257594: Add some more IDs for Intel ATA, AHCI and USB controllers. Modified: stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/ata/ata-pci.h stable/9/sys/dev/ata/chipsets/ata-intel.c stable/9/sys/dev/usb/controller/ehci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Tue Aug 12 12:25:56 2014 (r269865) +++ stable/9/sys/dev/ahci/ahci.c Tue Aug 12 12:26:12 2014 (r269866) @@ -197,21 +197,54 @@ static struct { {0x28268086, 0x00, "Intel Patsburg (RAID)", 0}, {0x1e028086, 0x00, "Intel Panther Point", 0}, {0x1e038086, 0x00, "Intel Panther Point", 0}, - {0x1e048086, 0x00, "Intel Panther Point", 0}, - {0x1e058086, 0x00, "Intel Panther Point", 0}, - {0x1e068086, 0x00, "Intel Panther Point", 0}, - {0x1e078086, 0x00, "Intel Panther Point", 0}, - {0x1e0e8086, 0x00, "Intel Panther Point", 0}, - {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x1e048086, 0x00, "Intel Panther Point (RAID)", 0}, + {0x1e058086, 0x00, "Intel Panther Point (RAID)", 0}, + {0x1e068086, 0x00, "Intel Panther Point (RAID)", 0}, + {0x1e078086, 0x00, "Intel Panther Point (RAID)", 0}, + {0x1e0e8086, 0x00, "Intel Panther Point (RAID)", 0}, + {0x1e0f8086, 0x00, "Intel Panther Point (RAID)", 0}, + {0x1f228086, 0x00, "Intel Avoton", 0}, + {0x1f238086, 0x00, "Intel Avoton", 0}, + {0x1f248086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f258086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f268086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f278086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f2e8086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f2f8086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f328086, 0x00, "Intel Avoton", 0}, + {0x1f338086, 0x00, "Intel Avoton", 0}, + {0x1f348086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f358086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f368086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f378086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f3e8086, 0x00, "Intel Avoton (RAID)", 0}, + {0x1f3f8086, 0x00, "Intel Avoton (RAID)", 0}, {0x23a38086, 0x00, "Intel Coleto Creek", 0}, + {0x28238086, 0x00, "Intel Wellsburg (RAID)", 0}, + {0x28278086, 0x00, "Intel Wellsburg (RAID)", 0}, {0x8c028086, 0x00, "Intel Lynx Point", 0}, {0x8c038086, 0x00, "Intel Lynx Point", 0}, - {0x8c048086, 0x00, "Intel Lynx Point", 0}, - {0x8c058086, 0x00, "Intel Lynx Point", 0}, - {0x8c068086, 0x00, "Intel Lynx Point", 0}, - {0x8c078086, 0x00, "Intel Lynx Point", 0}, - {0x8c0e8086, 0x00, "Intel Lynx Point", 0}, - {0x8c0f8086, 0x00, "Intel Lynx Point", 0}, + {0x8c048086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c058086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c068086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c078086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c0e8086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c0f8086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8d028086, 0x00, "Intel Wellsburg", 0}, + {0x8d048086, 0x00, "Intel Wellsburg (RAID)", 0}, + {0x8d068086, 0x00, "Intel Wellsburg (RAID)", 0}, + {0x8d628086, 0x00, "Intel Wellsburg", 0}, + {0x8d648086, 0x00, "Intel Wellsburg (RAID)", 0}, + {0x8d668086, 0x00, "Intel Wellsburg (RAID)", 0}, + {0x8d6e8086, 0x00, "Intel Wellsburg (RAID)", 0}, + {0x9c028086, 0x00, "Intel Lynx Point-LP", 0}, + {0x9c038086, 0x00, "Intel Lynx Point-LP", 0}, + {0x9c048086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9c058086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9c068086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, + {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, Modified: stable/9/sys/dev/ata/ata-pci.h ============================================================================== --- stable/9/sys/dev/ata/ata-pci.h Tue Aug 12 12:25:56 2014 (r269865) +++ stable/9/sys/dev/ata/ata-pci.h Tue Aug 12 12:26:12 2014 (r269866) @@ -260,6 +260,11 @@ struct ata_pci_controller { #define ATA_PPT_R5 0x1e0e8086 #define ATA_PPT_R6 0x1e0f8086 +#define ATA_AVOTON_S1 0x1f208086 +#define ATA_AVOTON_S2 0x1f218086 +#define ATA_AVOTON_S3 0x1f308086 +#define ATA_AVOTON_S4 0x1f318086 + #define ATA_LPT_S1 0x8c008086 #define ATA_LPT_S2 0x8c018086 #define ATA_LPT_AH1 0x8c028086 @@ -273,6 +278,16 @@ struct ata_pci_controller { #define ATA_LPT_R5 0x8c0e8086 #define ATA_LPT_R6 0x8c0f8086 +#define ATA_WELLS_S1 0x8d008086 +#define ATA_WELLS_S2 0x8d088086 +#define ATA_WELLS_S3 0x8d608086 +#define ATA_WELLS_S4 0x8d688086 + +#define ATA_LPTLP_S1 0x9c008086 +#define ATA_LPTLP_S2 0x9c018086 +#define ATA_LPTLP_S3 0x9c088086 +#define ATA_LPTLP_S4 0x9c098086 + #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 Modified: stable/9/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-intel.c Tue Aug 12 12:25:56 2014 (r269865) +++ stable/9/sys/dev/ata/chipsets/ata-intel.c Tue Aug 12 12:26:12 2014 (r269866) @@ -212,6 +212,10 @@ ata_intel_probe(device_t dev) { ATA_PPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_AVOTON_S1, 0, INTEL_6CH, 0, ATA_SA300, "Avoton" }, + { ATA_AVOTON_S2, 0, INTEL_6CH, 0, ATA_SA300, "Avoton" }, + { ATA_AVOTON_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Avoton" }, + { ATA_AVOTON_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Avoton" }, { ATA_LPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, @@ -224,6 +228,14 @@ ata_intel_probe(device_t dev) { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, + { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, + { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, + { ATA_WELLS_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, + { ATA_LPTLP_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point-LP" }, + { ATA_LPTLP_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point-LP" }, + { ATA_LPTLP_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point-LP" }, + { ATA_LPTLP_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point-LP" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, Modified: stable/9/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci_pci.c Tue Aug 12 12:25:56 2014 (r269865) +++ stable/9/sys/dev/usb/controller/ehci_pci.c Tue Aug 12 12:26:12 2014 (r269866) @@ -124,6 +124,8 @@ ehci_pci_match(device_t self) return ("Intel Panther Point USB 2.0 controller"); case 0x1e2d8086: return ("Intel Panther Point USB 2.0 controller"); + case 0x1f2c8086: + return ("Intel Avoton USB 2.0 controller"); case 0x25ad8086: return "Intel 6300ESB USB 2.0 controller"; case 0x24cd8086: @@ -152,6 +154,10 @@ ehci_pci_match(device_t self) return ("Intel PCH USB 2.0 controller USB-A"); case 0x3b3c8086: return ("Intel PCH USB 2.0 controller USB-B"); + case 0x8c268086: + return ("Intel Lynx Point USB 2.0 controller USB-A"); + case 0x8c2d8086: + return ("Intel Lynx Point USB 2.0 controller USB-B"); case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:36:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 970ED875 for ; Tue, 12 Aug 2014 12:36:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A3C281F for ; Tue, 12 Aug 2014 12:36:11 +0000 (UTC) Received: from ume (uid 812) (envelope-from ume@FreeBSD.org) id 665f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:36:06 +0000 From: Hajimu UMEMOTO Date: Tue, 12 Aug 2014 12:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269867 - in head: include include/arpa lib/libc/include lib/libc/include/isc lib/libc/inet lib/libc/isc lib/libc/nameser lib/libc/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea0a36.665f.74abd785@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:36:11 -0000 Author: ume Date: Tue Aug 12 12:36:06 2014 New Revision: 269867 URL: http://svnweb.freebsd.org/changeset/base/269867 Log: Update our stub resolver to final version of libbind. Obtained from: ISC Modified: head/include/arpa/inet.h head/include/arpa/nameser.h head/include/arpa/nameser_compat.h head/include/res_update.h head/include/resolv.h head/lib/libc/include/isc/eventlib.h head/lib/libc/include/isc/list.h head/lib/libc/include/port_before.h head/lib/libc/inet/inet_addr.c head/lib/libc/inet/inet_cidr_ntop.c head/lib/libc/inet/inet_cidr_pton.c head/lib/libc/inet/inet_net_ntop.c head/lib/libc/inet/inet_net_pton.c head/lib/libc/inet/inet_neta.c head/lib/libc/inet/inet_ntoa.c head/lib/libc/inet/inet_ntop.c head/lib/libc/inet/inet_pton.c head/lib/libc/inet/nsap_addr.c head/lib/libc/isc/ev_streams.c head/lib/libc/isc/ev_timers.c head/lib/libc/isc/eventlib_p.h head/lib/libc/nameser/Symbol.map head/lib/libc/nameser/ns_name.c head/lib/libc/nameser/ns_netint.c head/lib/libc/nameser/ns_parse.c head/lib/libc/nameser/ns_print.c head/lib/libc/nameser/ns_samedomain.c head/lib/libc/nameser/ns_ttl.c head/lib/libc/resolv/Makefile.inc head/lib/libc/resolv/Symbol.map head/lib/libc/resolv/herror.c head/lib/libc/resolv/res_comp.c head/lib/libc/resolv/res_data.c head/lib/libc/resolv/res_debug.c head/lib/libc/resolv/res_findzonecut.c 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 head/lib/libc/resolv/res_update.c Directory Properties: head/include/ (props changed) head/lib/libc/ (props changed) Modified: head/include/arpa/inet.h ============================================================================== --- head/include/arpa/inet.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/include/arpa/inet.h Tue Aug 12 12:36:06 2014 (r269867) @@ -51,7 +51,7 @@ /*% * @(#)inet.h 8.1 (Berkeley) 6/2/93 - * $Id: inet.h,v 1.2.18.1 2005/04/27 05:00:50 sra Exp $ + * $Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $ * $FreeBSD$ */ Modified: head/include/arpa/nameser.h ============================================================================== --- head/include/arpa/nameser.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/include/arpa/nameser.h Tue Aug 12 12:36:06 2014 (r269867) @@ -1,7 +1,24 @@ /* + * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 1996-2003 Internet Software Consortium. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* * Copyright (c) 1983, 1989, 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: @@ -13,7 +30,7 @@ * 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 @@ -28,24 +45,7 @@ */ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") - * Copyright (c) 1996-1999 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * $Id: nameser.h,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $ + * $Id: nameser.h,v 1.16 2009/03/03 01:52:48 each Exp $ * $FreeBSD$ */ @@ -68,15 +68,18 @@ * contains a new enough lib/nameser/ to support the feature you need. */ -#define __NAMESER 19991006 /*%< New interface version stamp. */ +#define __NAMESER 20090302 /*%< New interface version stamp. */ /* * Define constants based on RFC0883, RFC1034, RFC 1035 */ #define NS_PACKETSZ 512 /*%< default UDP packet size */ -#define NS_MAXDNAME 1025 /*%< maximum domain name */ +#define NS_MAXDNAME 1025 /*%< maximum domain name (presentation format)*/ #define NS_MAXMSG 65535 /*%< maximum message size */ #define NS_MAXCDNAME 255 /*%< maximum compressed domain name */ #define NS_MAXLABEL 63 /*%< maximum length of domain label */ +#define NS_MAXLABELS 128 /*%< theoretical max #/labels per domain name */ +#define NS_MAXNNAME 256 /*%< maximum uncompressed (binary) domain name*/ +#define NS_MAXPADDR (sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") #define NS_HFIXEDSZ 12 /*%< #/bytes of fixed data in header */ #define NS_QFIXEDSZ 4 /*%< #/bytes of fixed data in query */ #define NS_RRFIXEDSZ 10 /*%< #/bytes of fixed data in r record */ @@ -103,6 +106,18 @@ typedef enum __ns_sect { } ns_sect; /*% + * Network name (compressed or not) type. Equivilent to a pointer when used + * in a function prototype. Can be const'd. + */ +typedef u_char ns_nname[NS_MAXNNAME]; +typedef const u_char *ns_nname_ct; +typedef u_char *ns_nname_t; + +struct ns_namemap { ns_nname_ct base; int len; }; +typedef struct ns_namemap *ns_namemap_t; +typedef const struct ns_namemap *ns_namemap_ct; + +/*% * This is a message handle. It is caller allocated and has no dynamic data. * This structure is intended to be opaque to all but ns_parse.c, thus the * leading _'s on the member names. Use the accessor functions, not the _'s. @@ -116,6 +131,17 @@ typedef struct __ns_msg { const u_char *_msg_ptr; } ns_msg; +/* + * This is a newmsg handle, used when constructing new messages with + * ns_newmsg_init, et al. + */ +struct ns_newmsg { + ns_msg msg; + const u_char *dnptrs[25]; + const u_char **lastdnptr; +}; +typedef struct ns_newmsg ns_newmsg; + /* Private data structure - do not use from outside library. */ struct _ns_flagdata { int mask, shift; }; extern struct _ns_flagdata _ns_flagdata[]; @@ -140,8 +166,23 @@ typedef struct __ns_rr { const u_char * rdata; } ns_rr; +/* + * Same thing, but using uncompressed network binary names, and real C types. + */ +typedef struct __ns_rr2 { + ns_nname nname; + size_t nnamel; + int type; + int rr_class; + u_int ttl; + int rdlength; + const u_char * rdata; +} ns_rr2; + /* Accessor macros - this is part of the public interface. */ #define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") +#define ns_rr_nname(rr) ((const ns_nname_t)(rr).nname) +#define ns_rr_nnamel(rr) ((rr).nnamel + 0) #define ns_rr_type(rr) ((ns_type)((rr).type + 0)) #define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0)) #define ns_rr_ttl(rr) ((rr).ttl + 0) @@ -216,9 +257,9 @@ typedef enum __ns_update_operation { * This structure is used for TSIG authenticated messages */ struct ns_tsig_key { - char name[NS_MAXDNAME], alg[NS_MAXDNAME]; - unsigned char *data; - int len; + char name[NS_MAXDNAME], alg[NS_MAXDNAME]; + unsigned char *data; + int len; }; typedef struct ns_tsig_key ns_tsig_key; @@ -274,7 +315,7 @@ typedef enum __ns_type { ns_t_key = 25, /*%< Security key. */ ns_t_px = 26, /*%< X.400 mail mapping. */ ns_t_gpos = 27, /*%< Geographical position (withdrawn). */ - ns_t_aaaa = 28, /*%< Ip6 Address. */ + ns_t_aaaa = 28, /*%< IPv6 Address. */ ns_t_loc = 29, /*%< Location Information. */ ns_t_nxt = 30, /*%< Next domain (security). */ ns_t_eid = 31, /*%< Endpoint identifier. */ @@ -284,11 +325,22 @@ typedef enum __ns_type { ns_t_naptr = 35, /*%< Naming Authority PoinTeR */ ns_t_kx = 36, /*%< Key Exchange */ ns_t_cert = 37, /*%< Certification record */ - ns_t_a6 = 38, /*%< IPv6 address (deprecates AAAA) */ - ns_t_dname = 39, /*%< Non-terminal DNAME (for IPv6) */ + ns_t_a6 = 38, /*%< IPv6 address (experimental) */ + ns_t_dname = 39, /*%< Non-terminal DNAME */ ns_t_sink = 40, /*%< Kitchen sink (experimentatl) */ ns_t_opt = 41, /*%< EDNS0 option (meta-RR) */ ns_t_apl = 42, /*%< Address prefix list (RFC3123) */ + ns_t_ds = 43, /*%< Delegation Signer */ + ns_t_sshfp = 44, /*%< SSH Fingerprint */ + ns_t_ipseckey = 45, /*%< IPSEC Key */ + ns_t_rrsig = 46, /*%< RRset Signature */ + ns_t_nsec = 47, /*%< Negative security */ + ns_t_dnskey = 48, /*%< DNS Key */ + ns_t_dhcid = 49, /*%< Dynamic host configuratin identifier */ + ns_t_nsec3 = 50, /*%< Negative security type 3 */ + ns_t_nsec3param = 51, /*%< Negative security type 3 parameters */ + ns_t_hip = 55, /*%< Host Identity Protocol */ + ns_t_spf = 99, /*%< Sender Policy Framework */ ns_t_tkey = 249, /*%< Transaction key */ ns_t_tsig = 250, /*%< Transaction signature. */ ns_t_ixfr = 251, /*%< Incremental zone transfer. */ @@ -297,6 +349,7 @@ typedef enum __ns_type { ns_t_maila = 254, /*%< Transfer mail agent records. */ ns_t_any = 255, /*%< Wildcard match. */ ns_t_zxfr = 256, /*%< BIND-specific, nonstandard. */ + ns_t_dlv = 32769, /*%< DNSSEC look-aside validatation. */ ns_t_max = 65536 } ns_type; @@ -475,6 +528,7 @@ typedef enum __ns_cert_types { #define ns_initparse __ns_initparse #define ns_skiprr __ns_skiprr #define ns_parserr __ns_parserr +#define ns_parserr2 __ns_parserr2 #define ns_sprintrr __ns_sprintrr #define ns_sprintrrf __ns_sprintrrf #define ns_format_ttl __ns_format_ttl @@ -485,12 +539,19 @@ typedef enum __ns_cert_types { #define ns_name_ntol __ns_name_ntol #define ns_name_ntop __ns_name_ntop #define ns_name_pton __ns_name_pton +#define ns_name_pton2 __ns_name_pton2 #define ns_name_unpack __ns_name_unpack +#define ns_name_unpack2 __ns_name_unpack2 #define ns_name_pack __ns_name_pack #define ns_name_compress __ns_name_compress #define ns_name_uncompress __ns_name_uncompress #define ns_name_skip __ns_name_skip #define ns_name_rollback __ns_name_rollback +#define ns_name_length __ns_name_length +#define ns_name_eq __ns_name_eq +#define ns_name_owned __ns_name_owned +#define ns_name_map __ns_name_map +#define ns_name_labels __ns_name_labels #if 0 #define ns_sign __ns_sign #define ns_sign2 __ns_sign2 @@ -508,6 +569,16 @@ typedef enum __ns_cert_types { #endif #define ns_makecanon __ns_makecanon #define ns_samename __ns_samename +#define ns_newmsg_init __ns_newmsg_init +#define ns_newmsg_copy __ns_newmsg_copy +#define ns_newmsg_id __ns_newmsg_id +#define ns_newmsg_flag __ns_newmsg_flag +#define ns_newmsg_q __ns_newmsg_q +#define ns_newmsg_rr __ns_newmsg_rr +#define ns_newmsg_done __ns_newmsg_done +#define ns_rdata_unpack __ns_rdata_unpack +#define ns_rdata_equal __ns_rdata_equal +#define ns_rdata_refers __ns_rdata_refers __BEGIN_DECLS int ns_msg_getflag(ns_msg, int); @@ -518,6 +589,7 @@ void ns_put32(u_long, u_char *); int ns_initparse(const u_char *, int, ns_msg *); int ns_skiprr(const u_char *, const u_char *, ns_sect, int); int ns_parserr(ns_msg *, ns_sect, int, ns_rr *); +int ns_parserr2(ns_msg *, ns_sect, int, ns_rr2 *); int ns_sprintrr(const ns_msg *, const ns_rr *, const char *, const char *, char *, size_t); int ns_sprintrrf(const u_char *, size_t, const char *, @@ -532,8 +604,12 @@ u_int32_t ns_datetosecs(const char *cp, int ns_name_ntol(const u_char *, u_char *, size_t); int ns_name_ntop(const u_char *, char *, size_t); int ns_name_pton(const char *, u_char *, size_t); +int ns_name_pton2(const char *, u_char *, size_t, size_t *); int ns_name_unpack(const u_char *, const u_char *, const u_char *, u_char *, size_t); +int ns_name_unpack2(const u_char *, const u_char *, + const u_char *, u_char *, size_t, + size_t *); int ns_name_pack(const u_char *, u_char *, int, const u_char **, const u_char **); int ns_name_uncompress(const u_char *, const u_char *, @@ -543,6 +619,11 @@ int ns_name_compress(const char *, u_ch int ns_name_skip(const u_char **, const u_char *); void ns_name_rollback(const u_char *, const u_char **, const u_char **); +ssize_t ns_name_length(ns_nname_ct, size_t); +int ns_name_eq(ns_nname_ct, size_t, ns_nname_ct, size_t); +int ns_name_owned(ns_namemap_ct, int, ns_namemap_ct, int); +int ns_name_map(ns_nname_ct, size_t, ns_namemap_t, int); +int ns_name_labels(ns_nname_ct, size_t); #if 0 int ns_sign(u_char *, int *, int, int, void *, const u_char *, int, u_char *, int *, time_t); @@ -570,6 +651,25 @@ int ns_subdomain(const char *, const ch #endif int ns_makecanon(const char *, char *, size_t); int ns_samename(const char *, const char *); +int ns_newmsg_init(u_char *buffer, size_t bufsiz, ns_newmsg *); +int ns_newmsg_copy(ns_newmsg *, ns_msg *); +void ns_newmsg_id(ns_newmsg *handle, u_int16_t id); +void ns_newmsg_flag(ns_newmsg *handle, ns_flag flag, u_int value); +int ns_newmsg_q(ns_newmsg *handle, ns_nname_ct qname, + ns_type qtype, ns_class qclass); +int ns_newmsg_rr(ns_newmsg *handle, ns_sect sect, + ns_nname_ct name, ns_type type, + ns_class rr_class, u_int32_t ttl, + u_int16_t rdlen, const u_char *rdata); +size_t ns_newmsg_done(ns_newmsg *handle); +ssize_t ns_rdata_unpack(const u_char *, const u_char *, ns_type, + const u_char *, size_t, u_char *, size_t); +int ns_rdata_equal(ns_type, + const u_char *, size_t, + const u_char *, size_t); +int ns_rdata_refers(ns_type, + const u_char *, size_t, + const u_char *); __END_DECLS #ifdef BIND_4_COMPAT Modified: head/include/arpa/nameser_compat.h ============================================================================== --- head/include/arpa/nameser_compat.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/include/arpa/nameser_compat.h Tue Aug 12 12:36:06 2014 (r269867) @@ -28,7 +28,7 @@ /*% * from nameser.h 8.1 (Berkeley) 6/2/93 - * $Id: nameser_compat.h,v 1.5.18.3 2006/05/19 02:36:00 marka Exp $ + * $Id: nameser_compat.h,v 1.8 2006/05/19 02:33:40 marka Exp $ * $FreeBSD$ */ Modified: head/include/res_update.h ============================================================================== --- head/include/res_update.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/include/res_update.h Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ /* - * $Id: res_update.h,v 1.2.18.1 2005/04/27 05:00:49 sra Exp $ + * $Id: res_update.h,v 1.3 2005/04/27 04:56:15 sra Exp $ * $FreeBSD$ */ Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/include/resolv.h Tue Aug 12 12:36:06 2014 (r269867) @@ -1,7 +1,24 @@ /* + * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 1995-2003 Internet Software Consortium. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* * Copyright (c) 1983, 1987, 1989 * 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: @@ -13,7 +30,7 @@ * 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 @@ -27,26 +44,9 @@ * SUCH DAMAGE. */ -/* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") - * Portions Copyright (c) 1996-1999 by Internet Software Consortium. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - /*% * @(#)resolv.h 8.1 (Berkeley) 6/2/93 - * $Id: resolv.h,v 1.19.18.4 2008/04/03 23:15:15 marka Exp $ + * $Id: resolv.h,v 1.30 2009/03/03 01:52:48 each Exp $ * $FreeBSD$ */ @@ -68,7 +68,7 @@ * is new enough to contain a certain feature. */ -#define __RES 20030124 +#define __RES 20090302 /*% * This used to be defined in res_query.c, now it's in herror.c. @@ -179,7 +179,7 @@ struct __res_state { u_int _pad; /*%< make _u 64 bit aligned */ union { /* On an 32-bit arch this means 512b total. */ - char pad[72 - 4*sizeof (int) - 2*sizeof (void *)]; + char pad[72 - 4*sizeof (int) - 3*sizeof (void *)]; struct { u_int16_t nscount; u_int16_t nstimes[MAXNS]; /*%< ms. */ @@ -187,6 +187,7 @@ struct __res_state { struct __res_state_ext *ext; /*%< extension for IPv6 */ } _ext; } _u; + u_char *_rnd; /*%< PRIVATE: random state */ }; typedef struct __res_state *res_state; @@ -320,7 +321,7 @@ __END_DECLS #if !defined(SHARED_LIBBIND) || defined(LIB) /* * If libbind is a shared object (well, DLL anyway) - * these externs break the linker when resolv.h is + * these externs break the linker when resolv.h is * included by a lib client (like named) * Make them go away if a client is including this * @@ -378,7 +379,9 @@ extern const struct res_sym __p_rcode_sy #define res_nisourserver __res_nisourserver #define res_ownok __res_ownok #define res_queriesmatch __res_queriesmatch +#define res_rndinit __res_rndinit #define res_randomid __res_randomid +#define res_nrandomid __res_nrandomid #define sym_ntop __sym_ntop #define sym_ntos __sym_ntos #define sym_ston __sym_ston @@ -441,7 +444,9 @@ int dn_count_labels(const char *); int dn_comp(const char *, u_char *, int, u_char **, u_char **); int dn_expand(const u_char *, const u_char *, const u_char *, char *, int); +void res_rndinit(res_state); u_int res_randomid(void); +u_int res_nrandomid(res_state); int res_nameinquery(const char *, int, int, const u_char *, const u_char *); int res_queriesmatch(const u_char *, const u_char *, Modified: head/lib/libc/include/isc/eventlib.h ============================================================================== --- head/lib/libc/include/isc/eventlib.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/include/isc/eventlib.h Tue Aug 12 12:36:06 2014 (r269867) @@ -1,24 +1,24 @@ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") - * Copyright (c) 1995-1999 by Internet Software Consortium + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ /* eventlib.h - exported interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib.h,v 1.3.18.3 2008/01/23 02:12:01 marka Exp $ + * $Id: eventlib.h,v 1.7 2008/11/14 02:36:51 marka Exp $ */ #ifndef _EVENTLIB_H Modified: head/lib/libc/include/isc/list.h ============================================================================== --- head/lib/libc/include/isc/list.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/include/isc/list.h Tue Aug 12 12:36:06 2014 (r269867) @@ -38,7 +38,8 @@ } while (0) #define INIT_LINK(elt, link) \ INIT_LINK_TYPE(elt, link, void) -#define LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1)) +#define LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1) && \ + (void *)((elt)->link.next) != (void *)(-1)) #define HEAD(list) ((list).head) #define TAIL(list) ((list).tail) Modified: head/lib/libc/include/port_before.h ============================================================================== --- head/lib/libc/include/port_before.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/include/port_before.h Tue Aug 12 12:36:06 2014 (r269867) @@ -6,6 +6,7 @@ #define _LIBC 1 #define DO_PTHREADS 1 #define USE_POLL 1 +#define HAVE_MD5 1 #define ISC_SOCKLEN_T socklen_t #define ISC_FORMAT_PRINTF(fmt, args) \ Modified: head/lib/libc/inet/inet_addr.c ============================================================================== --- head/lib/libc/inet/inet_addr.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_addr.c Tue Aug 12 12:36:06 2014 (r269867) @@ -66,7 +66,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; -static const char rcsid[] = "$Id: inet_addr.c,v 1.4.18.1 2005/04/27 05:00:52 sra Exp $"; +static const char rcsid[] = "$Id: inet_addr.c,v 1.5 2005/04/27 04:56:19 sra Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_cidr_ntop.c ============================================================================== --- head/lib/libc/inet/inet_cidr_ntop.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_cidr_ntop.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,8 +16,10 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.4.18.3 2006/10/11 02:32:47 marka Exp $"; +static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.7 2006/10/11 02:18:18 marka Exp $"; #endif +#include +__FBSDID("$FreeBSD$"); #include "port_before.h" Modified: head/lib/libc/inet/inet_cidr_pton.c ============================================================================== --- head/lib/libc/inet/inet_cidr_pton.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_cidr_pton.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.5.18.1 2005/04/27 05:00:53 sra Exp $"; +static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.6 2005/04/27 04:56:19 sra Exp $"; #endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_net_ntop.c ============================================================================== --- head/lib/libc/inet/inet_net_ntop.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_net_ntop.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.3.18.2 2006/06/20 02:51:32 marka Exp $"; +static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.5 2006/06/20 02:50:14 marka Exp $"; #endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_net_pton.c ============================================================================== --- head/lib/libc/inet/inet_net_pton.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_net_pton.c Tue Aug 12 12:36:06 2014 (r269867) @@ -1,22 +1,22 @@ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") - * Copyright (c) 1996,1999 by Internet Software Consortium. + * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1996, 1998, 1999, 2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $"; +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.10 2008/11/14 02:36:51 marka Exp $"; #endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_neta.c ============================================================================== --- head/lib/libc/inet/inet_neta.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_neta.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_neta.c,v 1.2.18.1 2005/04/27 05:00:53 sra Exp $"; +static const char rcsid[] = "$Id: inet_neta.c,v 1.3 2005/04/27 04:56:20 sra Exp $"; #endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_ntoa.c ============================================================================== --- head/lib/libc/inet/inet_ntoa.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_ntoa.c Tue Aug 12 12:36:06 2014 (r269867) @@ -29,7 +29,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: inet_ntoa.c,v 1.1.352.1 2005/04/27 05:00:54 sra Exp $"; +static const char rcsid[] = "$Id: inet_ntoa.c,v 1.2 2005/04/27 04:56:21 sra Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_ntop.c ============================================================================== --- head/lib/libc/inet/inet_ntop.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_ntop.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_ntop.c,v 1.3.18.2 2005/11/03 23:02:22 marka Exp $"; +static const char rcsid[] = "$Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/inet_pton.c ============================================================================== --- head/lib/libc/inet/inet_pton.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/inet_pton.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_pton.c,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $"; +static const char rcsid[] = "$Id: inet_pton.c,v 1.5 2005/07/28 06:51:47 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/inet/nsap_addr.c ============================================================================== --- head/lib/libc/inet/nsap_addr.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/inet/nsap_addr.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: nsap_addr.c,v 1.3.18.2 2005/07/28 07:38:08 marka Exp $"; +static const char rcsid[] = "$Id: nsap_addr.c,v 1.5 2005/07/28 06:51:48 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/isc/ev_streams.c ============================================================================== --- head/lib/libc/isc/ev_streams.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/isc/ev_streams.c Tue Aug 12 12:36:06 2014 (r269867) @@ -20,7 +20,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: ev_streams.c,v 1.4.18.1 2005/04/27 05:01:06 sra Exp $"; +static const char rcsid[] = "$Id: ev_streams.c,v 1.5 2005/04/27 04:56:36 sra Exp $"; #endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/isc/ev_timers.c ============================================================================== --- head/lib/libc/isc/ev_timers.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/isc/ev_timers.c Tue Aug 12 12:36:06 2014 (r269867) @@ -20,7 +20,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: ev_timers.c,v 1.5.18.1 2005/04/27 05:01:06 sra Exp $"; +static const char rcsid[] = "$Id: ev_timers.c,v 1.6 2005/04/27 04:56:36 sra Exp $"; #endif #include __FBSDID("$FreeBSD$"); Modified: head/lib/libc/isc/eventlib_p.h ============================================================================== --- head/lib/libc/isc/eventlib_p.h Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/isc/eventlib_p.h Tue Aug 12 12:36:06 2014 (r269867) @@ -19,7 +19,7 @@ * \brief private interfaces for eventlib * \author vix 09sep95 [initial] * - * $Id: eventlib_p.h,v 1.5.18.4 2006/03/10 00:20:08 marka Exp $ + * $Id: eventlib_p.h,v 1.9 2006/03/09 23:57:56 marka Exp $ * $FreeBSD$ */ Modified: head/lib/libc/nameser/Symbol.map ============================================================================== --- head/lib/libc/nameser/Symbol.map Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/nameser/Symbol.map Tue Aug 12 12:36:06 2014 (r269867) @@ -29,3 +29,24 @@ FBSD_1.0 { __ns_format_ttl; __ns_parse_ttl; }; + +FBSD_1.4 { + __ns_parserr2; + __ns_name_pton2; + __ns_name_unpack2; + __ns_name_length; + __ns_name_eq; + __ns_name_owned; + __ns_name_map; + __ns_name_labels; + __ns_newmsg_init; + __ns_newmsg_copy; + __ns_newmsg_id; + __ns_newmsg_flag; + __ns_newmsg_q; + __ns_newmsg_rr; + __ns_newmsg_done; + __ns_rdata_unpack; + __ns_rdata_equal; + __ns_rdata_refers; +}; Modified: head/lib/libc/nameser/ns_name.c ============================================================================== --- head/lib/libc/nameser/ns_name.c Tue Aug 12 12:26:12 2014 (r269866) +++ head/lib/libc/nameser/ns_name.c Tue Aug 12 12:36:06 2014 (r269867) @@ -16,8 +16,10 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_name.c,v 1.8.18.2 2005/04/27 05:01:08 sra Exp $"; +static const char rcsid[] = "$Id: ns_name.c,v 1.11 2009/01/23 19:59:16 each Exp $"; #endif +#include +__FBSDID("$FreeBSD$"); #include "port_before.h" @@ -121,7 +123,7 @@ ns_name_ntop(const u_char *src, char *ds } if ((l = labellen(cp - 1)) < 0) { errno = EMSGSIZE; /*%< XXX */ - return(-1); + return (-1); } if (dn + l >= eom) { errno = EMSGSIZE; @@ -133,12 +135,12 @@ ns_name_ntop(const u_char *src, char *ds if (n != DNS_LABELTYPE_BITSTRING) { /* XXX: labellen should reject this case */ errno = EINVAL; - return(-1); + return (-1); } if ((m = decode_bitstring(&cp, dn, eom)) < 0) { errno = EMSGSIZE; - return(-1); + return (-1); } dn += m; continue; @@ -197,10 +199,25 @@ ns_name_ntop(const u_char *src, char *ds * notes: *\li Enforces label and domain length limits. */ +int +ns_name_pton(const char *src, u_char *dst, size_t dstsiz) { + return (ns_name_pton2(src, dst, dstsiz, NULL)); +} +/* + * ns_name_pton2(src, dst, dstsiz, *dstlen) + * Convert a ascii string into an encoded domain name as per RFC1035. + * return: + * -1 if it fails + * 1 if string was fully qualified + * 0 is string was not fully qualified + * side effects: + * fills in *dstlen (if non-NULL) + * notes: + * Enforces label and domain length limits. + */ int -ns_name_pton(const char *src, u_char *dst, size_t dstsiz) -{ +ns_name_pton2(const char *src, u_char *dst, size_t dstsiz, size_t *dstlen) { u_char *label, *bp, *eom; int c, n, escaped, e = 0; char *cp; @@ -215,13 +232,13 @@ ns_name_pton(const char *src, u_char *ds if (c == '[') { /*%< start a bit string label */ if ((cp = strchr(src, ']')) == NULL) { errno = EINVAL; /*%< ??? */ - return(-1); + return (-1); } if ((e = encode_bitsring(&src, cp + 2, &label, &bp, eom)) != 0) { errno = e; - return(-1); + return (-1); } escaped = 0; label = bp++; @@ -229,7 +246,7 @@ ns_name_pton(const char *src, u_char *ds goto done; else if (c != '.') { errno = EINVAL; - return(-1); + return (-1); } continue; } @@ -281,6 +298,8 @@ ns_name_pton(const char *src, u_char *ds errno = EMSGSIZE; return (-1); } + if (dstlen != NULL) + *dstlen = (bp - dst); return (1); } if (c == 0 || *src == '.') { @@ -318,6 +337,8 @@ ns_name_pton(const char *src, u_char *ds errno = EMSGSIZE; return (-1); } + if (dstlen != NULL) + *dstlen = (bp - dst); return (0); } @@ -365,7 +386,7 @@ ns_name_ntol(const u_char *src, u_char * } for ((void)NULL; l > 0; l--) { c = *cp++; - if (isupper(c)) + if (isascii(c) && isupper(c)) *dn++ = tolower(c); else *dn++ = c; @@ -385,6 +406,21 @@ int ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src, u_char *dst, size_t dstsiz) { + return (ns_name_unpack2(msg, eom, src, dst, dstsiz, NULL)); +} + +/* + * ns_name_unpack2(msg, eom, src, dst, dstsiz, *dstlen) + * Unpack a domain name from a message, source may be compressed. + * return: + * -1 if it fails, or consumed octets if it succeeds. + * side effect: + * fills in *dstlen (if non-NULL). + */ +int +ns_name_unpack2(const u_char *msg, const u_char *eom, const u_char *src, + u_char *dst, size_t dstsiz, size_t *dstlen) +{ const u_char *srcp, *dstlim; u_char *dstp; int n, len, checked, l; @@ -407,7 +443,7 @@ ns_name_unpack(const u_char *msg, const /* Limit checks. */ if ((l = labellen(srcp - 1)) < 0) { errno = EMSGSIZE; - return(-1); + return (-1); } if (dstp + l + 1 >= dstlim || srcp + l >= eom) { errno = EMSGSIZE; @@ -449,7 +485,9 @@ ns_name_unpack(const u_char *msg, const return (-1); /*%< flag error */ } } - *dstp = '\0'; + *dstp++ = 0; + if (dstlen != NULL) + *dstlen = dstp - dst; if (len < 0) len = srcp - src; return (len); @@ -508,7 +546,7 @@ ns_name_pack(const u_char *src, u_char * } if ((l0 = labellen(srcp)) < 0) { errno = EINVAL; - return(-1); + return (-1); } l += l0 + 1; if (l > MAXCDNAME) { @@ -655,7 +693,7 @@ ns_name_skip(const u_char **ptrptr, cons case NS_TYPE_ELT: /*%< EDNS0 extended label */ if ((l = labellen(cp - 1)) < 0) { errno = EMSGSIZE; /*%< XXX */ - return(-1); + return (-1); } cp += l; continue; @@ -676,6 +714,150 @@ ns_name_skip(const u_char **ptrptr, cons return (0); } +/* Find the number of octets an nname takes up, including the root label. + * (This is basically ns_name_skip() without compression-pointer support.) + * ((NOTE: can only return zero if passed-in namesiz argument is zero.)) + */ +ssize_t +ns_name_length(ns_nname_ct nname, size_t namesiz) { + ns_nname_ct orig = nname; + u_int n; + + while (namesiz-- > 0 && (n = *nname++) != 0) { + if ((n & NS_CMPRSFLGS) != 0) { + errno = EISDIR; + return (-1); + } + if (n > namesiz) { + errno = EMSGSIZE; + return (-1); + } + nname += n; + namesiz -= n; + } + return (nname - orig); +} + +/* Compare two nname's for equality. Return -1 on error (setting errno). + */ +int +ns_name_eq(ns_nname_ct a, size_t as, ns_nname_ct b, size_t bs) { + ns_nname_ct ae = a + as, be = b + bs; + int ac, bc; + + while (ac = *a, bc = *b, ac != 0 && bc != 0) { + if ((ac & NS_CMPRSFLGS) != 0 || (bc & NS_CMPRSFLGS) != 0) { + errno = EISDIR; + return (-1); + } + if (a + ac >= ae || b + bc >= be) { + errno = EMSGSIZE; + return (-1); + } + if (ac != bc || strncasecmp((const char *) ++a, + (const char *) ++b, ac) != 0) + return (0); + a += ac, b += bc; + } + return (ac == 0 && bc == 0); +} + +/* Is domain "A" owned by (at or below) domain "B"? + */ +int +ns_name_owned(ns_namemap_ct a, int an, ns_namemap_ct b, int bn) { + /* If A is shorter, it cannot be owned by B. */ + if (an < bn) + return (0); + + /* If they are unequal before the length of the shorter, A cannot... */ + while (bn > 0) { + if (a->len != b->len || + strncasecmp((const char *) a->base, + (const char *) b->base, a->len) != 0) + return (0); + a++, an--; + b++, bn--; + } + + /* A might be longer or not, but either way, B owns it. */ + return (1); +} + +/* Build an array of tuples from an nname, top-down order. + * Return the number of tuples (labels) thus discovered. + */ +int +ns_name_map(ns_nname_ct nname, size_t namelen, ns_namemap_t map, int mapsize) { + u_int n; + int l; + + n = *nname++; + namelen--; + + /* Root zone? */ + if (n == 0) { + /* Extra data follows name? */ + if (namelen > 0) { + errno = EMSGSIZE; + return (-1); + } + return (0); + } + + /* Compression pointer? */ + if ((n & NS_CMPRSFLGS) != 0) { + errno = EISDIR; + return (-1); + } + + /* Label too long? */ + if (n > namelen) { + errno = EMSGSIZE; + return (-1); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 12:44:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5876EFD4 for ; Tue, 12 Aug 2014 12:44:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F052292D for ; Tue, 12 Aug 2014 12:44:53 +0000 (UTC) Received: from gavin (uid 1136) (envelope-from gavin@FreeBSD.org) id 6a8b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 12:44:53 +0000 From: Gavin Atkinson Date: Tue, 12 Aug 2014 12:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269871 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea0c45.6a8b.75ce4698@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 12:44:53 -0000 Author: gavin Date: Tue Aug 12 12:44:52 2014 New Revision: 269871 URL: http://svnweb.freebsd.org/changeset/base/269871 Log: Clarify descriptions of pthread_cond_wait() and pthread_cond_timedwait() Requested by: Malcolm Douglas via freebsd-doc Reviewed by: jhb MFC after: 1 week Modified: head/share/man/man3/pthread.3 Modified: head/share/man/man3/pthread.3 ============================================================================== --- head/share/man/man3/pthread.3 Tue Aug 12 12:44:40 2014 (r269870) +++ head/share/man/man3/pthread.3 Tue Aug 12 12:44:52 2014 (r269871) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd August 12, 2014 .Dt PTHREAD 3 .Os .Sh NAME @@ -344,13 +344,13 @@ Unblock at least one of the threads bloc .Fa "const struct timespec *abstime" .Fc .Xc -Wait no longer than the specified time for a condition -and lock the specified mutex. +Unlock the specified mutex, wait no longer than the specified time for +a condition, and then relock the mutex. .It Xo .Ft int .Fn pthread_cond_wait "pthread_cond_t *" "pthread_mutex_t *mutex" .Xc -Wait for a condition and lock the specified mutex. +Unlock the specified mutex, wait for a condition, and relock the mutex. .El .Ss Read/Write Lock Routines .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 13:09:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A2B3B12 for ; Tue, 12 Aug 2014 13:09:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D56942C63 for ; Tue, 12 Aug 2014 13:09:32 +0000 (UTC) Received: from ume (uid 812) (envelope-from ume@FreeBSD.org) id 6165 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 13:09:32 +0000 From: Hajimu UMEMOTO Date: Tue, 12 Aug 2014 13:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269873 - head/lib/libc/nameser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea120c.6165.1de1e179@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 13:09:33 -0000 Author: ume Date: Tue Aug 12 13:09:32 2014 New Revision: 269873 URL: http://svnweb.freebsd.org/changeset/base/269873 Log: Fix broken pointer overflow check ns_name_unpack() Many compilers may optimize away the overflow check `msg + l < msg', where `msg' is a pointer and `l' is an integer, because pointer overflow is undefined behavior in C. Use a safe precondition test `l >= eom - msg' instead. Reference: https://android-review.googlesource.com/#/c/50570/ Requested by: pfg Obtained from: NetBSD (CVS rev. 1.10) Modified: head/lib/libc/nameser/ns_name.c Directory Properties: head/lib/libc/ (props changed) Modified: head/lib/libc/nameser/ns_name.c ============================================================================== --- head/lib/libc/nameser/ns_name.c Tue Aug 12 12:45:30 2014 (r269872) +++ head/lib/libc/nameser/ns_name.c Tue Aug 12 13:09:32 2014 (r269873) @@ -463,11 +463,12 @@ ns_name_unpack2(const u_char *msg, const } if (len < 0) len = srcp - src + 1; - srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff)); - if (srcp < msg || srcp >= eom) { /*%< Out of range. */ + l = ((n & 0x3f) << 8) | (*srcp & 0xff); + if (l >= eom - msg) { /*%< Out of range. */ errno = EMSGSIZE; return (-1); } + srcp = msg + l; checked += 2; /* * Check for loops in the compressed name; From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 13:13:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE805CA6 for ; Tue, 12 Aug 2014 13:13:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C99F62D52 for ; Tue, 12 Aug 2014 13:13:12 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 64cc by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 13:13:12 +0000 From: Michael Tuexen Date: Tue, 12 Aug 2014 13:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269874 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea12e8.64cc.2ba9bcf3@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 13:13:13 -0000 Author: tuexen Date: Tue Aug 12 13:13:11 2014 New Revision: 269874 URL: http://svnweb.freebsd.org/changeset/base/269874 Log: Change SCTP sysctl from auth_disable to auth_enable. This is consistent with other similar sysctl variable used in SCTP. Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Aug 12 13:09:32 2014 (r269873) +++ head/sys/netinet/sctp_pcb.c Tue Aug 12 13:13:11 2014 (r269874) @@ -2485,11 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); - if (SCTP_BASE_SYSCTL(sctp_auth_disable)) { - inp->auth_supported = 0; - } else { - inp->auth_supported = 1; - } + inp->auth_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_auth_enable); inp->asconf_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_asconf_enable); inp->reconfig_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_reconfig_enable); inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable); Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Aug 12 13:09:32 2014 (r269873) +++ head/sys/netinet/sctp_sysctl.c Tue Aug 12 13:13:11 2014 (r269874) @@ -55,7 +55,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT; - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_reconfig_enable) = SCTPCTL_RECONFIG_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; @@ -684,19 +684,19 @@ sysctl_sctp_auth_check(SYSCTL_HANDLER_AR error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); if (error == 0) { - if (SCTP_BASE_SYSCTL(sctp_auth_disable) < SCTPCTL_AUTH_DISABLE_MIN) { - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MIN; + if (SCTP_BASE_SYSCTL(sctp_auth_enable) < SCTPCTL_AUTH_ENABLE_MIN) { + SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_MIN; } - if (SCTP_BASE_SYSCTL(sctp_auth_disable) > SCTPCTL_AUTH_DISABLE_MAX) { - SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MAX; + if (SCTP_BASE_SYSCTL(sctp_auth_enable) > SCTPCTL_AUTH_ENABLE_MAX) { + SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_MAX; } - if ((SCTP_BASE_SYSCTL(sctp_auth_disable) == 1) && + if ((SCTP_BASE_SYSCTL(sctp_auth_enable) == 0) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1)) { /* * You can't disable AUTH with disabling ASCONF * first */ - SCTP_BASE_SYSCTL(sctp_auth_disable) = 0; + SCTP_BASE_SYSCTL(sctp_auth_enable) = 1; } } return (error); @@ -716,7 +716,7 @@ sysctl_sctp_asconf_check(SYSCTL_HANDLER_ SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_MAX; } if ((SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1) && - (SCTP_BASE_SYSCTL(sctp_auth_disable) == 1)) { + (SCTP_BASE_SYSCTL(sctp_auth_enable) == 0)) { /* * You can't enable ASCONF without enabling AUTH * first @@ -919,9 +919,9 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_PR_ENABLE_DESC); -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_auth_check, "IU", - SCTPCTL_AUTH_DISABLE_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_enable, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_auth_enable), 0, sysctl_sctp_auth_check, "IU", + SCTPCTL_AUTH_ENABLE_DESC); SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_enable), 0, sysctl_sctp_asconf_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Tue Aug 12 13:09:32 2014 (r269873) +++ head/sys/netinet/sctp_sysctl.h Tue Aug 12 13:13:11 2014 (r269874) @@ -46,7 +46,7 @@ struct sctp_sysctl { uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; uint32_t sctp_pr_enable; - uint32_t sctp_auth_disable; + uint32_t sctp_auth_enable; uint32_t sctp_asconf_enable; uint32_t sctp_reconfig_enable; uint32_t sctp_nrsack_enable; @@ -163,11 +163,11 @@ struct sctp_sysctl { #define SCTPCTL_PR_ENABLE_MAX 1 #define SCTPCTL_PR_ENABLE_DEFAULT 1 -/* auth_disable: Disable SCTP AUTH function */ -#define SCTPCTL_AUTH_DISABLE_DESC "Disable SCTP AUTH function" -#define SCTPCTL_AUTH_DISABLE_MIN 0 -#define SCTPCTL_AUTH_DISABLE_MAX 1 -#define SCTPCTL_AUTH_DISABLE_DEFAULT 0 +/* auth_enable: Enable SCTP AUTH function */ +#define SCTPCTL_AUTH_ENABLE_DESC "Enable SCTP AUTH function" +#define SCTPCTL_AUTH_ENABLE_MIN 0 +#define SCTPCTL_AUTH_ENABLE_MAX 1 +#define SCTPCTL_AUTH_ENABLE_DEFAULT 1 /* asconf_enable: Enable SCTP ASCONF */ #define SCTPCTL_ASCONF_ENABLE_DESC "Enable SCTP ASCONF" From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 13:28:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3230CFF for ; Tue, 12 Aug 2014 13:28:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06D112EB6 for ; Tue, 12 Aug 2014 13:28:47 +0000 (UTC) Received: from ache (uid 542) (envelope-from ache@FreeBSD.org) id 6811 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 13:28:46 +0000 From: Andrey A. Chernov Date: Tue, 12 Aug 2014 13:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269875 - head/lib/libpam/modules/pam_opie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea168e.6811.1ab9cea0@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 13:28:47 -0000 Author: ache Date: Tue Aug 12 13:28:46 2014 New Revision: 269875 URL: http://svnweb.freebsd.org/changeset/base/269875 Log: According to opie code and even direct mention in opie(4) challenge buffer size must be OPIE_CHALLENGE_MAX + 1, not OPIE_CHALLENGE_MAX Reviewed by: des MFC after: 1 week Modified: head/lib/libpam/modules/pam_opie/pam_opie.c Modified: head/lib/libpam/modules/pam_opie/pam_opie.c ============================================================================== --- head/lib/libpam/modules/pam_opie/pam_opie.c Tue Aug 12 13:13:11 2014 (r269874) +++ head/lib/libpam/modules/pam_opie/pam_opie.c Tue Aug 12 13:28:46 2014 (r269875) @@ -62,7 +62,7 @@ pam_sm_authenticate(pam_handle_t *pamh, struct passwd *pwd; int retval, i; const char *(promptstr[]) = { "%s\nPassword: ", "%s\nPassword [echo on]: "}; - char challenge[OPIE_CHALLENGE_MAX]; + char challenge[OPIE_CHALLENGE_MAX + 1]; char principal[OPIE_PRINCIPAL_MAX]; const char *user; char *response; From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 14:37:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E9288BE for ; Tue, 12 Aug 2014 14:37:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3287283C for ; Tue, 12 Aug 2014 14:37:33 +0000 (UTC) Received: from dvl (uid 1162) (envelope-from dvl@FreeBSD.org) id 6f1a by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 14:37:33 +0000 From: Dan Langille Date: Tue, 12 Aug 2014 14:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269878 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea26ad.6f1a.1cbf450d@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 14:37:34 -0000 Author: dvl (ports committer) Date: Tue Aug 12 14:37:33 2014 New Revision: 269878 URL: http://svnweb.freebsd.org/changeset/base/269878 Log: Add Dan Langille (myself) to committers-ports.dot file with mat and wg as mentors. Approved by: wg (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Aug 12 14:19:45 2014 (r269877) +++ head/share/misc/committers-ports.dot Tue Aug 12 14:37:33 2014 (r269878) @@ -86,6 +86,7 @@ delphij [label="Xin Li\ndelphij@FreeBSD. demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] +dvl [label="Dan Langille\ndvl@FreeBSD.org\n2014/08/10"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] @@ -424,6 +425,7 @@ makc -> jhale makc -> rakuco mat -> bmah +mat -> dvl mat -> thierry mezz -> tmclaugh @@ -558,6 +560,7 @@ wen -> pawel wg -> alexey wg -> danilo +wg -> dvl wg -> nemysis will -> lioux From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 14:53:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2305AC57 for ; Tue, 12 Aug 2014 14:53:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 114A82A1D for ; Tue, 12 Aug 2014 14:53:04 +0000 (UTC) Received: from emaste (uid 1079) (envelope-from emaste@FreeBSD.org) id 65d0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 14:53:02 +0000 From: Ed Maste Date: Tue, 12 Aug 2014 14:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269879 - in stable/10: . share/examples share/examples/libusb20 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea2a4f.65d0.7621b4e1@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 14:53:04 -0000 Author: emaste Date: Tue Aug 12 14:53:02 2014 New Revision: 269879 URL: http://svnweb.freebsd.org/changeset/base/269879 Log: MFC cleanup of libusb20 example r257779 by hselasky: - Use libusb20_strerror() function instead of custom usb_error() one. - Rename "aux.[ch]" to "util.[ch]" which is a more common name for utility functions and allows checkout on some non-FreeBSD systems where the "aux.*" namespace is reserved. - Fix some compile warnings while at it. r257796 by glebius: Finish r257779. PR: 183728 Added: stable/10/share/examples/libusb20/util.c - copied unchanged from r257779, head/share/examples/libusb20/util.c stable/10/share/examples/libusb20/util.h - copied unchanged from r257779, head/share/examples/libusb20/util.h Deleted: stable/10/share/examples/libusb20/aux.c stable/10/share/examples/libusb20/aux.h Modified: stable/10/ObsoleteFiles.inc stable/10/share/examples/Makefile stable/10/share/examples/libusb20/Makefile stable/10/share/examples/libusb20/bulk.c stable/10/share/examples/libusb20/control.c Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Tue Aug 12 14:37:33 2014 (r269878) +++ stable/10/ObsoleteFiles.inc Tue Aug 12 14:53:02 2014 (r269879) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140812: example files removed +OLD_FILES+=usr/share/examples/libusb20/aux.c +OLD_FILES+=usr/share/examples/libusb20/aux.h # 20140728: Remove an obsolete man page OLD_FILES+=usr/share/man/man9/VOP_GETVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz Modified: stable/10/share/examples/Makefile ============================================================================== --- stable/10/share/examples/Makefile Tue Aug 12 14:37:33 2014 (r269878) +++ stable/10/share/examples/Makefile Tue Aug 12 14:53:02 2014 (r269879) @@ -107,8 +107,8 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/syscall/test/call.c \ libusb20/Makefile \ libusb20/README \ - libusb20/aux.c \ - libusb20/aux.h \ + libusb20/util.c \ + libusb20/util.h \ libusb20/bulk.c \ libusb20/control.c \ libvgl/Makefile \ Modified: stable/10/share/examples/libusb20/Makefile ============================================================================== --- stable/10/share/examples/libusb20/Makefile Tue Aug 12 14:37:33 2014 (r269878) +++ stable/10/share/examples/libusb20/Makefile Tue Aug 12 14:53:02 2014 (r269879) @@ -1,13 +1,14 @@ # $FreeBSD$ TARGETS= bulk control +CFLAGS+= -Wall all: $(TARGETS) -bulk: bulk.o aux.o - $(CC) $(CFLAGS) -o bulk bulk.o aux.o -lusb +bulk: bulk.o util.o + $(CC) $(CFLAGS) -o bulk bulk.o util.o -lusb -control: control.o aux.o - $(CC) $(CFLAGS) -o control control.o aux.o -lusb +control: control.o util.o + $(CC) $(CFLAGS) -o control control.o util.o -lusb clean: rm -f $(TARGETS) *.o *~ Modified: stable/10/share/examples/libusb20/bulk.c ============================================================================== --- stable/10/share/examples/libusb20/bulk.c Tue Aug 12 14:37:33 2014 (r269878) +++ stable/10/share/examples/libusb20/bulk.c Tue Aug 12 14:53:02 2014 (r269879) @@ -41,7 +41,7 @@ #include #include -#include "aux.h" +#include "util.h" /* * If you want to see the details of the internal datastructures @@ -74,7 +74,7 @@ doit(struct libusb20_device *dev) */ if ((rv = libusb20_dev_open(dev, 2)) != 0) { - fprintf(stderr, "libusb20_dev_open: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_dev_open: %s\n", libusb20_strerror(rv)); return; } @@ -84,7 +84,7 @@ doit(struct libusb20_device *dev) */ if ((rv = libusb20_dev_set_config_index(dev, 0)) != 0) { - fprintf(stderr, "libusb20_dev_set_config_index: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_dev_set_config_index: %s\n", libusb20_strerror(rv)); return; } @@ -97,7 +97,7 @@ doit(struct libusb20_device *dev) if (xfr_in == NULL || xfr_out == NULL) { - fprintf(stderr, "libusb20_tr_get_pointer: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_get_pointer: %s\n", libusb20_strerror(rv)); return; } @@ -107,12 +107,12 @@ doit(struct libusb20_device *dev) */ if ((rv = libusb20_tr_open(xfr_out, 0, 1, out_ep)) != 0) { - fprintf(stderr, "libusb20_tr_open: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_open: %s\n", libusb20_strerror(rv)); return; } if ((rv = libusb20_tr_open(xfr_in, 0, 1, in_ep)) != 0) { - fprintf(stderr, "libusb20_tr_open: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_open: %s\n", libusb20_strerror(rv)); return; } @@ -124,7 +124,7 @@ doit(struct libusb20_device *dev) if ((rv = libusb20_tr_bulk_intr_sync(xfr_out, out_buf, out_len, &rlen, TIMEOUT)) != 0) { - fprintf(stderr, "libusb20_tr_bulk_intr_sync (OUT): %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_bulk_intr_sync (OUT): %s\n", libusb20_strerror(rv)); } printf("sent %d bytes\n", rlen); } @@ -132,7 +132,7 @@ doit(struct libusb20_device *dev) if ((rv = libusb20_tr_bulk_intr_sync(xfr_in, in_buf, BUFLEN, &rlen, TIMEOUT)) != 0) { - fprintf(stderr, "libusb20_tr_bulk_intr_sync: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_bulk_intr_sync: %s\n", libusb20_strerror(rv)); } printf("received %d bytes\n", rlen); if (rlen > 0) Modified: stable/10/share/examples/libusb20/control.c ============================================================================== --- stable/10/share/examples/libusb20/control.c Tue Aug 12 14:37:33 2014 (r269878) +++ stable/10/share/examples/libusb20/control.c Tue Aug 12 14:53:02 2014 (r269879) @@ -11,8 +11,6 @@ /* * Simple demo program to illustrate the handling of FreeBSD's * libusb20. - * - * XXX */ /* @@ -38,12 +36,15 @@ #include #include #include +#include #include #include #include +#include "util.h" + /* * If you want to see the details of the internal datastructures * in the debugger, unifdef the following. @@ -86,7 +87,7 @@ doit(struct libusb20_device *dev) */ if ((rv = libusb20_dev_open(dev, 1)) != 0) { - fprintf(stderr, "libusb20_dev_open: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_dev_open: %s\n", libusb20_strerror(rv)); return; } @@ -96,7 +97,7 @@ doit(struct libusb20_device *dev) */ if ((rv = libusb20_dev_set_config_index(dev, 0)) != 0) { - fprintf(stderr, "libusb20_dev_set_config_index: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_dev_set_config_index: %s\n", libusb20_strerror(rv)); return; } @@ -126,7 +127,7 @@ doit(struct libusb20_device *dev) 0 /* flags */)) != 0) { fprintf(stderr, - "libusb20_dev_request_sync: %s\n", usb_error(rv)); + "libusb20_dev_request_sync: %s\n", libusb20_strerror(rv)); } printf("sent %d bytes\n", actlen); if ((setup.bmRequestType & 0x80) != 0) @@ -146,7 +147,7 @@ doit(struct libusb20_device *dev) if (xfr_intr == NULL) { - fprintf(stderr, "libusb20_tr_get_pointer: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_get_pointer: %s\n", libusb20_strerror(rv)); return; } @@ -155,7 +156,7 @@ doit(struct libusb20_device *dev) */ if ((rv = libusb20_tr_open(xfr_intr, 0, 1, intr_ep)) != 0) { - fprintf(stderr, "libusb20_tr_open: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_open: %s\n", libusb20_strerror(rv)); return; } @@ -165,7 +166,7 @@ doit(struct libusb20_device *dev) if ((rv = libusb20_tr_bulk_intr_sync(xfr_intr, in_buf, BUFLEN, &rlen, TIMEOUT)) != 0) { - fprintf(stderr, "libusb20_tr_bulk_intr_sync: %s\n", usb_error(rv)); + fprintf(stderr, "libusb20_tr_bulk_intr_sync: %s\n", libusb20_strerror(rv)); } printf("received %d bytes\n", rlen); if (rlen > 0) Copied: stable/10/share/examples/libusb20/util.c (from r257779, head/share/examples/libusb20/util.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/examples/libusb20/util.c Tue Aug 12 14:53:02 2014 (r269879, copy of r257779, head/share/examples/libusb20/util.c) @@ -0,0 +1,50 @@ +/* ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + */ + +/* + * Helper functions common to all examples + */ + +#include +#include +#include + +#include +#include + +#include "util.h" + +/* + * Print "len" bytes from "buf" in hex, followed by an ASCII + * representation (somewhat resembling the output of hd(1)). + */ +void +print_formatted(uint8_t *buf, uint32_t len) +{ + int i, j; + + for (j = 0; j < len; j += 16) + { + printf("%02x: ", j); + + for (i = 0; i < 16 && i + j < len; i++) + printf("%02x ", buf[i + j]); + printf(" "); + for (i = 0; i < 16 && i + j < len; i++) + { + uint8_t c = buf[i + j]; + if(c >= ' ' && c <= '~') + printf("%c", (char)c); + else + putchar('.'); + } + putchar('\n'); + } +} Copied: stable/10/share/examples/libusb20/util.h (from r257779, head/share/examples/libusb20/util.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/examples/libusb20/util.h Tue Aug 12 14:53:02 2014 (r269879, copy of r257779, head/share/examples/libusb20/util.h) @@ -0,0 +1,14 @@ +/* ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42) (by Poul-Henning Kamp): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch + * ---------------------------------------------------------------------------- + * + * $FreeBSD$ + */ + +#include +#include + +void print_formatted(uint8_t *buf, uint32_t len); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 16:51:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F297E0B for ; Tue, 12 Aug 2014 16:51:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 705E32A6C for ; Tue, 12 Aug 2014 16:51:38 +0000 (UTC) Received: from marck (uid 1030) (envelope-from marck@FreeBSD.org) id 60c6 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 16:51:38 +0000 From: Dmitry Morozovsky Date: Tue, 12 Aug 2014 16:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269882 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea461a.60c6.292325be@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 16:51:38 -0000 Author: marck (doc committer) Date: Tue Aug 12 16:51:37 2014 New Revision: 269882 URL: http://svnweb.freebsd.org/changeset/base/269882 Log: (belatedly) Document FreeBSD 9.3-R MFC after: 1 week M misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Aug 12 16:08:13 2014 (r269881) +++ head/share/misc/bsd-family-tree Tue Aug 12 16:51:37 2014 (r269882) @@ -291,21 +291,21 @@ FreeBSD 5.2 | | | | | | | | | | FreeBSD | | NetBSD 6.1.2 | | | 9.2 Mac OS X | | | | - | 10.9 | | OpenBSD 5.4 | - | | | | | DragonFly 3.6.0 - | | | | | | - *--FreeBSD | | NetBSD 6.1.3 | | - | 10.0 | | | | | - | | | | | DragonFly 3.6.1 - | | | | | | - | | | | | | - | | | | | DragonFly 3.6.2 - | | | NetBSD 6.1.4 | | - | | | | | - | | | OpenBSD 5.5 | - | | | | DragonFly 3.8.0 - | | | | | - | | | | | + | | 10.9 | | OpenBSD 5.4 | + | `-----. | | | | DragonFly 3.6.0 + | \ | | | | | + *--FreeBSD | | | NetBSD 6.1.3 | | + | 10.0 | | | | | | + | | | | | | DragonFly 3.6.1 + | | | | | | | + | | | | | | | + | | | | | | DragonFly 3.6.2 + | | | | NetBSD 6.1.4 | | + | | | | | | + | | | | OpenBSD 5.5 | + | | | | | DragonFly 3.8.0 + | FreeBSD | | | | + | 9.3 | | | | | | | | | | | | | | | | | | | @@ -640,6 +640,7 @@ NetBSD 6.0.5 2014-04-19 [NDB] NetBSD 6.1.4 2014-04-19 [NDB] OpenBSD 5.5 2014-05-01 [OBD] DragonFly 3.8.0 2014-06-04 [DFB] +FreeBSD 9.3 2014-07-05 [FBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 18:05:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 665287AF for ; Tue, 12 Aug 2014 18:05:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A18AB3719 for ; Tue, 12 Aug 2014 17:56:48 +0000 (UTC) Received: from dim (uid 1236) (envelope-from dim@FreeBSD.org) id 6840 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 17:56:48 +0000 From: Dimitry Andric Date: Tue, 12 Aug 2014 17:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269885 - stable/10/lib/libproc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea5560.6840.ea7a307@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 18:05:25 -0000 Author: dim Date: Tue Aug 12 17:56:48 2014 New Revision: 269885 URL: http://svnweb.freebsd.org/changeset/base/269885 Log: MFC r269750: In r268463, I misplaced a return in demangle(), causing the function to erroneously skip symbols that were not mangled at all. Fix this by moving the return into the preceding if block. While here, simplify the code by letting __cxa_demangle() allocate the needed space for the demangled symbol. This also fixes a memory leak, which would occur whenever __cxa_demangle() failed. Reported by: pgj PR: base/191981 Modified: stable/10/lib/libproc/proc_sym.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libproc/proc_sym.c ============================================================================== --- stable/10/lib/libproc/proc_sym.c Tue Aug 12 17:51:26 2014 (r269884) +++ stable/10/lib/libproc/proc_sym.c Tue Aug 12 17:56:48 2014 (r269885) @@ -57,21 +57,15 @@ demangle(const char *symbol, char *buf, { #ifndef NO_CXA_DEMANGLE char *dembuf; - size_t demlen; if (symbol[0] == '_' && symbol[1] == 'Z' && symbol[2]) { - dembuf = malloc(len); - if (!dembuf) - goto fail; - demlen = len; - dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL); + dembuf = __cxa_demangle(symbol, NULL, NULL, NULL); if (!dembuf) goto fail; strlcpy(buf, dembuf, len); free(dembuf); + return; } - - return; fail: #endif /* NO_CXA_DEMANGLE */ strlcpy(buf, symbol, len); From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 18:10:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 041CC587 for ; Tue, 12 Aug 2014 18:10:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127FF3599 for ; Tue, 12 Aug 2014 17:51:27 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 6328 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 17:51:26 +0000 From: Garrett Cooper Date: Tue, 12 Aug 2014 17:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269884 - in head: tools/build/mk usr.bin/yacc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea541e.6328.217eee9b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 18:10:31 -0000 Author: ngie Date: Tue Aug 12 17:51:26 2014 New Revision: 269884 URL: http://svnweb.freebsd.org/changeset/base/269884 Log: Complete the usr.bin/yacc kyua integration work I originally submitted via r268811 - Install the Kyuafile by adding FILES to FILESGROUPS - Run the testcases with an unprivileged user Some of the testcases depend upon behavior that's broken when run as root on FreeBSD because of how permissions are treated with access(2) vs eaccess(2), open(2), etc - Simplify the test driver to just inspect the exit code from run_test because it now exits with 0 if successful and exits with !0 if unsuccessful - Don't do ad hoc temporary directory creation/deletion; let Kyua handle that - Add entries for files removed in r268811 to OptionalObsoleteFiles.inc PR: 191020 X-MFC with: r268811 Approved by: jmmv (mentor) Reviewed by: bapt Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/yacc/tests/Makefile head/usr.bin/yacc/tests/yacc_tests.sh Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Aug 12 17:03:13 2014 (r269883) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Aug 12 17:51:26 2014 (r269884) @@ -4575,6 +4575,24 @@ OLD_DIRS+=usr/tests/usr.bin/make/archive OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_44bsd OLD_DIRS+=usr/tests/usr.bin/make/archives OLD_DIRS+=usr/tests/usr.bin/make +OLD_FILES+=usr/tests/usr.bin/yacc/legacy_test +OLD_FILES+=usr/tests/usr.bin/yacc/regress.00.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.01.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.02.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.03.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.04.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.05.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.06.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.07.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.08.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.09.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.10.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.11.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.12.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.13.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.14.out +OLD_FILES+=usr/tests/usr.bin/yacc/regress.sh +OLD_FILES+=usr/tests/usr.bin/yacc/undefined.y .endif .else # ATF libraries. Modified: head/usr.bin/yacc/tests/Makefile ============================================================================== --- head/usr.bin/yacc/tests/Makefile Tue Aug 12 17:03:13 2014 (r269883) +++ head/usr.bin/yacc/tests/Makefile Tue Aug 12 17:51:26 2014 (r269884) @@ -9,11 +9,15 @@ TEST_DIR= ${.CURDIR}/../../../contrib/by TESTSDIR= ${TESTSBASE}/usr.bin/yacc PLAIN_TESTS_SH= yacc_tests +# NOTE: due to caveats with how permissions are handled on FreeBSD +# with root, this must be run as a non-privileged user; otherwise +# the testcases will fail unexpectedly. +TEST_METADATA.yacc_tests+= required_user="unprivileged" SCRIPTS= run_test SCRIPTSDIR= ${TESTSDIR} -FILESGROUPS= FILEStest FILEStest_yacc +FILESGROUPS= FILES FILEStest FILEStest_yacc FILEStestDIR= ${TESTSDIR} @@ -245,36 +249,30 @@ FILEStest_yacc+= help.error FILEStest_yacc+= help.output FILEStest_yacc+= no_b_opt.error FILEStest_yacc+= no_b_opt.output -# XXX: expected: `f - cannot open "nosuchfile.c"; gets -# `e - line 0 of "nosuchfile.y", unexpected end-of-file`. -#FILEStest_yacc+= no_b_opt1.error -#FILEStest_yacc+= no_b_opt1.output -#FILEStest_yacc+= no_code_c.error -#FILEStest_yacc+= no_code_c.output -#FILEStest_yacc+= no_defines.error -#FILEStest_yacc+= no_defines.output -#FILEStest_yacc+= no_graph.error -#FILEStest_yacc+= no_graph.output -#FILEStest_yacc+= no_include.error -#FILEStest_yacc+= no_include.output +FILEStest_yacc+= no_b_opt1.error +FILEStest_yacc+= no_b_opt1.output +FILEStest_yacc+= no_code_c.error +FILEStest_yacc+= no_code_c.output +FILEStest_yacc+= no_defines.error +FILEStest_yacc+= no_defines.output +FILEStest_yacc+= no_graph.error +FILEStest_yacc+= no_graph.output +FILEStest_yacc+= no_include.error +FILEStest_yacc+= no_include.output FILEStest_yacc+= no_opts.error FILEStest_yacc+= no_opts.output -# XXX: expected: `f - cannot open "nosuchfile.c"; gets -# `e - line 0 of "nosuchfile.y", unexpected end-of-file`. -#FILEStest_yacc+= no_output.error -#FILEStest_yacc+= no_output.output -#FILEStest_yacc+= no_output1.error -#FILEStest_yacc+= no_output1.output +FILEStest_yacc+= no_output.error +FILEStest_yacc+= no_output.output +FILEStest_yacc+= no_output1.error +FILEStest_yacc+= no_output1.output FILEStest_yacc+= no_output2.error FILEStest_yacc+= no_output2.output FILEStest_yacc+= no_p_opt.error FILEStest_yacc+= no_p_opt.output -# XXX: expected: `f - cannot open "nosuchfile.c"; gets -# `e - line 0 of "nosuchfile.y", unexpected end-of-file`. -#FILEStest_yacc+= no_p_opt1.error -#FILEStest_yacc+= no_p_opt1.output -#FILEStest_yacc+= no_verbose.error -#FILEStest_yacc+= no_verbose.output +FILEStest_yacc+= no_p_opt1.error +FILEStest_yacc+= no_p_opt1.output +FILEStest_yacc+= no_verbose.error +FILEStest_yacc+= no_verbose.output FILEStest_yacc+= nostdin.error FILEStest_yacc+= nostdin.output FILEStest_yacc+= ok_syntax1.error Modified: head/usr.bin/yacc/tests/yacc_tests.sh ============================================================================== --- head/usr.bin/yacc/tests/yacc_tests.sh Tue Aug 12 17:03:13 2014 (r269883) +++ head/usr.bin/yacc/tests/yacc_tests.sh Tue Aug 12 17:51:26 2014 (r269884) @@ -3,22 +3,15 @@ set -e -cd $(dirname $0) +# Setup the environment for run_test +# - run_test looks for `#define YYBTYACC` in ../config.h +# - run_test assumes a yacc binary exists in ../yacc instead of running "yacc" +# - run_test spams the test dir with files (polluting subsequent test runs), +# so it's better to copy all the files to a temporary directory created by +# kyua +echo > "./config.h" +mkdir "test" +cp -Rf "$(dirname "$0")"/* "test" +cp -p /usr/bin/yacc ./yacc -TMPDIR=$(mktemp -d /tmp/tmp.XXXXXXXX) -TEST_DIR="$TMPDIR/test" -trap "cd /; rm -Rf $TMPDIR" EXIT INT TERM - -# Setup the environment for run_test.sh -mkdir -p "$TEST_DIR" -cp -Rf * "$TEST_DIR/." -echo > "$TMPDIR/config.h" -ln /usr/bin/yacc $TMPDIR/yacc - -log=$TMPDIR/run_test.log -(cd $TEST_DIR && ./run_test 2>&1 && : > run_test.ok) | tee $log -if [ -f run_test.ok ] && ! egrep "^...(diff|not found)[^\*]+$" $log; then - exit 0 -else - exit 1 -fi +cd "test" && ./run_test From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 18:22:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8AD2BF1 for ; Tue, 12 Aug 2014 18:22:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B07AF3C7A for ; Tue, 12 Aug 2014 18:22:57 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 6268 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 18:22:57 +0000 From: John Baldwin Date: Tue, 12 Aug 2014 18:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269887 - head/sys/i386/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea5b81.6268.53f25d4c@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 18:22:57 -0000 Author: jhb Date: Tue Aug 12 18:22:57 2014 New Revision: 269887 URL: http://svnweb.freebsd.org/changeset/base/269887 Log: Correct a comment brought over from amd64. i386 doesn't use long mode. Modified: head/sys/i386/acpica/acpi_wakecode.S Modified: head/sys/i386/acpica/acpi_wakecode.S ============================================================================== --- head/sys/i386/acpica/acpi_wakecode.S Tue Aug 12 18:02:10 2014 (r269886) +++ head/sys/i386/acpica/acpi_wakecode.S Tue Aug 12 18:22:57 2014 (r269887) @@ -151,14 +151,7 @@ wakeup_32: movl wakeup_cr3 - wakeup_start(%ebx), %eax mov %eax, %cr3 - /* - * Finally, switch to long bit mode by enabling paging. We have - * to be very careful here because all the segmentation disappears - * out from underneath us. The spec says we can depend on the - * subsequent pipelined branch to execute, but *only if* everthing - * is still identity mapped. If any mappings change, the pipeline - * will flush. - */ + /* Enable paging. */ mov %cr0, %eax orl $CR0_PG, %eax mov %eax, %cr0 From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 19:37:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4CBFDA2; Tue, 12 Aug 2014 19:37:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BACF125CA; Tue, 12 Aug 2014 19:37:09 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AB870B949; Tue, 12 Aug 2014 15:37:08 -0400 (EDT) From: John Baldwin To: Peter Wemm Subject: Re: svn commit: r269847 - in stable/10: contrib/apr contrib/apr/docs contrib/apr/encoding contrib/apr/file_io/unix contrib/apr/include contrib/apr/include/arch/unix contrib/apr/include/private contrib/... Date: Tue, 12 Aug 2014 11:19:31 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53e9707c.2d6c.2d976b@svn.freebsd.org> In-Reply-To: <53e9707c.2d6c.2d976b@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201408121119.32037.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 12 Aug 2014 15:37:08 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 19:37:10 -0000 On Monday, August 11, 2014 9:40:12 pm Peter Wemm wrote: > Author: peter > Date: Tue Aug 12 01:40:11 2014 > New Revision: 269847 > URL: http://svnweb.freebsd.org/changeset/base/269847 > > Log: > MFC r266728,266731,266735,266736,268135,268960,269833 > Update apr 1.4.8 -> 1.5.1 > Update apr-util 1.5.2 -> 1.5.3 > Update serf 1.3.4 -> 1.3.7 > Update svnlite 1.8.8 -> 1.8.10 > Deal with svnlite.1 manpage. Isn't this merge a little quick? 1.8.10 only went into head about 6 hours before this commit. The 1.8.8 merge to 10 was also rather quick (less than an hour after it was merged to HEAD). If the security issues noted in the commit for HEAD are severe enough to warrant an immediate merge, then there should probably be an advisory. Otherwise, I think svn updates should probably have some bake time in HEAD before going to stable. (As an aside, I didn't get a commit mail for 269833 for some reason) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 19:37:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 366E11EF for ; Tue, 12 Aug 2014 19:37:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267F625EB for ; Tue, 12 Aug 2014 19:37:50 +0000 (UTC) Received: from gjb (uid 1237) (envelope-from gjb@FreeBSD.org) id 6e82 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 19:37:50 +0000 From: Glen Barber Date: Tue, 12 Aug 2014 19:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269888 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea6d0e.6e82.5981b44f@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 19:37:50 -0000 Author: gjb Date: Tue Aug 12 19:37:49 2014 New Revision: 269888 URL: http://svnweb.freebsd.org/changeset/base/269888 Log: Fix a typo in a comment: s/interprete/interpret/ Submitted by: Sam Fourman Jr. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Aug 12 18:22:57 2014 (r269887) +++ head/sbin/ifconfig/ifconfig.c Tue Aug 12 19:37:49 2014 (r269888) @@ -78,7 +78,7 @@ static const char rcsid[] = /* * Since "struct ifreq" is composed of various union members, callers - * should pay special attention to interprete the value. + * should pay special attention to interpret the value. * (.e.g. little/big endian difference in the structure.) */ struct ifreq ifr; From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 19:57:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0DDBEB3 for ; Tue, 12 Aug 2014 19:57:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A782D2844 for ; Tue, 12 Aug 2014 19:57:12 +0000 (UTC) Received: from jilles (uid 1200) (envelope-from jilles@FreeBSD.org) id 6760 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 19:57:12 +0000 From: Jilles Tjoelker Date: Tue, 12 Aug 2014 19:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269890 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea7198.6760.21dd1ae1@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 19:57:12 -0000 Author: jilles Date: Tue Aug 12 19:57:12 2014 New Revision: 269890 URL: http://svnweb.freebsd.org/changeset/base/269890 Log: MFC r264417: realpath(): Properly fail "." or ".." components after non-directories. If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..", it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as they should. Also, put the check for non-directories after lstatting the previous component instead of when the empty component (consecutive or trailing slashes) is detected, saving an lstat() call and some lines of code. PR: kern/82980 Modified: stable/9/lib/libc/stdlib/realpath.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/realpath.c ============================================================================== --- stable/9/lib/libc/stdlib/realpath.c Tue Aug 12 19:56:26 2014 (r269889) +++ stable/9/lib/libc/stdlib/realpath.c Tue Aug 12 19:57:12 2014 (r269890) @@ -132,26 +132,7 @@ realpath(const char * __restrict path, c resolved[resolved_len] = '\0'; } if (next_token[0] == '\0') { - /* - * Handle consequential slashes. The path - * before slash shall point to a directory. - * - * Only the trailing slashes are not covered - * by other checks in the loop, but we verify - * the prefix for any (rare) "//" or "/\0" - * occurence to not implement lookahead. - */ - if (lstat(resolved, &sb) != 0) { - if (m) - free(resolved); - return (NULL); - } - if (!S_ISDIR(sb.st_mode)) { - if (m) - free(resolved); - errno = ENOTDIR; - return (NULL); - } + /* Handle consequential slashes. */ continue; } else if (strcmp(next_token, ".") == 0) @@ -236,6 +217,11 @@ realpath(const char * __restrict path, c } } left_len = strlcpy(left, symlink, sizeof(left)); + } else if (!S_ISDIR(sb.st_mode) && p != NULL) { + if (m) + free(resolved); + errno = ENOTDIR; + return (NULL); } } From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 20:23:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C2D864E; Tue, 12 Aug 2014 20:23:23 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB8A2CE1; Tue, 12 Aug 2014 20:23:23 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 5E5D0133; Tue, 12 Aug 2014 13:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1407875002; bh=AslV9J+mZTOmX89TO/2Iqs2yQ6XiX/Qb6e5k78itR6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KUBibtRHW5eTkmThX3lZlzAvqRZXkCQ5X45jkyJKq2h8/SZE+nIM/LrzocJBnTjlx XSML60WanRg89jlNfYfxBqXuLcekRKVpIcGMzFj+/nR2yRliL3MaIWEo6exkmxV0PH O2TQlrOwnF4ioYj/FXEofHPmLBe/OmBnbT2P6a4A= From: Peter Wemm To: John Baldwin Subject: Re: svn commit: r269847 - in stable/10: contrib/apr contrib/apr/docs contrib/apr/encoding contrib/apr/file_io/unix contrib/apr/include contrib/apr/include/arch/unix contrib/apr/include/private contrib/... Date: Tue, 12 Aug 2014 13:23:16 -0700 Message-ID: <5874043.odmAkWF3cI@overcee.wemm.org> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: <201408121119.32037.jhb@freebsd.org> References: <53e9707c.2d6c.2d976b@svn.freebsd.org> <201408121119.32037.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2541638.batFbtmx7p"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 12 Aug 2014 20:23:23 -0000 --nextPart2541638.batFbtmx7p Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Tuesday 12 August 2014 11:19:31 John Baldwin wrote: > On Monday, August 11, 2014 9:40:12 pm Peter Wemm wrote: > > Author: peter > > Date: Tue Aug 12 01:40:11 2014 > > New Revision: 269847 > > URL: http://svnweb.freebsd.org/changeset/base/269847 > >=20 > > Log: > > MFC r266728,266731,266735,266736,268135,268960,269833 > > =20 > > Update apr 1.4.8 -> 1.5.1 > > Update apr-util 1.5.2 -> 1.5.3 > > Update serf 1.3.4 -> 1.3.7 > > Update svnlite 1.8.8 -> 1.8.10 > > Deal with svnlite.1 manpage. >=20 > Isn't this merge a little quick? 1.8.10 only went into head about 6 = hours > before this commit. The 1.8.8 merge to 10 was also rather quick (les= s than > an hour after it was merged to HEAD). If the security issues noted i= n the > commit for HEAD are severe enough to warrant an immediate merge, then= there > should probably be an advisory. Otherwise, I think svn updates shoul= d > probably have some bake time in HEAD before going to stable. The jumbo-MFC was mostly to gather up the updates that have been baking= in=20 head for a while. 10.1 is coming up soon. It just seemed silly to MFC everything except a specific, targeted secu= rity fix. =20 I suspect that for every question I got about including the security up= date,=20 I'd have received 5 times as many asking why I hadn't included it. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2541638.batFbtmx7p Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABAgAGBQJT6ne5AAoJEDXWlwnsgJ4E5fEH/AtGeI60XUb2EWHRlIiS5WSm keGZlWJjaTV5VbtogcE+dyBsrppPCD68h80EWFbmX+nbi+Nn7E0pHE7yz+BBJwLW Wn4P/Qkc9R7/Ogdti9DqA6gNYPdz0E4/gaKsj3KxfHIRvSK8t9RCVmvQj0rhjQ6g GTEfpG591tGo8jwSbDmODh4YNfNfpGfRJZKdAZcFMND/01tNZ/WqENfRikc1pjno 3jvk9DLucYPg3plWGNt8WIqhcJMxfOt7q4H5vQe8/yH6c7inT6kQJLyWbMk1X1qH VLIg4P6OpS/H2i4Qxfk9Zv3a5usjOd1iYg34rurhl+LfJ9yhjarctVuiWjJye0c= =Jj5C -----END PGP SIGNATURE----- --nextPart2541638.batFbtmx7p-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 20:29:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21EADA93 for ; Tue, 12 Aug 2014 20:29:26 +0000 (UTC) Received: from nm22-vm1.bullet.mail.bf1.yahoo.com (nm22-vm1.bullet.mail.bf1.yahoo.com [98.139.212.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA1DF2D5E for ; Tue, 12 Aug 2014 20:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1407875358; bh=zh8OwqYvmarQkC6zdvKCeZ5YG/0rMcT84pLElNbjuSo=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=qORS+HAYb++XGrkjjw4PPsWrV2B/H4I3fJejK0jV7DNLx514P81js2nv6IEph9ddbfIQ2i6LsHK1JS0OYTRFF+SfLmQRCUiHae35jnA2c5GCUOxj1uFJ9jGqER7W9ReqwjTN7ya8LUYQE9buYnzG9haH86JjQWu6aEp1VZX7qtGCovx/We+jtMrQwDe/0psyjXHMaiN+EBRfXS9s/KvLSLtNKei9mWfvU147wR6J/dMitiVJWMLXKYqSshdzyCExNRbQ1yWaXgl/rLgOcI7sJmIBcbn7v/gu4apQ8IlV/aqM9V079Y8exgvAvH+yssTYy/pzjLjmpoOoYy0iXdMa5g== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=pEqz0s8QUEwneHW8oxJZ0eSHTsM77U5PeAUXC+SfZ4VknhZ5DAfj9bsGB3S1U4ENfi87FzfnLvcowOXYHJOzy/OdNISeEaLErq7CHVQ4UmDE0tLN180HtJ9tyEymvFu6Dk9M3UTAC8VKDNXEm67FPkqcy41DY3eShyQwOoS2EJd+dbgqFyRzuXZXViFCaoW1sU3vzY/ir6QTdxd7DAjHRYsgUhqSSUr12wYVRy8eZoy03fSmOGjKb+rK4DSJhT2YQ7CSRb963fOwpoYR9Ws1vj7Gr3iAdX6Q76fdUwJMVp1i5hgKNl0hvePIXru2A63VfLvhV2nIeQj3sjZi8SbB9g==; Received: from [98.139.212.150] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 12 Aug 2014 20:29:18 -0000 Received: from [68.142.230.64] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 12 Aug 2014 20:29:18 -0000 Received: from [127.0.0.1] by smtp221.mail.bf1.yahoo.com with NNFMP; 12 Aug 2014 20:29:18 -0000 X-Yahoo-Newman-Id: 624854.82764.bm@smtp221.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Ijw7zOQVM1lIObjRQkW.Mkc4opgPgkehBpdpul7Tjf3Amxx k9Ds0e1VPaOW9XqC_ZF0iSQpWDW.fKHQ5qn6LvOgW4lhbpiQMet9ZpTtz5sN g9M83vdOtQVA3bErs2vgqoufOjqW3cA92qMp3Ji3UmpMevIY4fJbbGfTcuGg LQmtxrIRL_k3nVttcvkkPB6pu.lDJAbXr6QSCzREMwLCA6uFF0EeAgodoyZY V8q0NYh1Maztwin8p5ry3t3WMV7HrllK.7MPIXe833QOh8LVy7B5d0gRAGb6 D8WWf_VtDQat76jWC48M2GrxO3Rx8tjzVqa1VORhDQXtQH_tfFeV7RbGhjWD 3S5cyMLJ4HFcbJNdsmew.i9duf2YYQp11m7xBhZOBDRPXBvEtZzlH6IOxznL EsbJCcz0skFkK_ZaOxpyfXjPTWfSqSErpfQobeVWU_NZSdXXvR3grP6GRP1V LO5YM__EwnkKOTO21L3B7aLI15ZsuzXT6V25IforvyI9Ov3PFAOS9jixDLlY ko4ui6FQV2QdgDzYBho9ki_PkOu6FwzQ2ha5e9dv0dOCeBVNqDgAbLbaDE98 jMLT_R4FygiEWuG3NRiXHGlw7.apVDPvQuRBcoxnYzx4ZHRNgKZVh0ZSUSB5 6EE4q X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269873 - head/lib/libc/nameser From: Pedro Giffuni In-Reply-To: <53ea120c.6165.1de1e179@svn.freebsd.org> Date: Tue, 12 Aug 2014 15:29:14 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <7608F6C6-3E7C-4D0B-B71A-BBFED422C7B6@freebsd.org> References: <53ea120c.6165.1de1e179@svn.freebsd.org> To: Hajimu UMEMOTO X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 20:29:26 -0000 Il giorno 12/ago/2014, alle ore 08:09, Hajimu UMEMOTO = ha scritto: > Author: ume > Date: Tue Aug 12 13:09:32 2014 > New Revision: 269873 > URL: http://svnweb.freebsd.org/changeset/base/269873 >=20 > Log: > Fix broken pointer overflow check ns_name_unpack() >=20 > Many compilers may optimize away the overflow check `msg + l < msg', > where `msg' is a pointer and `l' is an integer, because pointer > overflow is undefined behavior in C. >=20 > Use a safe precondition test `l >=3D eom - msg' instead. >=20 > Reference: > https://android-review.googlesource.com/#/c/50570/ >=20 > Requested by: pfg > Obtained from: NetBSD (CVS rev. 1.10) >=20 Thanks! Pedro.= From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 23:48:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B4C5B5E; Tue, 12 Aug 2014 23:48:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 385CC27BB; Tue, 12 Aug 2014 23:48:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7CNmcaE045935; Tue, 12 Aug 2014 23:48:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7CNmb06045934; Tue, 12 Aug 2014 23:48:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408122348.s7CNmb06045934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 Aug 2014 23:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269895 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 23:48:38 -0000 Author: imp Date: Tue Aug 12 23:48:37 2014 New Revision: 269895 URL: http://svnweb.freebsd.org/changeset/base/269895 Log: Truncate the ctfmerge command line, like we do with SYSTEM_LD. Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Aug 12 21:51:31 2014 (r269894) +++ head/sys/conf/kern.post.mk Tue Aug 12 23:48:37 2014 (r269895) @@ -126,7 +126,8 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o ${MF @echo linking ${.TARGET} ${SYSTEM_LD} .if ${MK_CTF} != "no" - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o + @echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ... + @${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o .endif .if !defined(DEBUG) ${OBJCOPY} --strip-debug ${.TARGET} From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 00:14:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 908BD131; Wed, 13 Aug 2014 00:14:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D7332A61; Wed, 13 Aug 2014 00:14:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D0ER7R059837; Wed, 13 Aug 2014 00:14:27 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D0ER3j059836; Wed, 13 Aug 2014 00:14:27 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201408130014.s7D0ER3j059836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 13 Aug 2014 00:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269896 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 00:14:27 -0000 Author: neel Date: Wed Aug 13 00:14:26 2014 New Revision: 269896 URL: http://svnweb.freebsd.org/changeset/base/269896 Log: Minor cleanup: - Set 'pirq_cold' to '0' on the first PIRQ allocation. - Make assertions stronger. Reviewed by: jhb CR: https://phabric.freebsd.org/D592 Modified: head/usr.sbin/bhyve/pci_irq.c Modified: head/usr.sbin/bhyve/pci_irq.c ============================================================================== --- head/usr.sbin/bhyve/pci_irq.c Tue Aug 12 23:48:37 2014 (r269895) +++ head/usr.sbin/bhyve/pci_irq.c Wed Aug 13 00:14:26 2014 (r269896) @@ -115,7 +115,7 @@ void pci_irq_reserve(int irq) { - assert(irq < nitems(irq_counts)); + assert(irq >= 0 && irq < nitems(irq_counts)); assert(pirq_cold); assert(irq_counts[irq] == 0 || irq_counts[irq] == IRQ_DISABLED); irq_counts[irq] = IRQ_DISABLED; @@ -125,10 +125,10 @@ void pci_irq_use(int irq) { - assert(irq < nitems(irq_counts)); + assert(irq >= 0 && irq < nitems(irq_counts)); assert(pirq_cold); - if (irq_counts[irq] != IRQ_DISABLED) - irq_counts[irq]++; + assert(irq_counts[irq] != IRQ_DISABLED); + irq_counts[irq]++; } void @@ -197,7 +197,7 @@ pirq_alloc_pin(struct vmctx *ctx) { int best_count, best_irq, best_pin, irq, pin; - pirq_cold = 1; + pirq_cold = 0; /* First, find the least-used PIRQ pin. */ best_pin = 0; @@ -222,7 +222,7 @@ pirq_alloc_pin(struct vmctx *ctx) best_count = irq_counts[irq]; } } - assert(best_irq != 0); + assert(best_irq >= 0); irq_counts[best_irq]++; pirqs[best_pin].reg = best_irq; vm_isa_set_irq_trigger(ctx, best_irq, LEVEL_TRIGGER); @@ -234,9 +234,6 @@ pirq_alloc_pin(struct vmctx *ctx) int pirq_irq(int pin) { - - if (pin == -1) - return (255); assert(pin > 0 && pin <= nitems(pirqs)); return (pirqs[pin - 1].reg & PIRQ_IRQ); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 00:18:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0682535C; Wed, 13 Aug 2014 00:18:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A112A8B; Wed, 13 Aug 2014 00:18:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D0IGBT060420; Wed, 13 Aug 2014 00:18:16 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D0IG7W060419; Wed, 13 Aug 2014 00:18:16 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201408130018.s7D0IG7W060419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 13 Aug 2014 00:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269897 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 00:18:17 -0000 Author: neel Date: Wed Aug 13 00:18:16 2014 New Revision: 269897 URL: http://svnweb.freebsd.org/changeset/base/269897 Log: Fix typo when displaying the HPET timer unit number. Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Aug 13 00:14:26 2014 (r269896) +++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 13 00:18:16 2014 (r269897) @@ -558,7 +558,8 @@ hpet_attach(device_t dev) device_get_parent(device_get_parent(dev)), dev, &t->irq))) { device_printf(dev, - "Can't allocate interrupt for t%d.\n", j); + "Can't allocate interrupt for t%d: %d\n", + i, j); } } #endif From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 01:27:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14013744; Wed, 13 Aug 2014 01:27:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB5A822CA; Wed, 13 Aug 2014 01:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D1Rq8O091552; Wed, 13 Aug 2014 01:27:52 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D1RqcR091549; Wed, 13 Aug 2014 01:27:52 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201408130127.s7D1RqcR091549@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 13 Aug 2014 01:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269899 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 01:27:53 -0000 Author: rpaulo Date: Wed Aug 13 01:27:51 2014 New Revision: 269899 URL: http://svnweb.freebsd.org/changeset/base/269899 Log: Make sure the DTrace header files are built before depend and before the build starts. This adds a new variable DHDRS that contains a list of all DTrace header files. Then, we use the beforedepend hook to make sure the heaeder files are built. Introduce a beforebuild dependency (from projects/bmake) based on feedback from Simon J. Gerraty. This lets us generate the header files without running make depend. Reviewed by: sjg, imp MFC after: 3 days Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Aug 13 00:19:18 2014 (r269898) +++ head/share/mk/bsd.dep.mk Wed Aug 13 01:27:51 2014 (r269899) @@ -129,6 +129,7 @@ CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR .endif .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} +DHDRS+= ${_D}.h ${_D}.h: ${_DSRC} ${DTRACE} -xnolibs -h -s ${.ALLSRC} SRCS:= ${SRCS:S/${_DSRC}/${_D}.h/} @@ -148,6 +149,8 @@ ${_D}.po: ${_D}.h ${POBJS:S/${_D}.po//} .endif .endfor .endfor +beforedepend: ${DHDRS} +beforebuild: ${DHDRS} .endif .if !target(depend) Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Aug 13 00:19:18 2014 (r269898) +++ head/share/mk/bsd.lib.mk Wed Aug 13 01:27:51 2014 (r269899) @@ -118,7 +118,8 @@ PO_FLAG=-pg ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -all: objwarn +all: beforebuild .WAIT +beforebuild: objwarn .if defined(PRIVATELIB) _LIBDIR:=${LIBPRIVATEDIR} Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Aug 13 00:19:18 2014 (r269898) +++ head/share/mk/bsd.prog.mk Wed Aug 13 01:27:51 2014 (r269899) @@ -159,7 +159,8 @@ MAN1= ${MAN} .endif .endif # defined(PROG) -all: objwarn ${PROG} ${SCRIPTS} +all: beforebuild .WAIT ${PROG} ${SCRIPTS} +beforebuild: objwarn .if ${MK_MAN} != "no" all: _manpages .endif From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 01:43:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20E23F7E; Wed, 13 Aug 2014 01:43:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7532256E; Wed, 13 Aug 2014 01:43:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D1hcGE099870; Wed, 13 Aug 2014 01:43:38 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D1hcPx099869; Wed, 13 Aug 2014 01:43:38 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201408130143.s7D1hcPx099869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 13 Aug 2014 01:43: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: r269900 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 01:43:39 -0000 Author: marcel Date: Wed Aug 13 01:43:38 2014 New Revision: 269900 URL: http://svnweb.freebsd.org/changeset/base/269900 Log: MFC 269745: Create a redundant grain directory and table. Modified: stable/10/usr.bin/mkimg/vmdk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/vmdk.c ============================================================================== --- stable/10/usr.bin/mkimg/vmdk.c Wed Aug 13 01:27:51 2014 (r269899) +++ stable/10/usr.bin/mkimg/vmdk.c Wed Aug 13 01:43:38 2014 (r269900) @@ -110,7 +110,7 @@ static int vmdk_write(int fd) { struct vmdk_header hdr; - uint32_t *gt, *gd; + uint32_t *gt, *gd, *rgd; char *buf, *desc; off_t cur, lim; uint64_t imagesz; @@ -143,25 +143,37 @@ vmdk_write(int fd) le32enc(&hdr.ngtes, VMDK_NGTES); sec = desc_len / VMDK_SECTOR_SIZE + 1; - le64enc(&hdr.rgd_offset, sec); - le64enc(&hdr.gd_offset, sec); ngrains = imagesz / grainsz; ngts = (ngrains + VMDK_NGTES - 1) / VMDK_NGTES; gdsz = (ngts * sizeof(uint32_t) + VMDK_SECTOR_SIZE - 1) & ~(VMDK_SECTOR_SIZE - 1); + gd = calloc(gdsz, 1); if (gd == NULL) { free(desc); return (ENOMEM); } - + le64enc(&hdr.gd_offset, sec); sec += gdsz / VMDK_SECTOR_SIZE; for (n = 0; n < ngts; n++) { le32enc(gd + n, sec); sec += VMDK_NGTES * sizeof(uint32_t) / VMDK_SECTOR_SIZE; } + rgd = calloc(gdsz, 1); + if (rgd == NULL) { + free(gd); + free(desc); + return (ENOMEM); + } + le64enc(&hdr.rgd_offset, sec); + sec += gdsz / VMDK_SECTOR_SIZE; + for (n = 0; n < ngts; n++) { + le32enc(rgd + n, sec); + sec += VMDK_NGTES * sizeof(uint32_t) / VMDK_SECTOR_SIZE; + } + sec = (sec + grainsz - 1) & ~(grainsz - 1); if (verbose) @@ -174,6 +186,7 @@ vmdk_write(int fd) gtsz = ngts * VMDK_NGTES * sizeof(uint32_t); gt = calloc(gtsz, 1); if (gt == NULL) { + free(rgd); free(gd); free(desc); return (ENOMEM); @@ -198,13 +211,18 @@ vmdk_write(int fd) error = errno; if (!error && sparse_write(fd, gt, gtsz) < 0) error = errno; + if (!error && sparse_write(fd, rgd, gdsz) < 0) + error = errno; + if (!error && sparse_write(fd, gt, gtsz) < 0) + error = errno; free(gt); + free(rgd); free(gd); free(desc); if (error) return (error); - cur = VMDK_SECTOR_SIZE + desc_len + gdsz + gtsz; + cur = VMDK_SECTOR_SIZE + desc_len + (gdsz + gtsz) * 2; lim = sec * VMDK_SECTOR_SIZE; if (cur < lim) { buf = calloc(VMDK_SECTOR_SIZE, 1); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 03:44:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5DD3860; Wed, 13 Aug 2014 03:44:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29682160; Wed, 13 Aug 2014 03:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D3iUpT055824; Wed, 13 Aug 2014 03:44:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D3iUTL055823; Wed, 13 Aug 2014 03:44:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408130344.s7D3iUTL055823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 13 Aug 2014 03:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269901 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 03:44:30 -0000 Author: pfg Date: Wed Aug 13 03:44:30 2014 New Revision: 269901 URL: http://svnweb.freebsd.org/changeset/base/269901 Log: Minor style tweaks. Obtained from: OpenBSD (CVS rev. 1.7) MFC after: 3 days Modified: head/lib/libc/stdlib/strtonum.c Modified: head/lib/libc/stdlib/strtonum.c ============================================================================== --- head/lib/libc/stdlib/strtonum.c Wed Aug 13 01:43:38 2014 (r269900) +++ head/lib/libc/stdlib/strtonum.c Wed Aug 13 03:44:30 2014 (r269901) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ + * $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */ #include @@ -24,17 +24,17 @@ __FBSDID("$FreeBSD$"); #include #include -#define INVALID 1 -#define TOOSMALL 2 -#define TOOLARGE 3 +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp) { long long ll = 0; - char *ep; int error = 0; + char *ep; struct errval { const char *errstr; int err; @@ -47,9 +47,9 @@ strtonum(const char *numstr, long long m ev[0].err = errno; errno = 0; - if (minval > maxval) + if (minval > maxval) { error = INVALID; - else { + } else { ll = strtoll(numstr, &ep, 10); if (errno == EINVAL || numstr == ep || *ep != '\0') error = INVALID; From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 04:14:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3D19FC0; Wed, 13 Aug 2014 04:14:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD68425E7; Wed, 13 Aug 2014 04:14:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D4ErH3069393; Wed, 13 Aug 2014 04:14:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D4Eo98069371; Wed, 13 Aug 2014 04:14:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201408130414.s7D4Eo98069371@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 13 Aug 2014 04:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269902 - in head: bin/sh/tests bin/sh/tests/builtins bin/sh/tests/errors bin/sh/tests/execution bin/sh/tests/expansion bin/sh/tests/parameters bin/sh/tests/parser bin/sh/tests/set-e to... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 04:14:54 -0000 Author: ngie Date: Wed Aug 13 04:14:50 2014 New Revision: 269902 URL: http://svnweb.freebsd.org/changeset/base/269902 Log: Convert bin/sh/tests to ATF The new code uses a "test discovery mechanism" to determine what tests are available for execution The test shell can be specified via: kyua test -v test_suites.FreeBSD.bin.sh.test_shell=/path/to/test/sh Sponsored by: EMC / Isilon Storage Division Approved by: jmmv (mentor) Reviewed by: jilles (maintainer) Added: head/bin/sh/tests/functional_test.sh (contents, props changed) Deleted: head/bin/sh/tests/legacy_test.sh Modified: head/bin/sh/tests/Makefile head/bin/sh/tests/builtins/Makefile head/bin/sh/tests/errors/Makefile head/bin/sh/tests/errors/bad-parm-exp2.2.stderr head/bin/sh/tests/errors/bad-parm-exp3.2.stderr head/bin/sh/tests/errors/bad-parm-exp4.2.stderr head/bin/sh/tests/errors/bad-parm-exp5.2.stderr head/bin/sh/tests/errors/bad-parm-exp6.2.stderr head/bin/sh/tests/execution/Makefile head/bin/sh/tests/expansion/Makefile head/bin/sh/tests/parameters/Makefile head/bin/sh/tests/parser/Makefile head/bin/sh/tests/set-e/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/bin/sh/tests/Makefile ============================================================================== --- head/bin/sh/tests/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -4,15 +4,12 @@ TESTSDIR= ${TESTSBASE}/bin/sh -TAP_TESTS_SH= legacy_test -TAP_TESTS_SH_SED_legacy_test= -e 's,__SH__,/bin/sh,g' -# Some tests in here are silently not run when the tests are executed as -# root. Explicitly tell Kyua to drop privileges. -# -# TODO(jmmv): Kyua needs to do this by default, not only when explicitly -# requested. See https://code.google.com/p/kyua/issues/detail?id=6 -TEST_METADATA.legacy_test+= required_user="unprivileged" - -SUBDIR+= builtins errors execution expansion parameters parser set-e +TESTS_SUBDIRS+= builtins +TESTS_SUBDIRS+= errors +TESTS_SUBDIRS+= execution +TESTS_SUBDIRS+= expansion +TESTS_SUBDIRS+= parameters +TESTS_SUBDIRS+= parser +TESTS_SUBDIRS+= set-e .include Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/builtins/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,13 @@ # $FreeBSD$ -.include +.include -FILESDIR= ${TESTSBASE}/bin/sh/builtins -KYUAFILE= no +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} + +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= alias.0 alias.0.stdout FILES+= alias.1 alias.1.stderr Modified: head/bin/sh/tests/errors/Makefile ============================================================================== --- head/bin/sh/tests/errors/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/errors/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} -FILESDIR= ${TESTSBASE}/bin/sh/errors -KYUAFILE= no +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= assignment-error1.0 FILES+= assignment-error2.0 Modified: head/bin/sh/tests/errors/bad-parm-exp2.2.stderr ============================================================================== --- head/bin/sh/tests/errors/bad-parm-exp2.2.stderr Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/errors/bad-parm-exp2.2.stderr Wed Aug 13 04:14:50 2014 (r269902) @@ -1 +1 @@ -./errors/bad-parm-exp2.2: ${}: Bad substitution +./bad-parm-exp2.2: ${}: Bad substitution Modified: head/bin/sh/tests/errors/bad-parm-exp3.2.stderr ============================================================================== --- head/bin/sh/tests/errors/bad-parm-exp3.2.stderr Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/errors/bad-parm-exp3.2.stderr Wed Aug 13 04:14:50 2014 (r269902) @@ -1 +1 @@ -./errors/bad-parm-exp3.2: ${foo/}: Bad substitution +./bad-parm-exp3.2: ${foo/}: Bad substitution Modified: head/bin/sh/tests/errors/bad-parm-exp4.2.stderr ============================================================================== --- head/bin/sh/tests/errors/bad-parm-exp4.2.stderr Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/errors/bad-parm-exp4.2.stderr Wed Aug 13 04:14:50 2014 (r269902) @@ -1 +1 @@ -./errors/bad-parm-exp4.2: ${foo:@...}: Bad substitution +./bad-parm-exp4.2: ${foo:@...}: Bad substitution Modified: head/bin/sh/tests/errors/bad-parm-exp5.2.stderr ============================================================================== --- head/bin/sh/tests/errors/bad-parm-exp5.2.stderr Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/errors/bad-parm-exp5.2.stderr Wed Aug 13 04:14:50 2014 (r269902) @@ -1 +1 @@ -./errors/bad-parm-exp5.2: ${/}: Bad substitution +./bad-parm-exp5.2: ${/}: Bad substitution Modified: head/bin/sh/tests/errors/bad-parm-exp6.2.stderr ============================================================================== --- head/bin/sh/tests/errors/bad-parm-exp6.2.stderr Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/errors/bad-parm-exp6.2.stderr Wed Aug 13 04:14:50 2014 (r269902) @@ -1 +1 @@ -./errors/bad-parm-exp6.2: ${foo...}: Bad substitution +./bad-parm-exp6.2: ${foo...}: Bad substitution Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/execution/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} -FILESDIR= ${TESTSBASE}/bin/sh/execution -KYUAFILE= no +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= bg1.0 FILES+= bg2.0 Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/expansion/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} -FILESDIR= ${TESTSBASE}/bin/sh/expansion -KYUAFILE= no +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= arith1.0 FILES+= arith2.0 Added: head/bin/sh/tests/functional_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/functional_test.sh Wed Aug 13 04:14:50 2014 (r269902) @@ -0,0 +1,78 @@ +# +# Copyright 2014 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * 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. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +SRCDIR=$(atf_get_srcdir) + +check() +{ + local tc=${1}; shift + + export SH=$(atf_config_get bin.sh.test_shell /bin/sh) + + local err_file="${SRCDIR}/${tc}.stderr" + [ -f "${err_file}" ] && err_flag="-e file:${err_file}" + local out_file="${SRCDIR}/${tc}.stdout" + [ -f "${out_file}" ] && out_flag="-o file:${out_file}" + + # We need to copy the testcase scenario file because some of the + # testcases hardcode relative paths in the stderr/stdout. + # + # TODO: we might be able to generate this path at build time + cp ${SRCDIR}/${tc} . + + atf_check -s exit:${tc##*.} ${err_flag} ${out_flag} ${SH} "./${tc}" +} + +add_testcase() +{ + local tc=${1} + local tc_escaped word + + case "${tc%.*}" in + *-*) + local IFS="-" + for word in ${tc%.*}; do + tc_escaped="${tc_escaped:+${tc_escaped}_}${word}" + done + ;; + *) + tc_escaped=${tc%.*} + ;; + esac + + atf_test_case ${tc_escaped} + eval "${tc_escaped}_body() { check ${tc}; }" + atf_add_test_case ${tc_escaped} +} + +atf_init_test_cases() +{ + for path in $(find -Es "${SRCDIR}" -regex '.*\.[0-9]+$'); do + add_testcase ${path##*/} + done +} Modified: head/bin/sh/tests/parameters/Makefile ============================================================================== --- head/bin/sh/tests/parameters/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/parameters/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} -FILESDIR= ${TESTSBASE}/bin/sh/parameters -KYUAFILE= no +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= env1.0 FILES+= exitstatus1.0 Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/parser/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} -FILESDIR= ${TESTSBASE}/bin/sh/parser -KYUAFILE= no +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= alias1.0 FILES+= alias2.0 Modified: head/bin/sh/tests/set-e/Makefile ============================================================================== --- head/bin/sh/tests/set-e/Makefile Wed Aug 13 03:44:30 2014 (r269901) +++ head/bin/sh/tests/set-e/Makefile Wed Aug 13 04:14:50 2014 (r269902) @@ -1,9 +1,11 @@ # $FreeBSD$ -.include +TESTSDIR= ${TESTSBASE}/bin/sh/${.CURDIR:T} -FILESDIR= ${TESTSBASE}/bin/sh/set-e -KYUAFILE= no +.PATH: ${.CURDIR:H} +ATF_TESTS_SH= functional_test + +FILESDIR= ${TESTSDIR} FILES= and1.0 FILES+= and2.1 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 13 03:44:30 2014 (r269901) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 13 04:14:50 2014 (r269902) @@ -4168,6 +4168,7 @@ OLD_FILES+=usr/share/aclocal/atf-common. OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal OLD_FILES+=usr/tests/bin/chown/units_basics +OLD_FILES+=usr/tests/bin/sh/legacy_test OLD_FILES+=usr/tests/usr.bin/atf/Kyuafile OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/Kyuafile OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/atf_check_test From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 04:38:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14B2043A; Wed, 13 Aug 2014 04:38:44 +0000 (UTC) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAF952778; Wed, 13 Aug 2014 04:38:43 +0000 (UTC) Received: by mail-ig0-f173.google.com with SMTP id h18so9004760igc.6 for ; Tue, 12 Aug 2014 21:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NCXbhLvyO0iZbe8XPwDaHvuyDYnrrmAibjf9J2ltb50=; b=tWsa7w+CpkTfG+z6Ltj4uqK0bUNNiKT2QzfspzQcyi5SvXiZ0GncDSV7H3QJUBcu03 RkzS+6FgarZPUEyXiNT3g+FQcoCZ4YQs0FGwnsFSrwQ7/rxLRXXTuvmScPZ1j8hYqBkj nJMFg+pTLpPe0f8s5NX3RfJQ/1aclmnF4j5sh0MlnjYvNoOaObCZQmqu/KBWgB2uwRVi hhlrFfVM3FJU/B71QRid65F9OOtKTsnSyaEW9gnwTH0ZhGcEaR0YvfrSiWsQe4AZwA4K sJz5Evnn290xirJ85qFCHbXLUAZW/AsK/WtYYy4IIyE5KNxSQUoQk08t8LQyQhkxg313 44wg== MIME-Version: 1.0 X-Received: by 10.50.66.133 with SMTP id f5mr44900077igt.38.1407904723156; Tue, 12 Aug 2014 21:38:43 -0700 (PDT) Received: by 10.50.76.229 with HTTP; Tue, 12 Aug 2014 21:38:43 -0700 (PDT) In-Reply-To: <201408130414.s7D4Eo98069371@svn.freebsd.org> References: <201408130414.s7D4Eo98069371@svn.freebsd.org> Date: Tue, 12 Aug 2014 21:38:43 -0700 Message-ID: Subject: Re: svn commit: r269902 - in head: bin/sh/tests bin/sh/tests/builtins bin/sh/tests/errors bin/sh/tests/execution bin/sh/tests/expansion bin/sh/tests/parameters bin/sh/tests/parser bin/sh/tests/set-e to... From: Garrett Cooper To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 04:38:44 -0000 On Tue, Aug 12, 2014 at 9:14 PM, Garrett Cooper wrote: > Author: ngie > Date: Wed Aug 13 04:14:50 2014 > New Revision: 269902 > URL: http://svnweb.freebsd.org/changeset/base/269902 > > Log: > Convert bin/sh/tests to ATF > > The new code uses a "test discovery mechanism" to determine > what tests are available for execution > > The test shell can be specified via: > > kyua test -v test_suites.FreeBSD.bin.sh.test_shell=/path/to/test/sh > > Sponsored by: EMC / Isilon Storage Division > Approved by: jmmv (mentor) > Reviewed by: jilles (maintainer) I forgot to note two things: MFC after: 2 weeks Phabric: D547 Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 04:43:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B2825B1; Wed, 13 Aug 2014 04:43:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBD8C2813; Wed, 13 Aug 2014 04:43:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D4hTnU082681; Wed, 13 Aug 2014 04:43:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D4hTqj082678; Wed, 13 Aug 2014 04:43:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201408130443.s7D4hTqj082678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 13 Aug 2014 04:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269903 - in head: bin/date/tests tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 04:43:30 -0000 Author: ngie Date: Wed Aug 13 04:43:29 2014 New Revision: 269903 URL: http://svnweb.freebsd.org/changeset/base/269903 Log: Port date/bin/tests to ATF Phabric: D545 Approved by: jmmv (mentor) Submitted by: keramida (earlier version) MFC after: 2 weeks Sponsored by: Google, Inc Sponsored by: EMC / Isilon Storage Division Added: head/bin/date/tests/format_string_test.sh (contents, props changed) Deleted: head/bin/date/tests/legacy_test.sh Modified: head/bin/date/tests/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/bin/date/tests/Makefile ============================================================================== --- head/bin/date/tests/Makefile Wed Aug 13 04:14:50 2014 (r269902) +++ head/bin/date/tests/Makefile Wed Aug 13 04:43:29 2014 (r269903) @@ -4,6 +4,6 @@ TESTSDIR= ${TESTSBASE}/bin/date -TAP_TESTS_SH= legacy_test +ATF_TESTS_SH= format_string_test .include Added: head/bin/date/tests/format_string_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/date/tests/format_string_test.sh Wed Aug 13 04:43:29 2014 (r269903) @@ -0,0 +1,92 @@ +# +# Regression tests for date(1) +# +# Submitted by Edwin Groothuis +# +# $FreeBSD$ +# + +# +# These two date/times have been chosen carefully -- they +# create both the single digit and double/multidigit version of +# the values. +# +# To create a new one, make sure you are using the UTC timezone! +# + +TEST1=3222243 # 1970-02-07 07:04:03 +TEST2=1005600000 # 2001-11-12 21:11:12 + +check() +{ + local format_string exp_output_1 exp_output_2 + + format_string=${1} + exp_output_1=${2} + exp_output_2=${3} + + atf_check -o "inline:${exp_output_1}\n" \ + date -r ${TEST1} +%${format_string} + atf_check -o "inline:${exp_output_2}\n" \ + date -r ${TEST2} +%${format_string} +} + +format_string_test() +{ + local desc exp_output_1 exp_output_2 flag + + desc=${1} + flag=${2} + exp_output_1=${3} + exp_output_2=${4} + + atf_test_case ${desc}_test + eval " +${desc}_test_body() { + check ${flag} '${exp_output_1}' '${exp_output_2}'; +}" + atf_add_test_case ${desc}_test +} + +atf_init_test_cases() +{ + format_string_test A A Saturday Monday + format_string_test a a Sat Mon + format_string_test B B February November + format_string_test b b Feb Nov + format_string_test C C 19 20 + format_string_test c c "Sat Feb 7 07:04:03 1970" "Mon Nov 12 21:20:00 2001" + format_string_test D D 02/07/70 11/12/01 + format_string_test d d 07 12 + format_string_test e e " 7" 12 + format_string_test F F "1970-02-07" "2001-11-12" + format_string_test G G 1970 2001 + format_string_test g g 70 01 + format_string_test H H 07 21 + format_string_test h h Feb Nov + format_string_test I I 07 09 + format_string_test j j 038 316 + format_string_test k k " 7" 21 + format_string_test l l " 7" " 9" + format_string_test M M 04 20 + format_string_test m m 02 11 + format_string_test p p AM PM + format_string_test R R 07:04 21:20 + format_string_test r r "07:04:03 AM" "09:20:00 PM" + format_string_test S S 03 00 + format_string_test s s ${TEST1} ${TEST2} + format_string_test U U 05 45 + format_string_test u u 6 1 + format_string_test V V 06 46 + format_string_test v v " 7-Feb-1970" "12-Nov-2001" + format_string_test W W 05 46 + format_string_test w w 6 1 + format_string_test X X "07:04:03" "21:20:00" + format_string_test x x "02/07/70" "11/12/01" + format_string_test Y Y 1970 2001 + format_string_test y y 70 01 + format_string_test Z Z UTC UTC + format_string_test z z +0000 +0000 + format_string_test percent % % % + format_string_test plus + "Sat Feb 7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001" +} Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 13 04:14:50 2014 (r269902) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Aug 13 04:43:29 2014 (r269903) @@ -4168,6 +4168,7 @@ OLD_FILES+=usr/share/aclocal/atf-common. OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal OLD_FILES+=usr/tests/bin/chown/units_basics +OLD_FILES+=usr/tests/bin/date/legacy_test OLD_FILES+=usr/tests/bin/sh/legacy_test OLD_FILES+=usr/tests/usr.bin/atf/Kyuafile OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/Kyuafile From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 04:56:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01AB09D2; Wed, 13 Aug 2014 04:56:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6A912927; Wed, 13 Aug 2014 04:56:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D4uTVC087564; Wed, 13 Aug 2014 04:56:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D4uS9F087555; Wed, 13 Aug 2014 04:56:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201408130456.s7D4uS9F087555@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 13 Aug 2014 04:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269904 - in head: lib/libutil lib/libutil/tests tools/regression/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 04:56:30 -0000 Author: ngie Date: Wed Aug 13 04:56:27 2014 New Revision: 269904 URL: http://svnweb.freebsd.org/changeset/base/269904 Log: Integrate lib/libutil into the build/kyua Remove the .t wrappers Rename all of the TAP test applications from test- to _test to match the convention described in the TestSuite wiki page humanize_number_test.c: - Fix -Wformat warnings with counter variables - Fix minor style(9) issues: -- Header sorting -- Variable declaration alignment/sorting in main(..) -- Fit the lines in <80 columns - Fix an off by one index error in the testcase output [*] - Remove unnecessary `extern char * optarg;` (this is already provided by unistd.h) Phabric: D555 Approved by: jmmv (mentor) MFC after: 2 weeks Obtained from: EMC / Isilon Storage Division [*] Submitted by: Casey Peel [*] Sponsored by: EMC / Isilon Storage Division Added: head/lib/libutil/tests/ head/lib/libutil/tests/Makefile (contents, props changed) head/lib/libutil/tests/flopen_test.c - copied unchanged from r269903, head/tools/regression/lib/libutil/test-flopen.c head/lib/libutil/tests/grp_test.c - copied unchanged from r269562, head/tools/regression/lib/libutil/test-grp.c head/lib/libutil/tests/humanize_number_test.c - copied, changed from r269562, head/tools/regression/lib/libutil/test-humanize_number.c head/lib/libutil/tests/pidfile_test.c - copied unchanged from r269562, head/tools/regression/lib/libutil/test-pidfile.c head/lib/libutil/tests/trimdomain-nodomain_test.c - copied unchanged from r269562, head/tools/regression/lib/libutil/test-trimdomain-nodomain.c head/lib/libutil/tests/trimdomain_test.c - copied unchanged from r269562, head/tools/regression/lib/libutil/test-trimdomain.c Deleted: head/tools/regression/lib/libutil/ Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Wed Aug 13 04:43:29 2014 (r269903) +++ head/lib/libutil/Makefile Wed Aug 13 04:56:27 2014 (r269904) @@ -81,4 +81,8 @@ MLINKS+=pw_util.3 pw_copy.3 \ pw_util.3 pw_tempname.3 \ pw_util.3 pw_tmp.3 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/lib/libutil/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/tests/Makefile Wed Aug 13 04:56:27 2014 (r269904) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libutil + +TAP_TESTS_C+= flopen_test +TAP_TESTS_C+= grp_test +TAP_TESTS_C+= humanize_number_test +TAP_TESTS_C+= pidfile_test +TAP_TESTS_C+= trimdomain_test +TAP_TESTS_C+= trimdomain-nodomain_test + +DPADD+= ${LIBUTIL} +LDADD+= -lutil + +.include Copied: head/lib/libutil/tests/flopen_test.c (from r269903, head/tools/regression/lib/libutil/test-flopen.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/tests/flopen_test.c Wed Aug 13 04:56:27 2014 (r269904, copy of r269903, head/tools/regression/lib/libutil/test-flopen.c) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Test that flopen() can create a file. + */ +const char * +test_flopen_create(void) +{ + const char *fn = "test_flopen_create"; + const char *result = NULL; + int fd; + + unlink(fn); + fd = flopen(fn, O_RDWR|O_CREAT, 0640); + if (fd < 0) { + result = strerror(errno); + } else { + close(fd); + } + unlink(fn); + return (result); +} + +/* + * Test that flopen() can open an existing file. + */ +const char * +test_flopen_open(void) +{ + const char *fn = "test_flopen_open"; + const char *result = NULL; + int fd; + + fd = open(fn, O_RDWR|O_CREAT, 0640); + if (fd < 0) { + result = strerror(errno); + } else { + close(fd); + fd = flopen(fn, O_RDWR); + if (fd < 0) { + result = strerror(errno); + } else { + close(fd); + } + } + unlink(fn); + return (result); +} + +/* + * Test that flopen() can lock against itself + */ +const char * +test_flopen_lock_self(void) +{ + const char *fn = "test_flopen_lock_self"; + const char *result = NULL; + int fd1, fd2; + + unlink(fn); + fd1 = flopen(fn, O_RDWR|O_CREAT, 0640); + if (fd1 < 0) { + result = strerror(errno); + } else { + fd2 = flopen(fn, O_RDWR|O_NONBLOCK); + if (fd2 >= 0) { + result = "second open succeeded"; + close(fd2); + } + close(fd1); + } + unlink(fn); + return (result); +} + +/* + * Test that flopen() can lock against other processes + */ +const char * +test_flopen_lock_other(void) +{ + const char *fn = "test_flopen_lock_other"; + const char *result = NULL; + volatile int fd1, fd2; + + unlink(fn); + fd1 = flopen(fn, O_RDWR|O_CREAT, 0640); + if (fd1 < 0) { + result = strerror(errno); + } else { + fd2 = -42; + if (vfork() == 0) { + fd2 = flopen(fn, O_RDWR|O_NONBLOCK); + close(fd2); + _exit(0); + } + if (fd2 == -42) + result = "vfork() doesn't work as expected"; + if (fd2 >= 0) + result = "second open succeeded"; + close(fd1); + } + unlink(fn); + return (result); +} + +/* + * Test that child processes inherit the lock + */ +const char * +test_flopen_lock_child(void) +{ + const char *fn = "test_flopen_lock_child"; + const char *result = NULL; + pid_t pid; + volatile int fd1, fd2; + + unlink(fn); + fd1 = flopen(fn, O_RDWR|O_CREAT, 0640); + if (fd1 < 0) { + result = strerror(errno); + } else { + pid = fork(); + if (pid == -1) { + result = strerror(errno); + } else if (pid == 0) { + select(0, 0, 0, 0, 0); + _exit(0); + } + close(fd1); + if ((fd2 = flopen(fn, O_RDWR|O_NONBLOCK)) != -1) { + result = "second open succeeded"; + close(fd2); + } + kill(pid, SIGINT); + } + unlink(fn); + return (result); +} + +static struct test { + const char *name; + const char *(*func)(void); +} t[] = { + { "flopen_create", test_flopen_create }, + { "flopen_open", test_flopen_open }, + { "flopen_lock_self", test_flopen_lock_self }, + { "flopen_lock_other", test_flopen_lock_other }, + { "flopen_lock_child", test_flopen_lock_child }, +}; + +int +main(void) +{ + const char *result; + int i, nt; + + nt = sizeof(t) / sizeof(*t); + printf("1..%d\n", nt); + for (i = 0; i < nt; ++i) { + if ((result = t[i].func()) != NULL) + printf("not ok %d - %s # %s\n", i + 1, + t[i].name, result); + else + printf("ok %d - %s\n", i + 1, + t[i].name); + } + exit(0); +} Copied: head/lib/libutil/tests/grp_test.c (from r269562, head/tools/regression/lib/libutil/test-grp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/tests/grp_test.c Wed Aug 13 04:56:27 2014 (r269904, copy of r269562, head/tools/regression/lib/libutil/test-grp.c) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2008 Sean C. Farley + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + + +/* + * Static values for building and testing an artificial group. + */ +static char grpName[] = "groupName"; +static char grpPasswd[] = "groupPwd"; +static gid_t grpGID = 1234; +static char *grpMems[] = { "mem1", "mem2", "mem3", NULL }; +static const char *origStrGrp = "groupName:groupPwd:1234:mem1,mem2,mem3"; + + +/* + * Build a group to test against without depending on a real group to be found + * within /etc/group. + */ +static void +build_grp(struct group *grp) +{ + grp->gr_name = grpName; + grp->gr_passwd = grpPasswd; + grp->gr_gid = grpGID; + grp->gr_mem = grpMems; + + return; +} + + +int +main(void) +{ + char *strGrp; + int testNdx; + struct group *dupGrp; + struct group *scanGrp; + struct group origGrp; + + /* Setup. */ + printf("1..4\n"); + testNdx = 0; + + /* Manually build a group using static values. */ + build_grp(&origGrp); + + /* Copy the group. */ + testNdx++; + if ((dupGrp = gr_dup(&origGrp)) == NULL) + printf("not "); + printf("ok %d - %s\n", testNdx, "gr_dup"); + + /* Compare the original and duplicate groups. */ + testNdx++; + if (! gr_equal(&origGrp, dupGrp)) + printf("not "); + printf("ok %d - %s\n", testNdx, "gr_equal"); + + /* Create group string from the duplicate group structure. */ + testNdx++; + strGrp = gr_make(dupGrp); + if (strcmp(strGrp, origStrGrp) != 0) + printf("not "); + printf("ok %d - %s\n", testNdx, "gr_make"); + + /* + * Create group structure from string and compare it to the original + * group structure. + */ + testNdx++; + if ((scanGrp = gr_scan(strGrp)) == NULL || ! gr_equal(&origGrp, + scanGrp)) + printf("not "); + printf("ok %d - %s\n", testNdx, "gr_scan"); + + /* Clean up. */ + free(scanGrp); + free(strGrp); + free(dupGrp); + + exit(EXIT_SUCCESS); +} Copied and modified: head/lib/libutil/tests/humanize_number_test.c (from r269562, head/tools/regression/lib/libutil/test-humanize_number.c) ============================================================================== --- head/tools/regression/lib/libutil/test-humanize_number.c Tue Aug 5 05:00:22 2014 (r269562, copy source) +++ head/lib/libutil/tests/humanize_number_test.c Wed Aug 13 04:56:27 2014 (r269904) @@ -28,17 +28,15 @@ * */ -#include -#include +#include +#include #include +#include +#include #include +#include #include -#include -#include #include -#include - -extern char * optarg; #define MAX_STR_FLAGS_RESULT 80 #define MAX_INT_STR_DIGITS 12 @@ -490,7 +488,7 @@ static void testskipped(size_t i) { - printf("ok %lu # skip - not turned on\n", i); + printf("ok %zu # skip - not turned on\n", i); } int @@ -498,10 +496,8 @@ main(int argc, char * const argv[]) { char *buf; char *flag_str, *scale_str; - size_t i; - size_t errcnt, tested, skipped; + size_t buflen, errcnt, i, skipped, tested; int r; - size_t buflen; int includeNegScale; int includeExabyteTests; int verbose; @@ -522,8 +518,8 @@ main(int argc, char * const argv[]) if (buflen != 4) printf("Warning: buffer size %zu != 4, expect some results to differ.\n", buflen); - printf("1..%lu\n", sizeof test_args / sizeof *test_args); - for (i = 0; i < sizeof test_args / sizeof *test_args; i++) { + printf("1..%zu\n", nitems(test_args)); + for (i = 0; i < nitems(test_args); i++) { /* KLUDGE */ if (test_args[i].num == INT64_MAX && buflen == 4) { /* Start final tests which require buffer of 6 */ @@ -537,12 +533,12 @@ main(int argc, char * const argv[]) if (test_args[i].scale < 0 && ! includeNegScale) { skipped++; - testskipped(i); + testskipped(i + 1); continue; } if (test_args[i].num >= halfExabyte && ! includeExabyteTests) { skipped++; - testskipped(i); + testskipped(i + 1); continue; } @@ -553,36 +549,46 @@ main(int argc, char * const argv[]) if (r != test_args[i].retval) { if (verbose) - printf("wrong return value on index %lu, buflen: %zu, got: %d + \"%s\", expected %d + \"%s\"; num = %" PRId64 ", scale = %s, flags= %s.\n", + printf("wrong return value on index %zu, " + "buflen: %zu, got: %d + \"%s\", " + "expected %d + \"%s\"; num = %jd, " + "scale = %s, flags= %s.\n", i, buflen, r, buf, test_args[i].retval, - test_args[i].res, test_args[i].num, + test_args[i].res, + (intmax_t)test_args[i].num, scale_str, flag_str); else - printf("not ok %lu # return %d != %d\n", i, r, - test_args[i].retval); + printf("not ok %zu # return %d != %d\n", + i + 1, r, test_args[i].retval); errcnt++; } else if (strcmp(buf, test_args[i].res) != 0) { if (verbose) - printf("result mismatch on index %lu, got: \"%s\", expected \"%s\"; num = %" PRId64 ", scale = %s, flags= %s.\n", - i, buf, test_args[i].res, test_args[i].num, + printf("result mismatch on index %zu, got: " + "\"%s\", expected \"%s\"; num = %jd, " + "scale = %s, flags= %s.\n", + i, buf, test_args[i].res, + (intmax_t)test_args[i].num, scale_str, flag_str); else - printf("not ok %lu # buf \"%s\" != \"%s\"\n", i, - buf, test_args[i].res); + printf("not ok %zu # buf \"%s\" != \"%s\"\n", + i + 1, buf, test_args[i].res); errcnt++; } else { if (verbose) - printf("successful result on index %lu, returned %d, got: \"%s\"; num = %" PRId64 ", scale = %s, flags= %s.\n", - i, r, buf, test_args[i].num, scale_str, - flag_str); + printf("successful result on index %zu, " + "returned %d, got: \"%s\"; num = %jd, " + "scale = %s, flags= %s.\n", + i, r, buf, + (intmax_t)test_args[i].num, + scale_str, flag_str); else - printf("ok %lu\n", i); + printf("ok %zu\n", i + 1); } tested++; } if (verbose) - printf("total errors: %lu/%lu tests, %lu skipped\n", errcnt, + printf("total errors: %zu/%zu tests, %zu skipped\n", errcnt, tested, skipped); if (errcnt) Copied: head/lib/libutil/tests/pidfile_test.c (from r269562, head/tools/regression/lib/libutil/test-pidfile.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/tests/pidfile_test.c Wed Aug 13 04:56:27 2014 (r269904, copy of r269562, head/tools/regression/lib/libutil/test-pidfile.c) @@ -0,0 +1,280 @@ +/*- + * Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * We need a signal handler so kill(2) will interrupt our child's + * select(2) instead of killing it. + */ +static void +signal_handler(int sig) +{ + (void)sig; +} + +/* + * Test that pidfile_open() can create a pidfile and that pidfile_write() + * can write to it. + */ +static const char * +test_pidfile_uncontested(void) +{ + const char *fn = "test_pidfile_uncontested"; + struct pidfh *pf; + pid_t other = 0; + + unlink(fn); + pf = pidfile_open(fn, 0600, &other); + if (pf == NULL && other != 0) + return ("pidfile exists and is locked"); + if (pf == NULL) + return (strerror(errno)); + if (pidfile_write(pf) != 0) { + pidfile_close(pf); + unlink(fn); + return ("failed to write PID"); + } + pidfile_close(pf); + unlink(fn); + return (NULL); +} + +/* + * Test that pidfile_open() locks against self. + */ +static const char * +test_pidfile_self(void) +{ + const char *fn = "test_pidfile_self"; + struct pidfh *pf1, *pf2; + pid_t other = 0; + int serrno; + + unlink(fn); + pf1 = pidfile_open(fn, 0600, &other); + if (pf1 == NULL && other != 0) + return ("pidfile exists and is locked"); + if (pf1 == NULL) + return (strerror(errno)); + if (pidfile_write(pf1) != 0) { + serrno = errno; + pidfile_close(pf1); + unlink(fn); + return (strerror(serrno)); + } + // second open should fail + pf2 = pidfile_open(fn, 0600, &other); + if (pf2 != NULL) { + pidfile_close(pf1); + pidfile_close(pf2); + unlink(fn); + return ("managed to opened pidfile twice"); + } + if (other != getpid()) { + pidfile_close(pf1); + unlink(fn); + return ("pidfile contained wrong PID"); + } + pidfile_close(pf1); + unlink(fn); + return (NULL); +} + +/* + * Common code for test_pidfile_{contested,inherited}. + */ +static const char * +common_test_pidfile_child(const char *fn, int parent_open) +{ + struct pidfh *pf = NULL; + pid_t other = 0, pid = 0; + int fd[2], serrno, status; + char ch; + + unlink(fn); + if (pipe(fd) != 0) + return (strerror(errno)); + + if (parent_open) { + pf = pidfile_open(fn, 0600, &other); + if (pf == NULL && other != 0) + return ("pidfile exists and is locked"); + if (pf == NULL) + return (strerror(errno)); + } + + pid = fork(); + if (pid == -1) + return (strerror(errno)); + if (pid == 0) { + // child + close(fd[0]); + signal(SIGINT, signal_handler); + if (!parent_open) { + pf = pidfile_open(fn, 0600, &other); + if (pf == NULL && other != 0) + return ("pidfile exists and is locked"); + if (pf == NULL) + return (strerror(errno)); + } + if (pidfile_write(pf) != 0) { + serrno = errno; + pidfile_close(pf); + unlink(fn); + return (strerror(serrno)); + } + if (pf == NULL) + _exit(1); + if (pidfile_write(pf) != 0) + _exit(1); + if (write(fd[1], "*", 1) != 1) + _exit(1); + select(0, 0, 0, 0, 0); + _exit(0); + } + // parent + close(fd[1]); + if (pf) + pidfile_close(pf); + + // wait for the child to signal us + if (read(fd[0], &ch, 1) != 1) { + serrno = errno; + unlink(fn); + kill(pid, SIGTERM); + errno = serrno; + return (strerror(errno)); + } + + // We shouldn't be able to lock the same pidfile as our child + pf = pidfile_open(fn, 0600, &other); + if (pf != NULL) { + pidfile_close(pf); + unlink(fn); + return ("managed to lock contested pidfile"); + } + + // Failed to lock, but not because it was contested + if (other == 0) { + unlink(fn); + return (strerror(errno)); + } + + // Locked by the wrong process + if (other != pid) { + unlink(fn); + return ("pidfile contained wrong PID"); + } + + // check our child's fate + if (pf) + pidfile_close(pf); + unlink(fn); + if (kill(pid, SIGINT) != 0) + return (strerror(errno)); + if (waitpid(pid, &status, 0) == -1) + return (strerror(errno)); + if (WIFSIGNALED(status)) + return ("child caught signal"); + if (WEXITSTATUS(status) != 0) + return ("child returned non-zero status"); + + // success + return (NULL); +} + +/* + * Test that pidfile_open() fails when attempting to open a pidfile that + * is already locked, and that it returns the correct PID. + */ +static const char * +test_pidfile_contested(void) +{ + const char *fn = "test_pidfile_contested"; + const char *result; + + result = common_test_pidfile_child(fn, 0); + return (result); +} + +/* + * Test that the pidfile lock is inherited. + */ +static const char * +test_pidfile_inherited(void) +{ + const char *fn = "test_pidfile_inherited"; + const char *result; + + result = common_test_pidfile_child(fn, 1); + return (result); +} + +static struct test { + const char *name; + const char *(*func)(void); +} t[] = { + { "pidfile_uncontested", test_pidfile_uncontested }, + { "pidfile_self", test_pidfile_self }, + { "pidfile_contested", test_pidfile_contested }, + { "pidfile_inherited", test_pidfile_inherited }, +}; + +int +main(void) +{ + const char *result; + int i, nt; + + nt = sizeof(t) / sizeof(*t); + printf("1..%d\n", nt); + for (i = 0; i < nt; ++i) { + if ((result = t[i].func()) != NULL) + printf("not ok %d - %s # %s\n", i + 1, + t[i].name, result); + else + printf("ok %d - %s\n", i + 1, + t[i].name); + } + exit(0); +} Copied: head/lib/libutil/tests/trimdomain-nodomain_test.c (from r269562, head/tools/regression/lib/libutil/test-trimdomain-nodomain.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/tests/trimdomain-nodomain_test.c Wed Aug 13 04:56:27 2014 (r269904, copy of r269562, head/tools/regression/lib/libutil/test-trimdomain-nodomain.c) @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005 Brooks Davis. 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#define TESTDOMAIN "" +#define TESTHOST "testhost" +#define TESTFQDN "testhost" TESTDOMAIN + +int failures = 0; +int tests = 0; + +/* + * Evily override gethostname(3) so trimdomain always gets the same result. + * This makes the tests much easier to write and less likely to fail on + * oddly configured systems. + */ +int +gethostname(char *name, size_t namelen) +{ + if (strlcpy(name, TESTFQDN, namelen) > namelen) { + errno = ENAMETOOLONG; + return (-1); + } + return (0); +} + +void +testit(const char *input, int hostsize, const char *output, const char *test) +{ + char *testhost; + const char *expected = (output == NULL) ? input : output; + + testhost = strdup(input); + trimdomain(testhost, hostsize < 0 ? (int)strlen(testhost) : hostsize); + tests++; + if (strcmp(testhost, expected) != 0) { + printf("not ok %d - %s\n", tests, test); + printf("# %s -> %s (expected %s)\n", input, testhost, expected); + } else + printf("ok %d - %s\n", tests, test); + free(testhost); + return; +} + +int +main(void) +{ + + printf("1..5\n"); + + testit(TESTFQDN, -1, TESTHOST, "self"); + testit("XXX" TESTDOMAIN, -1, "XXX", "different host, same domain"); + testit("XXX" TESTDOMAIN, 1, NULL, "short hostsize"); + testit("bogus.example.net", -1, NULL, "arbitrary host"); + testit("XXX." TESTFQDN, -1, NULL, "domain is local hostname"); + + return (0); +} Copied: head/lib/libutil/tests/trimdomain_test.c (from r269562, head/tools/regression/lib/libutil/test-trimdomain.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/tests/trimdomain_test.c Wed Aug 13 04:56:27 2014 (r269904, copy of r269562, head/tools/regression/lib/libutil/test-trimdomain.c) @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005 Brooks Davis. 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#define TESTDOMAIN ".domain.example.com" +#define TESTHOST "testhost" +#define TESTFQDN "testhost" TESTDOMAIN + +int failures = 0; +int tests = 0; + +/* + * Evily override gethostname(3) so trimdomain always gets the same result. + * This makes the tests much easier to write and less likely to fail on + * oddly configured systems. + */ +int +gethostname(char *name, size_t namelen) +{ + if (strlcpy(name, TESTFQDN, namelen) > namelen) { + errno = ENAMETOOLONG; + return (-1); + } + return (0); +} + +void +testit(const char *input, int hostsize, const char *output, const char *test) +{ + char *testhost; + const char *expected = (output == NULL) ? input : output; + + testhost = strdup(input); + trimdomain(testhost, hostsize < 0 ? (int)strlen(testhost) : hostsize); + tests++; + if (strcmp(testhost, expected) != 0) { + printf("not ok %d - %s\n", tests, test); + printf("# %s -> %s (expected %s)\n", input, testhost, expected); + } else + printf("ok %d - %s\n", tests, test); + free(testhost); + return; +} + +int +main(void) +{ + + printf("1..5\n"); + + testit(TESTFQDN, -1, TESTHOST, "self"); + testit("XXX" TESTDOMAIN, -1, "XXX", "different host, same domain"); + testit("XXX" TESTDOMAIN, 1, NULL, "short hostsize"); + testit("bogus.example.net", -1, NULL, "arbitrary host"); + testit("XXX." TESTFQDN, -1, NULL, "domain is local hostname"); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 05:15:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF5061C2; Wed, 13 Aug 2014 05:15:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC5862B3D; Wed, 13 Aug 2014 05:15:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D5FS4X096463; Wed, 13 Aug 2014 05:15:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D5FSUo096462; Wed, 13 Aug 2014 05:15:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201408130515.s7D5FSUo096462@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 13 Aug 2014 05:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269906 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 05:15:29 -0000 Author: ngie Date: Wed Aug 13 05:15:28 2014 New Revision: 269906 URL: http://svnweb.freebsd.org/changeset/base/269906 Log: Add missing BSD.tests.dist entry for lib/libutil to unbreak installworld with MK_TESTS == no Phabric: D555 X-MFC with: r269904 Approved by: jmmv (mentor, implicit) Pointyhat to: ngie Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Aug 13 05:03:09 2014 (r269905) +++ head/etc/mtree/BSD.tests.dist Wed Aug 13 05:15:28 2014 (r269906) @@ -89,6 +89,8 @@ .. libnv .. + libutil + .. .. libexec atf From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 05:17:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC31641A; Wed, 13 Aug 2014 05:17:41 +0000 (UTC) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9130B2B67; Wed, 13 Aug 2014 05:17:41 +0000 (UTC) Received: by mail-ig0-f182.google.com with SMTP id c1so643367igq.3 for ; Tue, 12 Aug 2014 22:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KF2IpOxM/v9UVAoFOLWJlWxj/lCi9jDIRKuooAGkU6U=; b=nuoIJOhl+75hCVJtmY1DocoKNO0wxQMCZtvVrUIHzbmwV1+nv1HHqmTDnbLB5mpQYF +u8ck5bVqZ1DvU1JDOYLhqV400IwfCQ/6BlqMZepXfBTdI3sa+dMehDWZ7EYLrT7sIUR 7Sz7BjauBPpwqy4Yln7vYVUwsWEcgZImPgSKQKvToInZwS+Z6MLAziyBtac2Xz2UWoNz VqS8v5eQMhWB5tcNf4Wd9ZEXIuAsBaGYAeiyPsIJMNJzuD9cWtICExv8k674A8oU6A/1 SFj3jeqpZXBvZQtIO3iXzEaGfT6zw+pEyDlTb2YFh20RA7KCk/zHfUFx54aj51Rf/HQI uaeA== MIME-Version: 1.0 X-Received: by 10.50.43.164 with SMTP id x4mr20779627igl.27.1407907060928; Tue, 12 Aug 2014 22:17:40 -0700 (PDT) Received: by 10.50.76.229 with HTTP; Tue, 12 Aug 2014 22:17:40 -0700 (PDT) In-Reply-To: <201408130515.s7D5FSUo096462@svn.freebsd.org> References: <201408130515.s7D5FSUo096462@svn.freebsd.org> Date: Tue, 12 Aug 2014 22:17:40 -0700 Message-ID: Subject: Re: svn commit: r269906 - head/etc/mtree From: Garrett Cooper To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 05:17:42 -0000 On Tue, Aug 12, 2014 at 10:15 PM, Garrett Cooper wrote: > Author: ngie > Date: Wed Aug 13 05:15:28 2014 > New Revision: 269906 > URL: http://svnweb.freebsd.org/changeset/base/269906 > > Log: > Add missing BSD.tests.dist entry for lib/libutil to unbreak installworld with > MK_TESTS == no no -> yes I think that's my cue to stop committing for the night :). From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 05:44:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B63BF72; Wed, 13 Aug 2014 05:44:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E5012FE3; Wed, 13 Aug 2014 05:44:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D5i9EG009665; Wed, 13 Aug 2014 05:44:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D5i8TA009662; Wed, 13 Aug 2014 05:44:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408130544.s7D5i8TA009662@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Aug 2014 05:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269907 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 05:44:09 -0000 Author: kib Date: Wed Aug 13 05:44:08 2014 New Revision: 269907 URL: http://svnweb.freebsd.org/changeset/base/269907 Log: If vm_page_grab() allocates a new page, the page is not inserted into page queue even when the allocation is not wired. It is responsibility of the vm_page_grab() caller to ensure that the page does not end on the vm_object queue but not on the pagedaemon queue, which would effectively create unpageable unwired page. In exec_map_first_page() and vm_imgact_hold_page(), activate the page immediately after unbusying it, to avoid leak. In the uiomove_object_page(), deactivate page before the object is unlocked. There is no leak, since the page is deactivated after uiomove_fromphys() finished. But allowing non-queued non-wired page in the unlocked object queue makes it impossible to assert that leak does not happen in other places. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_exec.c head/sys/kern/uipc_shm.c head/sys/vm/vm_glue.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Aug 13 05:15:28 2014 (r269906) +++ head/sys/kern/kern_exec.c Wed Aug 13 05:44:08 2014 (r269907) @@ -993,6 +993,7 @@ exec_map_first_page(imgp) vm_page_xunbusy(ma[0]); vm_page_lock(ma[0]); vm_page_hold(ma[0]); + vm_page_activate(ma[0]); vm_page_unlock(ma[0]); VM_OBJECT_WUNLOCK(object); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Aug 13 05:15:28 2014 (r269906) +++ head/sys/kern/uipc_shm.c Wed Aug 13 05:44:08 2014 (r269907) @@ -197,6 +197,12 @@ uiomove_object_page(vm_object_t obj, siz vm_page_xunbusy(m); vm_page_lock(m); vm_page_hold(m); + if (m->queue == PQ_NONE) { + vm_page_deactivate(m); + } else { + /* Requeue to maintain LRU ordering. */ + vm_page_requeue(m); + } vm_page_unlock(m); VM_OBJECT_WUNLOCK(obj); error = uiomove_fromphys(&m, offset, tlen, uio); @@ -208,12 +214,6 @@ uiomove_object_page(vm_object_t obj, siz } vm_page_lock(m); vm_page_unhold(m); - if (m->queue == PQ_NONE) { - vm_page_deactivate(m); - } else { - /* Requeue to maintain LRU ordering. */ - vm_page_requeue(m); - } vm_page_unlock(m); return (error); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Aug 13 05:15:28 2014 (r269906) +++ head/sys/vm/vm_glue.c Wed Aug 13 05:44:08 2014 (r269907) @@ -251,6 +251,7 @@ vm_imgact_hold_page(vm_object_t object, vm_page_xunbusy(m); vm_page_lock(m); vm_page_hold(m); + vm_page_activate(m); vm_page_unlock(m); out: VM_OBJECT_WUNLOCK(object); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 05:47:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE80116F; Wed, 13 Aug 2014 05:47:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB98B2FFA; Wed, 13 Aug 2014 05:47:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D5ln0t010182; Wed, 13 Aug 2014 05:47:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D5lnxn010181; Wed, 13 Aug 2014 05:47:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408130547.s7D5lnxn010181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Aug 2014 05:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269908 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 05:47:50 -0000 Author: kib Date: Wed Aug 13 05:47:49 2014 New Revision: 269908 URL: http://svnweb.freebsd.org/changeset/base/269908 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libthr/thread/thr_stack.c Modified: head/lib/libthr/thread/thr_stack.c ============================================================================== --- head/lib/libthr/thread/thr_stack.c Wed Aug 13 05:44:08 2014 (r269907) +++ head/lib/libthr/thread/thr_stack.c Wed Aug 13 05:47:49 2014 (r269908) @@ -268,7 +268,7 @@ _thr_stack_alloc(struct pthread_attr *at /* Map the stack and guard page together, and split guard page from allocated space: */ - if ((stackaddr = mmap(stackaddr, stacksize+guardsize, + if ((stackaddr = mmap(stackaddr, stacksize + guardsize, _rtld_get_stack_prot(), MAP_STACK, -1, 0)) != MAP_FAILED && (guardsize == 0 || From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 05:53:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AAF6432; Wed, 13 Aug 2014 05:53:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF8420B4; Wed, 13 Aug 2014 05:53:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D5rgeg014089; Wed, 13 Aug 2014 05:53:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D5rgIR014087; Wed, 13 Aug 2014 05:53:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408130553.s7D5rgIR014087@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Aug 2014 05:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269909 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 05:53:42 -0000 Author: kib Date: Wed Aug 13 05:53:41 2014 New Revision: 269909 URL: http://svnweb.freebsd.org/changeset/base/269909 Log: Add a knob LIBPTHREAD_BIGSTACK_MAIN, which instructs libthr to leave the whole RLIMIT_STACK-sized region of the kernel-allocated stack as the stack of main thread. By default, the main thread stack is clamped at 2MB (4MB on 64bit ABIs) and the rest is used for other threads stack allocation. Since there is no programmatic way to adjust the size of the main thread stack, pthread_attr_setstacksize() is too late, the knob allows user to manage the main stack size both for single-threaded and multi-threaded processes with the rlimit. Reported by: "Ivan A. Kosarev" Tested by: dim Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_stack.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Wed Aug 13 05:47:49 2014 (r269908) +++ head/lib/libthr/thread/thr_init.c Wed Aug 13 05:53:41 2014 (r269909) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -441,6 +442,7 @@ init_main_thread(struct pthread *thread) static void init_private(void) { + struct rlimit rlim; size_t len; int mib[2]; char *env; @@ -471,6 +473,12 @@ init_private(void) len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) PANIC("Cannot get kern.usrstack from sysctl"); + env = getenv("LIBPTHREAD_BIGSTACK_MAIN"); + if (env != NULL) { + if (getrlimit(RLIMIT_STACK, &rlim) == -1) + PANIC("Cannot get stack rlimit"); + _thr_stack_initial = rlim.rlim_cur; + } len = sizeof(_thr_is_smp); sysctlbyname("kern.smp.cpus", &_thr_is_smp, &len, NULL, 0); _thr_is_smp = (_thr_is_smp > 1); Modified: head/lib/libthr/thread/thr_stack.c ============================================================================== --- head/lib/libthr/thread/thr_stack.c Wed Aug 13 05:47:49 2014 (r269908) +++ head/lib/libthr/thread/thr_stack.c Wed Aug 13 05:53:41 2014 (r269909) @@ -246,7 +246,10 @@ _thr_stack_alloc(struct pthread_attr *at THREAD_LIST_UNLOCK(curthread); } else { - /* Allocate a stack from usrstack. */ + /* + * Allocate a stack from or below usrstack, depending + * on the LIBPTHREAD_BIGSTACK_MAIN env variable. + */ if (last_stack == NULL) last_stack = _usrstack - _thr_stack_initial - _thr_guard_default; From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 06:41:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25D15331; Wed, 13 Aug 2014 06:41:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 076222666; Wed, 13 Aug 2014 06:41:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D6f6oD033632; Wed, 13 Aug 2014 06:41:06 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D6f6gL033631; Wed, 13 Aug 2014 06:41:06 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201408130641.s7D6f6gL033631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 13 Aug 2014 06:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269912 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 06:41:07 -0000 Author: rpaulo Date: Wed Aug 13 06:41:06 2014 New Revision: 269912 URL: http://svnweb.freebsd.org/changeset/base/269912 Log: MFC r269776 Remove the BROKEN_LIBELF section. Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Aug 13 06:39:44 2014 (r269911) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Aug 13 06:41:06 2014 (r269912) @@ -1915,7 +1915,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d goto done; } #if !defined(sun) -#define BROKEN_LIBELF /* * FreeBSD's ld(1) is not instructed to interpret and add * correctly the SUNW_dof section present in tfile. @@ -1939,9 +1938,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d /* * Add the string '.SUWN_dof' to the shstrtab section. */ -#ifdef BROKEN_LIBELF - elf_flagelf(e, ELF_C_SET, ELF_F_LAYOUT); -#endif elf_getshdrstrndx(e, &stridx); scn = elf_getscn(e, stridx); gelf_getshdr(scn, &shdr); @@ -1953,54 +1949,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d loc = shdr.sh_size; shdr.sh_size += data->d_size; gelf_update_shdr(scn, &shdr); -#ifdef BROKEN_LIBELF - off = shdr.sh_offset; - rc = shdr.sh_offset + shdr.sh_size; - gelf_getehdr(e, &ehdr); - if (ehdr.e_shoff > off) { - off = ehdr.e_shoff + ehdr.e_shnum * ehdr.e_shentsize; - rc = roundup(rc, 8); - ehdr.e_shoff = rc; - gelf_update_ehdr(e, &ehdr); - rc += ehdr.e_shnum * ehdr.e_shentsize; - } - for (;;) { - scn0 = NULL; - scn = NULL; - while ((scn = elf_nextscn(e, scn)) != NULL) { - gelf_getshdr(scn, &shdr); - if (shdr.sh_type == SHT_NOBITS || - shdr.sh_offset < off) - continue; - /* Find the immediately adjcent section. */ - if (scn0 == NULL || - shdr.sh_offset < shdr0.sh_offset) { - scn0 = scn; - gelf_getshdr(scn0, &shdr0); - } - } - if (scn0 == NULL) - break; - /* Load section data to work around another bug */ - elf_getdata(scn0, NULL); - /* Update section header, assure section alignment */ - off = shdr0.sh_offset + shdr0.sh_size; - rc = roundup(rc, shdr0.sh_addralign); - shdr0.sh_offset = rc; - gelf_update_shdr(scn0, &shdr0); - rc += shdr0.sh_size; - } - if (elf_update(e, ELF_C_WRITE) < 0) { - ret = dt_link_error(dtp, NULL, -1, NULL, - "failed to add append the shstrtab section: %s", - elf_errmsg(elf_errno())); - elf_end(e); - close(efd); - goto done; - } - elf_end(e); - e = elf_begin(efd, ELF_C_RDWR, NULL); -#endif /* * Construct the .SUNW_dof section. */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 06:45:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1D7F85D; Wed, 13 Aug 2014 06:45:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEA7326B7; Wed, 13 Aug 2014 06:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D6j2Up036893; Wed, 13 Aug 2014 06:45:02 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D6j2tD036892; Wed, 13 Aug 2014 06:45:02 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201408130645.s7D6j2tD036892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 13 Aug 2014 06:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269913 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 06:45:02 -0000 Author: rpaulo Date: Wed Aug 13 06:45:02 2014 New Revision: 269913 URL: http://svnweb.freebsd.org/changeset/base/269913 Log: MFC r269744 Run dtrace in 32-bit mode when compiling 32-bit libraries. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Wed Aug 13 06:41:06 2014 (r269912) +++ stable/10/Makefile.inc1 Wed Aug 13 06:45:02 2014 (r269913) @@ -391,7 +391,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR LIBDIR=/usr/lib32 \ SHLIBDIR=/usr/lib32 \ LIBPRIVATEDIR=/usr/lib32/private \ - COMPILER_TYPE=${WMAKE_COMPILER_TYPE} + COMPILER_TYPE=${WMAKE_COMPILER_TYPE} \ + DTRACE="${DTRACE} -32" LIB32WMAKEFLAGS+= \ CC="${XCC} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 06:55:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CECD1EC; Wed, 13 Aug 2014 06:55:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 293E42830; Wed, 13 Aug 2014 06:55:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D6tUu4041651; Wed, 13 Aug 2014 06:55:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D6tUIs041650; Wed, 13 Aug 2014 06:55:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408130655.s7D6tUIs041650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Aug 2014 06:55: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: r269914 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 06:55:31 -0000 Author: kib Date: Wed Aug 13 06:55:30 2014 New Revision: 269914 URL: http://svnweb.freebsd.org/changeset/base/269914 Log: MFC r269642: Add wrappers to assert that vm object is unlocked and for try upgrade. Modified: stable/10/sys/vm/vm_object.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.h ============================================================================== --- stable/10/sys/vm/vm_object.h Wed Aug 13 06:45:02 2014 (r269913) +++ stable/10/sys/vm/vm_object.h Wed Aug 13 06:55:30 2014 (r269914) @@ -225,6 +225,8 @@ extern struct vm_object kmem_object_stor rw_assert(&(object)->lock, RA_RLOCKED) #define VM_OBJECT_ASSERT_WLOCKED(object) \ rw_assert(&(object)->lock, RA_WLOCKED) +#define VM_OBJECT_ASSERT_UNLOCKED(object) \ + rw_assert(&(object)->lock, RA_UNLOCKED) #define VM_OBJECT_LOCK_DOWNGRADE(object) \ rw_downgrade(&(object)->lock) #define VM_OBJECT_RLOCK(object) \ @@ -237,6 +239,8 @@ extern struct vm_object kmem_object_stor rw_try_rlock(&(object)->lock) #define VM_OBJECT_TRYWLOCK(object) \ rw_try_wlock(&(object)->lock) +#define VM_OBJECT_TRYUPGRADE(object) \ + rw_try_upgrade(&(object)->lock) #define VM_OBJECT_WLOCK(object) \ rw_wlock(&(object)->lock) #define VM_OBJECT_WUNLOCK(object) \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 06:58:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74E9951B; Wed, 13 Aug 2014 06:58:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6122A2874; Wed, 13 Aug 2014 06:58:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D6whqw042151; Wed, 13 Aug 2014 06:58:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D6whIc042150; Wed, 13 Aug 2014 06:58:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408130658.s7D6whIc042150@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 13 Aug 2014 06:58: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: r269915 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 06:58:43 -0000 Author: kib Date: Wed Aug 13 06:58:42 2014 New Revision: 269915 URL: http://svnweb.freebsd.org/changeset/base/269915 Log: MFC r269643: Weaken the requirement for the vm object lock by only asserting locked object in vm_pager_page_unswapped(), instead of locked exclusively. Modified: stable/10/sys/vm/vm_pager.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pager.h ============================================================================== --- stable/10/sys/vm/vm_pager.h Wed Aug 13 06:55:30 2014 (r269914) +++ stable/10/sys/vm/vm_pager.h Wed Aug 13 06:58:42 2014 (r269915) @@ -187,7 +187,7 @@ static __inline void vm_pager_page_unswapped(vm_page_t m) { - VM_OBJECT_ASSERT_WLOCKED(m->object); + VM_OBJECT_ASSERT_LOCKED(m->object); if (pagertab[m->object->type]->pgo_pageunswapped) (*pagertab[m->object->type]->pgo_pageunswapped)(m); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 06:59:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 194236C7; Wed, 13 Aug 2014 06:59:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0482E2891; Wed, 13 Aug 2014 06:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D6xfSD042340; Wed, 13 Aug 2014 06:59:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D6xfTM042333; Wed, 13 Aug 2014 06:59:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130659.s7D6xfTM042333@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 06:59: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: r269916 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 06:59:42 -0000 Author: hselasky Date: Wed Aug 13 06:59:40 2014 New Revision: 269916 URL: http://svnweb.freebsd.org/changeset/base/269916 Log: MFC r269604: - Implement fast interrupt handler to save CPU usage. - Cleanup some register reads and writes to use existing register access macros. - Ensure code which only applies to the control endpoint is not run for other endpoints in the data transfer path. Modified: stable/10/sys/dev/usb/controller/at91dci.c stable/10/sys/dev/usb/controller/at91dci.h stable/10/sys/dev/usb/controller/at91dci_atmelarm.c stable/10/sys/dev/usb/controller/at91dci_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/at91dci.c ============================================================================== --- stable/10/sys/dev/usb/controller/at91dci.c Wed Aug 13 06:58:42 2014 (r269915) +++ stable/10/sys/dev/usb/controller/at91dci.c Wed Aug 13 06:59:40 2014 (r269916) @@ -91,6 +91,9 @@ #define AT9100_DCI_PC2SC(pc) \ AT9100_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) +#define AT9100_DCI_THREAD_IRQ \ + (AT91_UDP_INT_BUS | AT91_UDP_INT_END_BR | AT91_UDP_INT_RXRSM | AT91_UDP_INT_RXSUSP) + #ifdef USB_DEBUG static int at91dcidebug = 0; @@ -296,17 +299,15 @@ at91dci_set_address(struct at91dci_softc } static uint8_t -at91dci_setup_rx(struct at91dci_td *td) +at91dci_setup_rx(struct at91dci_softc *sc, struct at91dci_td *td) { - struct at91dci_softc *sc; struct usb_device_request req; uint32_t csr; uint32_t temp; uint16_t count; /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x rem=%u\n", csr, td->remainder); @@ -338,7 +339,7 @@ at91dci_setup_rx(struct at91dci_td *td) goto not_complete; } /* receive data */ - bus_space_read_multi_1(td->io_tag, td->io_hdl, + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, td->fifo_reg, (void *)&req, sizeof(req)); /* copy data into real buffer */ @@ -347,9 +348,6 @@ at91dci_setup_rx(struct at91dci_td *td) td->offset = sizeof(req); td->remainder = 0; - /* get pointer to softc */ - sc = AT9100_DCI_PC2SC(td->pc); - /* sneak peek the set address */ if ((req.bmRequestType == UT_WRITE_DEVICE) && (req.bRequest == UR_SET_ADDRESS)) { @@ -367,8 +365,7 @@ at91dci_setup_rx(struct at91dci_td *td) /* write the direction of the control transfer */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); return (0); /* complete */ not_complete: @@ -383,15 +380,13 @@ not_complete: if (temp) { DPRINTFN(5, "clearing 0x%08x\n", temp); AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ - } static uint8_t -at91dci_data_rx(struct at91dci_td *td) +at91dci_data_rx(struct at91dci_softc *sc, struct at91dci_td *td) { struct usb_page_search buf_res; uint32_t csr; @@ -406,8 +401,7 @@ at91dci_data_rx(struct at91dci_td *td) /* check if any of the FIFO banks have data */ repeat: /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x rem=%u\n", csr, td->remainder); @@ -436,8 +430,7 @@ repeat: if (temp) { /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ } @@ -470,7 +463,7 @@ repeat: buf_res.length = count; } /* receive data */ - bus_space_read_multi_1(td->io_tag, td->io_hdl, + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, td->fifo_reg, buf_res.buffer, buf_res.length); /* update counters */ @@ -495,8 +488,7 @@ repeat: /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); /* * NOTE: We may have to delay a little bit before @@ -518,7 +510,7 @@ repeat: } static uint8_t -at91dci_data_tx(struct at91dci_td *td) +at91dci_data_tx(struct at91dci_softc *sc, struct at91dci_td *td) { struct usb_page_search buf_res; uint32_t csr; @@ -531,8 +523,7 @@ at91dci_data_tx(struct at91dci_td *td) repeat: /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x rem=%u\n", csr, td->remainder); @@ -552,8 +543,7 @@ repeat: if (temp) { /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ } else { @@ -569,7 +559,6 @@ repeat: count = td->remainder; } while (count > 0) { - usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ @@ -577,7 +566,7 @@ repeat: buf_res.length = count; } /* transmit data */ - bus_space_write_multi_1(td->io_tag, td->io_hdl, + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, td->fifo_reg, buf_res.buffer, buf_res.length); /* update counters */ @@ -588,8 +577,7 @@ repeat: /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); /* check remainder */ if (td->remainder == 0) { @@ -605,19 +593,13 @@ repeat: } static uint8_t -at91dci_data_tx_sync(struct at91dci_td *td) +at91dci_data_tx_sync(struct at91dci_softc *sc, struct at91dci_td *td) { - struct at91dci_softc *sc; uint32_t csr; uint32_t temp; -#if 0 -repeat: -#endif - /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x\n", csr); @@ -637,8 +619,7 @@ repeat: if (!(csr & AT91_UDP_CSR_TXCOMP)) { goto not_complete; } - sc = AT9100_DCI_PC2SC(td->pc); - if (sc->sc_dv_addr != 0xFF) { + if (td->status_reg == AT91_UDP_CSR(0) && sc->sc_dv_addr != 0xFF) { /* * The AT91 has a special requirement with regard to * setting the address and that is to write the new @@ -648,8 +629,7 @@ repeat: } /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); return (0); /* complete */ @@ -657,24 +637,26 @@ not_complete: if (temp) { /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ } -static uint8_t +static void at91dci_xfer_do_fifo(struct usb_xfer *xfer) { - struct at91dci_softc *sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); struct at91dci_td *td; uint8_t temp; DPRINTFN(9, "\n"); td = xfer->td_transfer_cache; + if (td == NULL) + return; + while (1) { - if ((td->func) (td)) { + if ((td->func) (sc, td)) { /* operation in progress */ break; } @@ -704,10 +686,9 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf if (temp & 1) td->fifo_bank = 1; } - return (1); /* not complete */ + return; done: - sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); temp = (xfer->endpointno & UE_ADDR); /* update FIFO bank flag and multi buffer */ @@ -718,23 +699,42 @@ done: } /* compute all actual lengths */ + xfer->td_transfer_cache = NULL; + sc->sc_xfer_complete = 1; +} - at91dci_standard_done(xfer); +static uint8_t +at91dci_xfer_do_complete(struct usb_xfer *xfer) +{ + struct at91dci_td *td; - return (0); /* complete */ + DPRINTFN(9, "\n"); + td = xfer->td_transfer_cache; + if (td == NULL) { + /* compute all actual lengths */ + at91dci_standard_done(xfer); + return(1); + } + return (0); } static void -at91dci_interrupt_poll(struct at91dci_softc *sc) +at91dci_interrupt_poll_locked(struct at91dci_softc *sc) { struct usb_xfer *xfer; + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) + at91dci_xfer_do_fifo(xfer); +} + +static void +at91dci_interrupt_complete_locked(struct at91dci_softc *sc) +{ + struct usb_xfer *xfer; repeat: TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (!at91dci_xfer_do_fifo(xfer)) { - /* queue has been modified */ + if (at91dci_xfer_do_complete(xfer)) goto repeat; - } } } @@ -764,20 +764,47 @@ at91dci_vbus_interrupt(struct at91dci_so } } +int +at91dci_filter_interrupt(void *arg) +{ + struct at91dci_softc *sc = arg; + int retval = FILTER_HANDLED; + uint32_t status; + + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + status = AT91_UDP_READ_4(sc, AT91_UDP_ISR); + status &= AT91_UDP_INT_DEFAULT; + + if (status & AT9100_DCI_THREAD_IRQ) + retval = FILTER_SCHEDULE_THREAD; + + /* acknowledge interrupts */ + AT91_UDP_WRITE_4(sc, AT91_UDP_ICR, status & ~AT9100_DCI_THREAD_IRQ); + + /* poll FIFOs, if any */ + at91dci_interrupt_poll_locked(sc); + + if (sc->sc_xfer_complete != 0) + retval = FILTER_SCHEDULE_THREAD; + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + + return (retval); +} + void -at91dci_interrupt(struct at91dci_softc *sc) +at91dci_interrupt(void *arg) { + struct at91dci_softc *sc = arg; uint32_t status; USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); status = AT91_UDP_READ_4(sc, AT91_UDP_ISR); - status &= AT91_UDP_INT_DEFAULT; + status &= AT9100_DCI_THREAD_IRQ; - if (!status) { - USB_BUS_UNLOCK(&sc->sc_bus); - return; - } /* acknowledge interrupts */ AT91_UDP_WRITE_4(sc, AT91_UDP_ICR, status); @@ -837,14 +864,12 @@ at91dci_interrupt(struct at91dci_softc * /* complete root HUB interrupt endpoint */ at91dci_root_intr(sc); } - /* check for any endpoint interrupts */ - - if (status & AT91_UDP_INT_EPS) { - - DPRINTFN(5, "real endpoint interrupt 0x%08x\n", status); - at91dci_interrupt_poll(sc); + if (sc->sc_xfer_complete != 0) { + sc->sc_xfer_complete = 0; + at91dci_interrupt_complete_locked(sc); } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1048,12 +1073,17 @@ at91dci_timeout(void *arg) static void at91dci_start_standard_chain(struct usb_xfer *xfer) { + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); + DPRINTFN(9, "\n"); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* poll one time */ - if (at91dci_xfer_do_fifo(xfer)) { + at91dci_xfer_do_fifo(xfer); + + if (at91dci_xfer_do_complete(xfer) == 0) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no = xfer->endpointno & UE_ADDR; /* @@ -1074,6 +1104,7 @@ at91dci_start_standard_chain(struct usb_ &at91dci_timeout, xfer->timeout); } } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1214,6 +1245,8 @@ at91dci_device_done(struct usb_xfer *xfe DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { ep_no = (xfer->endpointno & UE_ADDR); @@ -1222,8 +1255,11 @@ at91dci_device_done(struct usb_xfer *xfe DPRINTFN(15, "disable interrupts on endpoint %d\n", ep_no); } + /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1246,11 +1282,14 @@ at91dci_set_stall(struct usb_device *ude /* set FORCESTALL */ sc = AT9100_DCI_BUS2SC(udev->bus); + + USB_BUS_SPIN_LOCK(&sc->sc_bus); csr_reg = (ep->edesc->bEndpointAddress & UE_ADDR); csr_reg = AT91_UDP_CSR(csr_reg); csr_val = AT91_UDP_READ_4(sc, csr_reg); AT91_CSR_ACK(csr_val, AT91_UDP_CSR_FORCESTALL); AT91_UDP_WRITE_4(sc, csr_reg, csr_val); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1267,6 +1306,9 @@ at91dci_clear_stall_sub(struct at91dci_s /* clearing stall is not needed */ return; } + + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* compute CSR register offset */ csr_reg = AT91_UDP_CSR(ep_no); @@ -1347,6 +1389,8 @@ at91dci_clear_stall_sub(struct at91dci_s /* enable endpoint */ AT91_UDP_WRITE_4(sc, AT91_UDP_CSR(ep_no), csr_val); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1482,7 +1526,10 @@ at91dci_do_poll(struct usb_bus *bus) struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); USB_BUS_LOCK(&sc->sc_bus); - at91dci_interrupt_poll(sc); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + at91dci_interrupt_poll_locked(sc); + at91dci_interrupt_complete_locked(sc); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -2237,8 +2284,6 @@ at91dci_xfer_setup(struct usb_setup_para td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* init TD */ - td->io_tag = sc->sc_io_tag; - td->io_hdl = sc->sc_io_hdl; td->max_packet_size = xfer->max_packet_size; td->status_reg = AT91_UDP_CSR(ep_no); td->fifo_reg = AT91_UDP_FDR(ep_no); Modified: stable/10/sys/dev/usb/controller/at91dci.h ============================================================================== --- stable/10/sys/dev/usb/controller/at91dci.h Wed Aug 13 06:58:42 2014 (r269915) +++ stable/10/sys/dev/usb/controller/at91dci.h Wed Aug 13 06:59:40 2014 (r269916) @@ -133,12 +133,11 @@ bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) struct at91dci_td; +struct at91dci_softc; -typedef uint8_t (at91dci_cmd_t)(struct at91dci_td *td); +typedef uint8_t (at91dci_cmd_t)(struct at91dci_softc *sc, struct at91dci_td *td); struct at91dci_td { - bus_space_tag_t io_tag; - bus_space_handle_t io_hdl; struct at91dci_td *obj_next; at91dci_cmd_t *func; struct usb_page_cache *pc; @@ -221,6 +220,8 @@ struct at91dci_softc { void (*sc_pull_down) (void *arg); void *sc_pull_arg; + uint32_t sc_xfer_complete; + uint8_t sc_rt_addr; /* root HUB address */ uint8_t sc_dv_addr; /* device address */ uint8_t sc_conf; /* root HUB config */ @@ -235,7 +236,8 @@ struct at91dci_softc { usb_error_t at91dci_init(struct at91dci_softc *sc); void at91dci_uninit(struct at91dci_softc *sc); -void at91dci_interrupt(struct at91dci_softc *sc); +driver_filter_t at91dci_filter_interrupt; +driver_intr_t at91dci_interrupt; void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on); #endif /* _AT9100_DCI_H_ */ Modified: stable/10/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- stable/10/sys/dev/usb/controller/at91dci_atmelarm.c Wed Aug 13 06:58:42 2014 (r269915) +++ stable/10/sys/dev/usb/controller/at91dci_atmelarm.c Wed Aug 13 06:59:40 2014 (r269916) @@ -212,8 +212,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, + at91dci_filter_interrupt, at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; Modified: stable/10/sys/dev/usb/controller/at91dci_fdt.c ============================================================================== --- stable/10/sys/dev/usb/controller/at91dci_fdt.c Wed Aug 13 06:58:42 2014 (r269915) +++ stable/10/sys/dev/usb/controller/at91dci_fdt.c Wed Aug 13 06:59:40 2014 (r269916) @@ -218,13 +218,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, + at91dci_filter_interrupt, at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 07:02:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC612966; Wed, 13 Aug 2014 07:02:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8B912972; Wed, 13 Aug 2014 07:02:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D72N7X046019; Wed, 13 Aug 2014 07:02:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D72Nbe046018; Wed, 13 Aug 2014 07:02:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130702.s7D72Nbe046018@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 07:02: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: r269917 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 07:02:24 -0000 Author: hselasky Date: Wed Aug 13 07:02:23 2014 New Revision: 269917 URL: http://svnweb.freebsd.org/changeset/base/269917 Log: MFC r269566: Fix for deadlock in USB device side mode. Modified: stable/10/sys/dev/usb/usb_device.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_device.c ============================================================================== --- stable/10/sys/dev/usb/usb_device.c Wed Aug 13 06:59:40 2014 (r269916) +++ stable/10/sys/dev/usb/usb_device.c Wed Aug 13 07:02:23 2014 (r269917) @@ -451,6 +451,17 @@ usb_endpoint_foreach(struct usb_device * return (NULL); } +#if USB_HAVE_UGEN +static uint16_t +usb_get_refcount(struct usb_device *udev) +{ + if (usb_proc_is_called_from(USB_BUS_EXPLORE_PROC(udev->bus)) || + usb_proc_is_called_from(USB_BUS_CONTROL_XFER_PROC(udev->bus))) + return (1); + return (2); +} +#endif + /*------------------------------------------------------------------------* * usb_wait_pending_ref_locked * @@ -463,9 +474,7 @@ static void usb_wait_pending_ref_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); @@ -496,9 +505,7 @@ static void usb_ref_restore_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 07:08:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CDEAFE4; Wed, 13 Aug 2014 07:08:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 090C92A08; Wed, 13 Aug 2014 07:08:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D7831C046897; Wed, 13 Aug 2014 07:08:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D783mo046896; Wed, 13 Aug 2014 07:08:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130708.s7D783mo046896@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 07:08: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: r269918 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 07:08:04 -0000 Author: hselasky Date: Wed Aug 13 07:08:03 2014 New Revision: 269918 URL: http://svnweb.freebsd.org/changeset/base/269918 Log: MFC r269566: Fix for deadlock in USB device side mode. Modified: stable/9/sys/dev/usb/usb_device.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_device.c ============================================================================== --- stable/9/sys/dev/usb/usb_device.c Wed Aug 13 07:02:23 2014 (r269917) +++ stable/9/sys/dev/usb/usb_device.c Wed Aug 13 07:08:03 2014 (r269918) @@ -430,6 +430,17 @@ usb_endpoint_foreach(struct usb_device * return (NULL); } +#if USB_HAVE_UGEN +static uint16_t +usb_get_refcount(struct usb_device *udev) +{ + if (usb_proc_is_called_from(&udev->bus->explore_proc) || + usb_proc_is_called_from(&udev->bus->control_xfer_proc)) + return (1); + return (2); +} +#endif + /*------------------------------------------------------------------------* * usb_wait_pending_ref_locked * @@ -442,9 +453,7 @@ static void usb_wait_pending_ref_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - &udev->bus->explore_proc) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); @@ -475,9 +484,7 @@ static void usb_ref_restore_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - &udev->bus->explore_proc) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 07:11:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0D5448A; Wed, 13 Aug 2014 07:11:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCF392AF5; Wed, 13 Aug 2014 07:11:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D7Bb9d050278; Wed, 13 Aug 2014 07:11:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D7BbJu050277; Wed, 13 Aug 2014 07:11:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130711.s7D7BbJu050277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 07:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r269919 - stable/8/sys/dev/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 07:11:37 -0000 Author: hselasky Date: Wed Aug 13 07:11:37 2014 New Revision: 269919 URL: http://svnweb.freebsd.org/changeset/base/269919 Log: MFC r269566: Fix for deadlock in USB device side mode. Modified: stable/8/sys/dev/usb/usb_device.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Wed Aug 13 07:08:03 2014 (r269918) +++ stable/8/sys/dev/usb/usb_device.c Wed Aug 13 07:11:37 2014 (r269919) @@ -430,6 +430,17 @@ usb_endpoint_foreach(struct usb_device * return (NULL); } +#if USB_HAVE_UGEN +static uint16_t +usb_get_refcount(struct usb_device *udev) +{ + if (usb_proc_is_called_from(&udev->bus->explore_proc) || + usb_proc_is_called_from(&udev->bus->control_xfer_proc)) + return (1); + return (2); +} +#endif + /*------------------------------------------------------------------------* * usb_wait_pending_ref_locked * @@ -442,9 +453,7 @@ static void usb_wait_pending_ref_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - &udev->bus->explore_proc) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); @@ -475,9 +484,7 @@ static void usb_ref_restore_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - &udev->bus->explore_proc) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 07:13:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CCF267A; Wed, 13 Aug 2014 07:13:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE222B16; Wed, 13 Aug 2014 07:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D7Dha7051158; Wed, 13 Aug 2014 07:13:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D7DgS9051156; Wed, 13 Aug 2014 07:13:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130713.s7D7DgS9051156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 07:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269920 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 07:13:43 -0000 Author: hselasky Date: Wed Aug 13 07:13:42 2014 New Revision: 269920 URL: http://svnweb.freebsd.org/changeset/base/269920 Log: MFC r269565: Rename driver name a bit to avoid unit number confusion in dmesg. Modified: stable/10/sys/dev/usb/controller/usb_controller.c stable/10/sys/dev/usb/controller/uss820dci_atmelarm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/10/sys/dev/usb/controller/usb_controller.c Wed Aug 13 07:11:37 2014 (r269919) +++ stable/10/sys/dev/usb/controller/usb_controller.c Wed Aug 13 07:13:42 2014 (r269920) @@ -133,7 +133,7 @@ DRIVER_MODULE(usbus, xhci, usb_driver, u /* Device Only Drivers */ DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, musbotg, usb_driver, usb_devclass, 0, 0); -DRIVER_MODULE(usbus, uss820, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, uss820dci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, octusb, usb_driver, usb_devclass, 0, 0); /* Dual Mode Drivers */ Modified: stable/10/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- stable/10/sys/dev/usb/controller/uss820dci_atmelarm.c Wed Aug 13 07:11:37 2014 (r269919) +++ stable/10/sys/dev/usb/controller/uss820dci_atmelarm.c Wed Aug 13 07:13:42 2014 (r269920) @@ -77,15 +77,15 @@ static device_method_t uss820dci_methods }; static driver_t uss820dci_driver = { - .name = "uss820", + .name = "uss820dci", .methods = uss820dci_methods, .size = sizeof(struct uss820dci_softc), }; static devclass_t uss820dci_devclass; -DRIVER_MODULE(uss820, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); -MODULE_DEPEND(uss820, usb, 1, 1, 1); +DRIVER_MODULE(uss820dci, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); +MODULE_DEPEND(uss820dci, usb, 1, 1, 1); static const char *const uss820_desc = "USS820 USB Device Controller"; From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 08:18:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 325007E9; Wed, 13 Aug 2014 08:18:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE0E2233; Wed, 13 Aug 2014 08:18:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D8InPg079422; Wed, 13 Aug 2014 08:18:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D8Inlt079420; Wed, 13 Aug 2014 08:18:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130818.s7D8Inlt079420@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 08:18: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: r269921 - stable/10/sys/boot/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 08:18:50 -0000 Author: hselasky Date: Wed Aug 13 08:18:49 2014 New Revision: 269921 URL: http://svnweb.freebsd.org/changeset/base/269921 Log: MFC r266396 and r267183: Build fixes. Add support for fast interrupts. Modified: stable/10/sys/boot/usb/bsd_kernel.c stable/10/sys/boot/usb/bsd_kernel.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/usb/bsd_kernel.c ============================================================================== --- stable/10/sys/boot/usb/bsd_kernel.c Wed Aug 13 07:13:42 2014 (r269920) +++ stable/10/sys/boot/usb/bsd_kernel.c Wed Aug 13 08:18:49 2014 (r269921) @@ -380,8 +380,10 @@ device_get_parent(device_t dev) } void -device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg) +device_set_interrupt(device_t dev, driver_filter_t *filter, + driver_intr_t *fn, void *arg) { + dev->dev_irq_filter = filter; dev->dev_irq_fn = fn; dev->dev_irq_arg = arg; } @@ -395,8 +397,16 @@ device_run_interrupts(device_t parent) return; TAILQ_FOREACH(child, &parent->dev_children, dev_link) { - if (child->dev_irq_fn != NULL) - (child->dev_irq_fn) (child->dev_irq_arg); + int status; + if (child->dev_irq_filter != NULL) + status = child->dev_irq_filter(child->dev_irq_arg); + else + status = FILTER_SCHEDULE_THREAD; + + if (status == FILTER_SCHEDULE_THREAD) { + if (child->dev_irq_fn != NULL) + (child->dev_irq_fn) (child->dev_irq_arg); + } } } Modified: stable/10/sys/boot/usb/bsd_kernel.h ============================================================================== --- stable/10/sys/boot/usb/bsd_kernel.h Wed Aug 13 07:13:42 2014 (r269920) +++ stable/10/sys/boot/usb/bsd_kernel.h Wed Aug 13 08:18:49 2014 (r269921) @@ -37,6 +37,7 @@ #define isalpha(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z')) #define isdigit(x) ((x) >= '0' && (x) <= '9') #define panic(...) do { printf("USB PANIC: " __VA_ARGS__); while (1) ; } while (0) +#define rebooting 0 #define M_USB 0 #define M_USBDEV 0 #define USB_PROC_MAX 3 @@ -96,6 +97,7 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MTX_DEF 0 +#define MTX_SPIN 0 #define MTX_RECURSE 0 #define SX_DUPOK 0 #define SX_NOWITNESS 0 @@ -201,6 +203,8 @@ struct mtx { void mtx_init(struct mtx *, const char *, const char *, int); void mtx_lock(struct mtx *); void mtx_unlock(struct mtx *); +#define mtx_lock_spin(x) mtx_lock(x) +#define mtx_unlock_spin(x) mtx_unlock(x) int mtx_owned(struct mtx *); void mtx_destroy(struct mtx *); @@ -266,7 +270,11 @@ struct module_data; typedef struct driver driver_t; typedef struct devclass *devclass_t; typedef struct device *device_t; -typedef void (intr_fn_t)(void *arg); +typedef void (driver_intr_t)(void *arg); +typedef int (driver_filter_t)(void *arg); +#define FILTER_STRAY 0x01 +#define FILTER_HANDLED 0x02 +#define FILTER_SCHEDULE_THREAD 0x04 typedef int device_attach_t (device_t dev); typedef int device_detach_t (device_t dev); @@ -294,7 +302,8 @@ struct device { const struct module_data *dev_module; void *dev_sc; void *dev_aux; - intr_fn_t *dev_irq_fn; + driver_filter_t *dev_irq_filter; + driver_intr_t *dev_irq_fn; void *dev_irq_arg; uint16_t dev_unit; @@ -341,7 +350,7 @@ const char *device_get_nameunit(device_t printf("%s: " fmt, device_get_nameunit(dev),## __VA_ARGS__) device_t device_add_child(device_t dev, const char *name, int unit); void device_quiet(device_t dev); -void device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg); +void device_set_interrupt(device_t dev, driver_filter_t *, driver_intr_t *, void *); void device_run_interrupts(device_t parent); void device_set_ivars(device_t dev, void *ivars); void *device_get_ivars(device_t dev); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 08:21:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B972946; Wed, 13 Aug 2014 08:21:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 854B522D7; Wed, 13 Aug 2014 08:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D8Lspg083054; Wed, 13 Aug 2014 08:21:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D8LrSD083044; Wed, 13 Aug 2014 08:21:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130821.s7D8LrSD083044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 08:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269922 - in stable/10/sys: boot/usb conf dev/usb dev/usb/template modules/usb/template X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 08:21:54 -0000 Author: hselasky Date: Wed Aug 13 08:21:52 2014 New Revision: 269922 URL: http://svnweb.freebsd.org/changeset/base/269922 Log: MFC r269567: Add new USB phone descriptor template for USB device side mode. Added: stable/10/sys/dev/usb/template/usb_template_phone.c - copied unchanged from r269567, head/sys/dev/usb/template/usb_template_phone.c Modified: stable/10/sys/boot/usb/Makefile stable/10/sys/conf/files stable/10/sys/dev/usb/template/usb_template.c stable/10/sys/dev/usb/template/usb_template.h stable/10/sys/dev/usb/usb_ioctl.h stable/10/sys/modules/usb/template/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/usb/Makefile ============================================================================== --- stable/10/sys/boot/usb/Makefile Wed Aug 13 08:18:49 2014 (r269921) +++ stable/10/sys/boot/usb/Makefile Wed Aug 13 08:21:52 2014 (r269922) @@ -116,6 +116,7 @@ SRCS+= usb_template_modem.c SRCS+= usb_template_mouse.c SRCS+= usb_template_kbd.c SRCS+= usb_template_audio.c +SRCS+= usb_template_phone.c SRCS+= sysinit_data.c SRCS+= sysuninit_data.c Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Wed Aug 13 08:18:49 2014 (r269921) +++ stable/10/sys/conf/files Wed Aug 13 08:21:52 2014 (r269922) @@ -2524,6 +2524,7 @@ dev/usb/template/usb_template_modem.c op dev/usb/template/usb_template_mouse.c optional usb_template dev/usb/template/usb_template_msc.c optional usb_template dev/usb/template/usb_template_mtp.c optional usb_template +dev/usb/template/usb_template_phone.c optional usb_template # # USB END # Modified: stable/10/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/10/sys/dev/usb/template/usb_template.c Wed Aug 13 08:18:49 2014 (r269921) +++ stable/10/sys/dev/usb/template/usb_template.c Wed Aug 13 08:21:52 2014 (r269922) @@ -135,7 +135,7 @@ usb_make_raw_desc(struct usb_temp_setup /* check if we have got a CDC union descriptor */ - if ((raw[0] >= sizeof(struct usb_cdc_union_descriptor)) && + if ((raw[0] == sizeof(struct usb_cdc_union_descriptor)) && (raw[1] == UDESC_CS_INTERFACE) && (raw[2] == UDESCSUB_CDC_UNION)) { struct usb_cdc_union_descriptor *ud = (void *)dst; @@ -150,7 +150,7 @@ usb_make_raw_desc(struct usb_temp_setup /* check if we have got an interface association descriptor */ - if ((raw[0] >= sizeof(struct usb_interface_assoc_descriptor)) && + if ((raw[0] == sizeof(struct usb_interface_assoc_descriptor)) && (raw[1] == UDESC_IFACE_ASSOC)) { struct usb_interface_assoc_descriptor *iad = (void *)dst; @@ -162,7 +162,7 @@ usb_make_raw_desc(struct usb_temp_setup /* check if we have got a call management descriptor */ - if ((raw[0] >= sizeof(struct usb_cdc_cm_descriptor)) && + if ((raw[0] == sizeof(struct usb_cdc_cm_descriptor)) && (raw[1] == UDESC_CS_INTERFACE) && (raw[2] == UDESCSUB_CDC_CM)) { struct usb_cdc_cm_descriptor *ccd = (void *)dst; @@ -1368,6 +1368,9 @@ usb_temp_setup_by_index(struct usb_devic case USB_TEMP_MOUSE: err = usb_temp_setup(udev, &usb_template_mouse); break; + case USB_TEMP_PHONE: + err = usb_temp_setup(udev, &usb_template_phone); + break; default: return (USB_ERR_INVAL); } Modified: stable/10/sys/dev/usb/template/usb_template.h ============================================================================== --- stable/10/sys/dev/usb/template/usb_template.h Wed Aug 13 08:18:49 2014 (r269921) +++ stable/10/sys/dev/usb/template/usb_template.h Wed Aug 13 08:21:52 2014 (r269922) @@ -105,6 +105,7 @@ extern const struct usb_temp_device_desc extern const struct usb_temp_device_desc usb_template_mouse; extern const struct usb_temp_device_desc usb_template_msc; extern const struct usb_temp_device_desc usb_template_mtp; +extern const struct usb_temp_device_desc usb_template_phone; usb_error_t usb_temp_setup(struct usb_device *, const struct usb_temp_device_desc *); Copied: stable/10/sys/dev/usb/template/usb_template_phone.c (from r269567, head/sys/dev/usb/template/usb_template_phone.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/usb/template/usb_template_phone.c Wed Aug 13 08:21:52 2014 (r269922, copy of r269567, head/sys/dev/usb/template/usb_template_phone.c) @@ -0,0 +1,419 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB phone device. + */ + +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + +enum { + INDEX_PHONE_LANG, + INDEX_PHONE_MIXER, + INDEX_PHONE_RECORD, + INDEX_PHONE_PLAYBACK, + INDEX_PHONE_PRODUCT, + INDEX_PHONE_HID, + INDEX_PHONE_MAX, +}; + +#define STRING_PHONE_PRODUCT \ + "U\0S\0B\0 \0P\0h\0o\0n\0e\0 \0D\0e\0v\0i\0c\0e" + +#define STRING_PHONE_MIXER \ + "M\0i\0x\0e\0r\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +#define STRING_PHONE_RECORD \ + "R\0e\0c\0o\0r\0d\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +#define STRING_PHONE_PLAYBACK \ + "P\0l\0a\0y\0b\0a\0c\0k\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +#define STRING_PHONE_HID \ + "H\0I\0D\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_PHONE_MIXER, string_phone_mixer); +USB_MAKE_STRING_DESC(STRING_PHONE_RECORD, string_phone_record); +USB_MAKE_STRING_DESC(STRING_PHONE_PLAYBACK, string_phone_playback); +USB_MAKE_STRING_DESC(STRING_PHONE_PRODUCT, string_phone_product); +USB_MAKE_STRING_DESC(STRING_PHONE_HID, string_phone_hid); + +/* prototypes */ + +/* + * Phone Mixer description structures + * + * Some of the phone descriptors were dumped from no longer in + * production Yealink VOIP USB phone adapter: + */ +static uint8_t phone_hid_descriptor[] = { + 0x05, 0x0b, 0x09, 0x01, 0xa1, 0x01, 0x05, 0x09, + 0x19, 0x01, 0x29, 0x3f, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x80, 0x81, 0x00, 0x05, 0x08, + 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x80, 0x91, 0x00, 0xc0 +}; + +static const uint8_t phone_raw_desc_0[] = { + 0x0a, 0x24, 0x01, 0x00, 0x01, 0x4a, 0x00, 0x02, + 0x01, 0x02 +}; + +static const uint8_t phone_raw_desc_1[] = { + 0x0c, 0x24, 0x02, 0x01, 0x01, 0x02, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00 +}; + +static const uint8_t phone_raw_desc_2[] = { + 0x0c, 0x24, 0x02, 0x02, 0x01, 0x01, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00 +}; + +static const uint8_t phone_raw_desc_3[] = { + 0x09, 0x24, 0x03, 0x03, 0x01, 0x03, 0x00, 0x06, + 0x00 +}; + +static const uint8_t phone_raw_desc_4[] = { + 0x09, 0x24, 0x03, 0x04, 0x01, 0x01, 0x00, 0x05, + 0x00 +}; + +static const uint8_t phone_raw_desc_5[] = { + 0x0b, 0x24, 0x06, 0x05, 0x01, 0x02, 0x03, 0x00, + 0x03, 0x00, 0x00 +}; + +static const uint8_t phone_raw_desc_6[] = { + 0x0b, 0x24, 0x06, 0x06, 0x02, 0x02, 0x03, 0x00, + 0x03, 0x00, 0x00 +}; + +static const void *phone_raw_iface_0_desc[] = { + phone_raw_desc_0, + phone_raw_desc_1, + phone_raw_desc_2, + phone_raw_desc_3, + phone_raw_desc_4, + phone_raw_desc_5, + phone_raw_desc_6, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = phone_raw_iface_0_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_MIXER, +}; + +static const uint8_t phone_raw_desc_20[] = { + 0x07, 0x24, 0x01, 0x04, 0x01, 0x01, 0x00 +}; + +static const uint8_t phone_raw_desc_21[] = { + 0x0b, 0x24, 0x02, 0x01, 0x01, 0x02, 0x10, 0x01, + /* 8kHz */ + 0x40, 0x1f, 0x00 +}; + +static const uint8_t phone_raw_desc_22[] = { + 0x07, 0x25, 0x01, 0x00, 0x00, 0x00, 0x00 +}; + +static const void *phone_raw_iface_1_desc[] = { + phone_raw_desc_20, + phone_raw_desc_21, + NULL, +}; + +static const void *phone_raw_ep_1_desc[] = { + phone_raw_desc_22, + NULL, +}; + +static const struct usb_temp_packet_size phone_isoc_mps = { + .mps[USB_SPEED_FULL] = 0x10, + .mps[USB_SPEED_HIGH] = 0x10, +}; + +static const struct usb_temp_interval phone_isoc_interval = { + .bInterval[USB_SPEED_FULL] = 1, /* 1:1 */ + .bInterval[USB_SPEED_HIGH] = 4, /* 1:8 */ +}; + +static const struct usb_temp_endpoint_desc phone_isoc_in_ep = { + .ppRawDesc = phone_raw_ep_1_desc, + .pPacketSize = &phone_isoc_mps, + .pIntervals = &phone_isoc_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_ISOCHRONOUS, +}; + +static const struct usb_temp_endpoint_desc *phone_iface_1_ep[] = { + &phone_isoc_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_1_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_PLAYBACK, +}; + +static const struct usb_temp_interface_desc phone_iface_1_alt_1 = { + .ppEndpoints = phone_iface_1_ep, + .ppRawDesc = phone_raw_iface_1_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_PLAYBACK, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const uint8_t phone_raw_desc_30[] = { + 0x07, 0x24, 0x01, 0x02, 0x01, 0x01, 0x00 +}; + +static const uint8_t phone_raw_desc_31[] = { + 0x0b, 0x24, 0x02, 0x01, 0x01, 0x02, 0x10, 0x01, + /* 8kHz */ + 0x40, 0x1f, 0x00 +}; + +static const uint8_t phone_raw_desc_32[] = { + 0x07, 0x25, 0x01, 0x00, 0x00, 0x00, 0x00 +}; + +static const void *phone_raw_iface_2_desc[] = { + phone_raw_desc_30, + phone_raw_desc_31, + NULL, +}; + +static const void *phone_raw_ep_2_desc[] = { + phone_raw_desc_32, + NULL, +}; + +static const struct usb_temp_endpoint_desc phone_isoc_out_ep = { + .ppRawDesc = phone_raw_ep_2_desc, + .pPacketSize = &phone_isoc_mps, + .pIntervals = &phone_isoc_interval, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_ISOCHRONOUS, +}; + +static const struct usb_temp_endpoint_desc *phone_iface_2_ep[] = { + &phone_isoc_out_ep, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_2_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_RECORD, +}; + +static const struct usb_temp_interface_desc phone_iface_2_alt_1 = { + .ppEndpoints = phone_iface_2_ep, + .ppRawDesc = phone_raw_iface_2_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_RECORD, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const uint8_t phone_hid_raw_desc_0[] = { + 0x09, 0x21, 0x00, 0x01, 0x00, 0x01, 0x22, sizeof(phone_hid_descriptor), + 0x00 +}; + +static const void *phone_hid_desc_0[] = { + phone_hid_raw_desc_0, + NULL, +}; + +static const struct usb_temp_packet_size phone_hid_mps = { + .mps[USB_SPEED_FULL] = 0x10, + .mps[USB_SPEED_HIGH] = 0x10, +}; + +static const struct usb_temp_interval phone_hid_interval = { + .bInterval[USB_SPEED_FULL] = 2, /* 2ms */ + .bInterval[USB_SPEED_HIGH] = 2, /* 2ms */ +}; + +static const struct usb_temp_endpoint_desc phone_hid_in_ep = { + .pPacketSize = &phone_hid_mps, + .pIntervals = &phone_hid_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc *phone_iface_3_ep[] = { + &phone_hid_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_3 = { + .ppEndpoints = phone_iface_3_ep, + .ppRawDesc = phone_hid_desc_0, + .bInterfaceClass = 3, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_HID, +}; + +static const struct usb_temp_interface_desc *phone_interfaces[] = { + &phone_iface_0, + &phone_iface_1_alt_0, + &phone_iface_1_alt_1, + &phone_iface_2_alt_0, + &phone_iface_2_alt_1, + &phone_iface_3, + NULL, +}; + +static const struct usb_temp_config_desc phone_config_desc = { + .ppIfaceDesc = phone_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_PHONE_PRODUCT, +}; + +static const struct usb_temp_config_desc *phone_configs[] = { + &phone_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t phone_get_string_desc; +static usb_temp_get_vendor_desc_t phone_get_vendor_desc; + +const struct usb_temp_device_desc usb_template_phone = { + .getStringDesc = &phone_get_string_desc, + .getVendorDesc = &phone_get_vendor_desc, + .ppConfigDesc = phone_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0xb001, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_IN_INTERFACE, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_PHONE_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * phone_get_vendor_desc + * + * Return values: + * NULL: Failure. No such vendor descriptor. + * Else: Success. Pointer to vendor descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +phone_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen) +{ + if ((req->bmRequestType == 0x81) && (req->bRequest == 0x06) && + (req->wValue[0] == 0x00) && (req->wValue[1] == 0x22) && + (req->wIndex[1] == 0) && (req->wIndex[0] == 3 /* iface */)) { + + *plen = sizeof(phone_hid_descriptor); + return (phone_hid_descriptor); + } + return (NULL); +} + +/*------------------------------------------------------------------------* + * phone_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +phone_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_PHONE_MAX] = { + [INDEX_PHONE_LANG] = &usb_string_lang_en, + [INDEX_PHONE_MIXER] = &string_phone_mixer, + [INDEX_PHONE_RECORD] = &string_phone_record, + [INDEX_PHONE_PLAYBACK] = &string_phone_playback, + [INDEX_PHONE_PRODUCT] = &string_phone_product, + [INDEX_PHONE_HID] = &string_phone_hid, + }; + + if (string_index == 0) { + return (&usb_string_lang_en); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_PHONE_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Modified: stable/10/sys/dev/usb/usb_ioctl.h ============================================================================== --- stable/10/sys/dev/usb/usb_ioctl.h Wed Aug 13 08:18:49 2014 (r269921) +++ stable/10/sys/dev/usb/usb_ioctl.h Wed Aug 13 08:21:52 2014 (r269922) @@ -64,6 +64,7 @@ enum { USB_TEMP_AUDIO, /* USB Audio */ USB_TEMP_KBD, /* USB Keyboard */ USB_TEMP_MOUSE, /* USB Mouse */ + USB_TEMP_PHONE, /* USB Phone */ USB_TEMP_MAX, }; Modified: stable/10/sys/modules/usb/template/Makefile ============================================================================== --- stable/10/sys/modules/usb/template/Makefile Wed Aug 13 08:18:49 2014 (r269921) +++ stable/10/sys/modules/usb/template/Makefile Wed Aug 13 08:21:52 2014 (r269922) @@ -38,6 +38,7 @@ SRCS= opt_bus.h opt_usb.h device_if.h bu usb_template_modem.c \ usb_template_mouse.c \ usb_template_msc.c \ - usb_template_mtp.c + usb_template_mtp.c \ + usb_template_phone.c .include From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 08:24:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1CA4ADC; Wed, 13 Aug 2014 08:24:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 837E023FE; Wed, 13 Aug 2014 08:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7D8OnZA083527; Wed, 13 Aug 2014 08:24:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7D8OnvK083525; Wed, 13 Aug 2014 08:24:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201408130824.s7D8OnvK083525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 13 Aug 2014 08:24:49 +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: r269923 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 08:24:49 -0000 Author: hselasky Date: Wed Aug 13 08:24:48 2014 New Revision: 269923 URL: http://svnweb.freebsd.org/changeset/base/269923 Log: MFC r269565: Rename driver name a bit to avoid unit number confusion in dmesg. Modified: stable/9/sys/dev/usb/controller/usb_controller.c stable/9/sys/dev/usb/controller/uss820dci_atmelarm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/9/sys/dev/usb/controller/usb_controller.c Wed Aug 13 08:21:52 2014 (r269922) +++ stable/9/sys/dev/usb/controller/usb_controller.c Wed Aug 13 08:24:48 2014 (r269923) @@ -126,7 +126,7 @@ DRIVER_MODULE(usbus, xhci, usb_driver, u /* Device Only Drivers */ DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, musbotg, usb_driver, usb_devclass, 0, 0); -DRIVER_MODULE(usbus, uss820, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, uss820dci, usb_driver, usb_devclass, 0, 0); /*------------------------------------------------------------------------* * usb_probe Modified: stable/9/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- stable/9/sys/dev/usb/controller/uss820dci_atmelarm.c Wed Aug 13 08:21:52 2014 (r269922) +++ stable/9/sys/dev/usb/controller/uss820dci_atmelarm.c Wed Aug 13 08:24:48 2014 (r269923) @@ -77,15 +77,15 @@ static device_method_t uss820dci_methods }; static driver_t uss820dci_driver = { - .name = "uss820", + .name = "uss820dci", .methods = uss820dci_methods, .size = sizeof(struct uss820dci_softc), }; static devclass_t uss820dci_devclass; -DRIVER_MODULE(uss820, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); -MODULE_DEPEND(uss820, usb, 1, 1, 1); +DRIVER_MODULE(uss820dci, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); +MODULE_DEPEND(uss820dci, usb, 1, 1, 1); static const char *const uss820_desc = "USS820 USB Device Controller"; From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 11:11:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5038EF; Wed, 13 Aug 2014 11:11:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0A1C2721; Wed, 13 Aug 2014 11:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DBBRms062420; Wed, 13 Aug 2014 11:11:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DBBRUD062419; Wed, 13 Aug 2014 11:11:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201408131111.s7DBBRUD062419@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 13 Aug 2014 11:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269925 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 11:11:27 -0000 Author: trasz Date: Wed Aug 13 11:11:27 2014 New Revision: 269925 URL: http://svnweb.freebsd.org/changeset/base/269925 Log: MFC r269197: Fix potential double free that could happen after connection error. Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Wed Aug 13 09:34:33 2014 (r269924) +++ stable/10/sys/dev/iscsi/icl.c Wed Aug 13 11:11:27 2014 (r269925) @@ -669,7 +669,10 @@ icl_conn_receive_pdu(struct icl_conn *ic } if (error != 0) { - icl_pdu_free(request); + /* + * Don't free the PDU; it's pointed to by ic->ic_receive_pdu + * and will get freed in icl_conn_close(). + */ icl_conn_fail(ic); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:32:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 054E09F6; Wed, 13 Aug 2014 12:32:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB030212F; Wed, 13 Aug 2014 12:32:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCWrmt006228; Wed, 13 Aug 2014 12:32:53 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCWrkk006224; Wed, 13 Aug 2014 12:32:53 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131232.s7DCWrkk006224@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269928 - in stable/10: . etc/mtree share/examples share/examples/cvsup X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:32:54 -0000 Author: gavin Date: Wed Aug 13 12:32:52 2014 New Revision: 269928 URL: http://svnweb.freebsd.org/changeset/base/269928 Log: Merge r267867 from head: Remove example cvsup config files. Deleted: stable/10/share/examples/cvsup/ Modified: stable/10/ObsoleteFiles.inc stable/10/etc/mtree/BSD.usr.dist stable/10/share/examples/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Aug 13 12:31:36 2014 (r269927) +++ stable/10/ObsoleteFiles.inc Wed Aug 13 12:32:52 2014 (r269928) @@ -45,6 +45,11 @@ OLD_FILES+=usr/share/examples/libusb20/a OLD_FILES+=usr/share/man/man9/VOP_GETVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_DESTROYVOBJECT.9.gz +OLD_FILES+=usr/share/examples/cvsup/README +OLD_FILES+=usr/share/examples/cvsup/cvs-supfile +OLD_FILES+=usr/share/examples/cvsup/stable-supfile +OLD_FILES+=usr/share/examples/cvsup/standard-supfile +OLD_DIRS+=usr/share/examples/cvsup # 20140614: send-pr removal OLD_FILES+=usr/share/man/man1/send-pr.1.gz OLD_FILES+=etc/gnats/freefall Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Wed Aug 13 12:31:36 2014 (r269927) +++ stable/10/etc/mtree/BSD.usr.dist Wed Aug 13 12:32:52 2014 (r269928) @@ -301,8 +301,6 @@ .. csh .. - cvsup - .. diskless .. drivers Modified: stable/10/share/examples/Makefile ============================================================================== --- stable/10/share/examples/Makefile Wed Aug 13 12:31:36 2014 (r269927) +++ stable/10/share/examples/Makefile Wed Aug 13 12:32:52 2014 (r269928) @@ -10,7 +10,6 @@ LDIRS= BSD_daemon \ bhyve \ bootforth \ csh \ - cvsup \ diskless \ drivers \ etc \ @@ -52,10 +51,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ bootforth/menuconf.4th \ bootforth/screen.4th \ csh/dot.cshrc \ - cvsup/README \ - cvsup/cvs-supfile \ - cvsup/stable-supfile \ - cvsup/standard-supfile \ diskless/ME \ diskless/README.BOOTP \ diskless/README.TEMPLATING \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:35:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44057B53; Wed, 13 Aug 2014 12:35:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 302472149; Wed, 13 Aug 2014 12:35:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCZCX8006667; Wed, 13 Aug 2014 12:35:12 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCZChR006666; Wed, 13 Aug 2014 12:35:12 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131235.s7DCZChR006666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:35: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: r269929 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:35:12 -0000 Author: gavin Date: Wed Aug 13 12:35:11 2014 New Revision: 269929 URL: http://svnweb.freebsd.org/changeset/base/269929 Log: Merge r268488 from head: Reword an awkward option description PR: 191726 Submitted by: yaneurabeya gmail.com Modified: stable/10/usr.sbin/jail/jail.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Wed Aug 13 12:32:52 2014 (r269928) +++ stable/10/usr.sbin/jail/jail.8 Wed Aug 13 12:35:11 2014 (r269929) @@ -653,8 +653,9 @@ file, instead of in the prison's file. The user to run commands as, when running in the system environment. The default is to run the commands as the current user. .It Va exec.timeout -The maximum amount of time to wait for a command to complete. -If a command is still running after this many seconds have passed, +The maximum amount of time to wait for a command to complete, in +seconds. +If a command is still running after this timeout has passed, the jail not be created or removed. .It Va exec.consolelog A file to direct command output (stdout and stderr) to. From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:37:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CD43FA9; Wed, 13 Aug 2014 12:37:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 092F32172; Wed, 13 Aug 2014 12:37:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCaxD5007152; Wed, 13 Aug 2014 12:36:59 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCaxZ0007151; Wed, 13 Aug 2014 12:36:59 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131236.s7DCaxZ0007151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269933 - stable/10/games/fortune/fortune X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:37:00 -0000 Author: gavin Date: Wed Aug 13 12:36:59 2014 New Revision: 269933 URL: http://svnweb.freebsd.org/changeset/base/269933 Log: Merge r268637 from head: fortune(8): Search fortune files installed by ports/packages as well as those supplied by the base system. PR: 191800 Submitted by: Andy Kosela Modified: stable/10/games/fortune/fortune/pathnames.h Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/fortune/pathnames.h ============================================================================== --- stable/10/games/fortune/fortune/pathnames.h Wed Aug 13 12:35:39 2014 (r269932) +++ stable/10/games/fortune/fortune/pathnames.h Wed Aug 13 12:36:59 2014 (r269933) @@ -30,4 +30,5 @@ * $FreeBSD$ */ -#define FORTDIR "/usr/share/games/fortune" +#define FORTDIR "/usr/share/games/fortune:" \ + "/usr/local/share/games/fortune" From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:38:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 203BE1C8; Wed, 13 Aug 2014 12:38:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2A02198; Wed, 13 Aug 2014 12:38:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCc83u007449; Wed, 13 Aug 2014 12:38:08 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCc8Sa007448; Wed, 13 Aug 2014 12:38:08 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131238.s7DCc8Sa007448@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:38: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: r269934 - stable/9/games/fortune/fortune X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:38:09 -0000 Author: gavin Date: Wed Aug 13 12:38:08 2014 New Revision: 269934 URL: http://svnweb.freebsd.org/changeset/base/269934 Log: Merge r268637 from head: fortune(8): Search fortune files installed by ports/packages as well as those supplied by the base system. PR: 191800 Submitted by: Andy Kosela Modified: stable/9/games/fortune/fortune/pathnames.h Directory Properties: stable/9/games/fortune/fortune/ (props changed) Modified: stable/9/games/fortune/fortune/pathnames.h ============================================================================== --- stable/9/games/fortune/fortune/pathnames.h Wed Aug 13 12:36:59 2014 (r269933) +++ stable/9/games/fortune/fortune/pathnames.h Wed Aug 13 12:38:08 2014 (r269934) @@ -30,4 +30,5 @@ * $FreeBSD$ */ -#define FORTDIR "/usr/share/games/fortune" +#define FORTDIR "/usr/share/games/fortune:" \ + "/usr/local/share/games/fortune" From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:41:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 571223CD; Wed, 13 Aug 2014 12:41:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 431682258; Wed, 13 Aug 2014 12:41:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCfWv3009450; Wed, 13 Aug 2014 12:41:32 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCfWiX009449; Wed, 13 Aug 2014 12:41:32 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131241.s7DCfWiX009449@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12: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: r269935 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:41:32 -0000 Author: gavin Date: Wed Aug 13 12:41:31 2014 New Revision: 269935 URL: http://svnweb.freebsd.org/changeset/base/269935 Log: Merge r268725 from head: Since r202933, kthread_suspend_check() takes no arguments. Update the example to match. Modified: stable/10/share/man/man9/kthread.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/kthread.9 ============================================================================== --- stable/10/share/man/man9/kthread.9 Wed Aug 13 12:38:08 2014 (r269934) +++ stable/10/share/man/man9/kthread.9 Wed Aug 13 12:41:31 2014 (r269935) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2010 +.Dd July 15, 2014 .Dt KTHREAD 9 .Os .Sh NAME @@ -275,7 +275,7 @@ buf_daemon() bufdaemonthread, SHUTDOWN_PRI_LAST); ... for (;;) { - kthread_suspend_check(bufdaemonthread); + kthread_suspend_check(); ... } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:42:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E49D9503; Wed, 13 Aug 2014 12:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0D36225C; Wed, 13 Aug 2014 12:42:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCgFAO011419; Wed, 13 Aug 2014 12:42:15 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCgFfB011418; Wed, 13 Aug 2014 12:42:15 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131242.s7DCgFfB011418@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:42: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: r269936 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:42:16 -0000 Author: gavin Date: Wed Aug 13 12:42:15 2014 New Revision: 269936 URL: http://svnweb.freebsd.org/changeset/base/269936 Log: Merge r268725 from head: Since r202933, kthread_suspend_check() takes no arguments. Update the example to match. Modified: stable/9/share/man/man9/kthread.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/kthread.9 ============================================================================== --- stable/9/share/man/man9/kthread.9 Wed Aug 13 12:41:31 2014 (r269935) +++ stable/9/share/man/man9/kthread.9 Wed Aug 13 12:42:15 2014 (r269936) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2010 +.Dd July 15, 2014 .Dt KTHREAD 9 .Os .Sh NAME @@ -275,7 +275,7 @@ buf_daemon() bufdaemonthread, SHUTDOWN_PRI_LAST); ... for (;;) { - kthread_suspend_check(bufdaemonthread); + kthread_suspend_check(); ... } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:44:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91DF96C1; Wed, 13 Aug 2014 12:44:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E416227F; Wed, 13 Aug 2014 12:44:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCiik1011824; Wed, 13 Aug 2014 12:44:44 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCiiAG011823; Wed, 13 Aug 2014 12:44:44 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131244.s7DCiiAG011823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:44: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: r269937 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:44:44 -0000 Author: gavin Date: Wed Aug 13 12:44:44 2014 New Revision: 269937 URL: http://svnweb.freebsd.org/changeset/base/269937 Log: Merge r268728 from head: When we fail to extract the pkg binaries (for example, / is read-only), give a more helpful error message. Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Wed Aug 13 12:42:15 2014 (r269936) +++ stable/10/usr.sbin/pkg/pkg.c Wed Aug 13 12:44:44 2014 (r269937) @@ -126,7 +126,8 @@ extract_pkg_static(int fd, char *p, int if (r == ARCHIVE_OK) ret = 0; else - warnx("fail to extract pkg-static"); + warnx("failed to extract pkg-static: %s", + archive_error_string(a)); cleanup: archive_read_free(a); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:45:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54EC9814; Wed, 13 Aug 2014 12:45:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4107C2288; Wed, 13 Aug 2014 12:45:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCjQ45012026; Wed, 13 Aug 2014 12:45:26 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCjQHA012024; Wed, 13 Aug 2014 12:45:26 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131245.s7DCjQHA012024@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269938 - stable/9/usr.sbin/pkg X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:45:26 -0000 Author: gavin Date: Wed Aug 13 12:45:25 2014 New Revision: 269938 URL: http://svnweb.freebsd.org/changeset/base/269938 Log: Merge r268728 from head: When we fail to extract the pkg binaries (for example, / is read-only), give a more helpful error message. Modified: stable/9/usr.sbin/pkg/pkg.c Directory Properties: stable/9/usr.sbin/pkg/ (props changed) Modified: stable/9/usr.sbin/pkg/pkg.c ============================================================================== --- stable/9/usr.sbin/pkg/pkg.c Wed Aug 13 12:44:44 2014 (r269937) +++ stable/9/usr.sbin/pkg/pkg.c Wed Aug 13 12:45:25 2014 (r269938) @@ -126,7 +126,8 @@ extract_pkg_static(int fd, char *p, int if (r == ARCHIVE_OK) ret = 0; else - warnx("fail to extract pkg-static"); + warnx("failed to extract pkg-static: %s", + archive_error_string(a)); cleanup: archive_read_free(a); From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:47:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65F41C3B; Wed, 13 Aug 2014 12:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5264B22C5; Wed, 13 Aug 2014 12:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DClqef012532; Wed, 13 Aug 2014 12:47:52 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DClqGS012531; Wed, 13 Aug 2014 12:47:52 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131247.s7DClqGS012531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269939 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:47:52 -0000 Author: gavin Date: Wed Aug 13 12:47:51 2014 New Revision: 269939 URL: http://svnweb.freebsd.org/changeset/base/269939 Log: Merge r268842 from head: Fix two typos in iscsictl.8 PR: 191581 Submitted by: Jimmy Olgeni Modified: stable/10/usr.bin/iscsictl/iscsictl.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Wed Aug 13 12:45:25 2014 (r269938) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Wed Aug 13 12:47:51 2014 (r269939) @@ -83,7 +83,7 @@ The default is Target host name or address used for SendTargets discovery. When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, -and the temporary discovery sesion will be removed. +and the temporary discovery session will be removed. .It Fl n The "nickname" of session defined in the configuration file. .It Fl p @@ -98,7 +98,7 @@ CHAP login. Verbose mode. .El .Pp -Certain parameters are neccessary when adding a session. +Certain parameters are necessary when adding a session. One can specify these either via command line (using the .Fl t , .Fl p , From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:55:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A2A5E69; Wed, 13 Aug 2014 12:55:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA9CC2488; Wed, 13 Aug 2014 12:55:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCti1L016905; Wed, 13 Aug 2014 12:55:44 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCtiUc016904; Wed, 13 Aug 2014 12:55:44 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131255.s7DCtiUc016904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:55: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: r269940 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:55:45 -0000 Author: gavin Date: Wed Aug 13 12:55:44 2014 New Revision: 269940 URL: http://svnweb.freebsd.org/changeset/base/269940 Log: Merge r267859 (by bapt), r268998 from head: o Mark send-pr info page as an obsolete file o /usr/bin/sendbug and the sendbug(1) man page were part of send-pr and are no longer installed since r267486 (r267734 in stable/10). Add them to ObsoleteFiles.inc1, which should have been done in r267486. PR: 192010 (partial) Submitted by: Vick Khera (partial) Modified: stable/10/ObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Aug 13 12:47:51 2014 (r269939) +++ stable/10/ObsoleteFiles.inc Wed Aug 13 12:55:44 2014 (r269940) @@ -51,7 +51,10 @@ OLD_FILES+=usr/share/examples/cvsup/stab OLD_FILES+=usr/share/examples/cvsup/standard-supfile OLD_DIRS+=usr/share/examples/cvsup # 20140614: send-pr removal +OLD_FILES+=usr/bin/sendbug +OLD_FILES+=usr/share/info/send-pr.info.gz OLD_FILES+=usr/share/man/man1/send-pr.1.gz +OLD_FILES+=usr/share/man/man1/sendbug.1.gz OLD_FILES+=etc/gnats/freefall OLD_DIRS+=etc/gnats # 20140512: new clang import which bumps version from 3.4 to 3.4.1. From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 12:58:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED24010A; Wed, 13 Aug 2014 12:58:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D93B324A7; Wed, 13 Aug 2014 12:58:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCwFXQ017486; Wed, 13 Aug 2014 12:58:15 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCwFxd017485; Wed, 13 Aug 2014 12:58:15 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408131258.s7DCwFxd017485@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 12:58: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: r269941 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 12:58:16 -0000 Author: gavin Date: Wed Aug 13 12:58:15 2014 New Revision: 269941 URL: http://svnweb.freebsd.org/changeset/base/269941 Log: Merge r267859 (by bapt), r268998 from head: o Mark send-pr info page as an obsolete file o /usr/bin/sendbug and the sendbug(1) man page were part of send-pr and are no longer installed since r267486 (r267734 in stable/10). Add them to ObsoleteFiles.inc1, which should have been done in r267486. PR: 192010 (partial) Submitted by: Vick Khera (partial) Modified: stable/9/ObsoleteFiles.inc (contents, props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Wed Aug 13 12:55:44 2014 (r269940) +++ stable/9/ObsoleteFiles.inc Wed Aug 13 12:58:15 2014 (r269941) @@ -43,7 +43,10 @@ OLD_FILES+=usr/share/man/man9/VOP_GETVOB OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_DESTROYVOBJECT.9.gz # 20140614: send-pr removal +OLD_FILES+=usr/bin/sendbug +OLD_FILES+=usr/share/info/send-pr.info.gz OLD_FILES+=usr/share/man/man1/send-pr.1.gz +OLD_FILES+=usr/share/man/man1/sendbug.1.gz OLD_FILES+=etc/gnats/freefall OLD_DIRS+=etc/gnats # 20140512: new clang import which bumps version from 3.4 to 3.4.1. From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 14:49:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39F0AB3A; Wed, 13 Aug 2014 14:49:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26A5920FF; Wed, 13 Aug 2014 14:49:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DEnqml067729; Wed, 13 Aug 2014 14:49:52 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DEnqv8067728; Wed, 13 Aug 2014 14:49:52 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201408131449.s7DEnqv8067728@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Wed, 13 Aug 2014 14:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269942 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 14:49:52 -0000 Author: pluknet Date: Wed Aug 13 14:49:51 2014 New Revision: 269942 URL: http://svnweb.freebsd.org/changeset/base/269942 Log: Fixed ENOMEM description. MFC after: 1 week Sponsored by: Nginx, Inc. Modified: head/lib/libc/gen/posix_spawnattr_init.3 Modified: head/lib/libc/gen/posix_spawnattr_init.3 ============================================================================== --- head/lib/libc/gen/posix_spawnattr_init.3 Wed Aug 13 12:58:15 2014 (r269941) +++ head/lib/libc/gen/posix_spawnattr_init.3 Wed Aug 13 14:49:51 2014 (r269942) @@ -100,7 +100,7 @@ The function will fail if: .Bl -tag -width Er .It Bq Er ENOMEM -Insufficient memory exists to initialize the spawn file actions object. +Insufficient memory exists to initialize the spawn attributes object. .El .Sh SEE ALSO .Xr posix_spawn 3 , From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 15:48:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC9A92FE; Wed, 13 Aug 2014 15:48:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B908C2837; Wed, 13 Aug 2014 15:48:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DFmA2Y095071; Wed, 13 Aug 2014 15:48:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DFmATv095070; Wed, 13 Aug 2014 15:48:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201408131548.s7DFmATv095070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 13 Aug 2014 15:48: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: r269944 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 15:48:10 -0000 Author: ae Date: Wed Aug 13 15:48:10 2014 New Revision: 269944 URL: http://svnweb.freebsd.org/changeset/base/269944 Log: MFC r269306: Add new rule to source address selection algorithm. It prefers address with better virtual status. Use ifa_preferred() to choose better address. PR: 187341 Modified: stable/10/sys/netinet6/in6_src.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6_src.c ============================================================================== --- stable/10/sys/netinet6/in6_src.c Wed Aug 13 15:29:29 2014 (r269943) +++ stable/10/sys/netinet6/in6_src.c Wed Aug 13 15:48:10 2014 (r269944) @@ -443,6 +443,12 @@ in6_selectsrc(struct sockaddr_in6 *dstso REPLACE(8); /* + * Rule 9: prefer address with better virtual status. + */ + if (ifa_preferred(&ia_best->ia_ifa, &ia->ia_ifa)) + REPLACE(9); + + /* * Rule 14: Use longest matching prefix. * Note: in the address selection draft, this rule is * documented as "Rule 8". However, since it is also From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 15:50:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EDED5D1; Wed, 13 Aug 2014 15:50:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6124D285E; Wed, 13 Aug 2014 15:50:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DFoIX6096185; Wed, 13 Aug 2014 15:50:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DFoGnQ096175; Wed, 13 Aug 2014 15:50:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201408131550.s7DFoGnQ096175@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 13 Aug 2014 15:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269945 - in head: lib/libc/net sys/conf sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 15:50:18 -0000 Author: tuexen Date: Wed Aug 13 15:50:16 2014 New Revision: 269945 URL: http://svnweb.freebsd.org/changeset/base/269945 Log: Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUS socket options. This includes managing the correspoing stat counters. Add the SCTP_DETAILED_STR_STATS kernel option to control per policy counters on every stream. The default is off and only an aggregated counter is available. This is sufficient for the RTCWeb usecase. MFC after: 1 week Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/conf/options head/sys/netinet/sctp.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed Aug 13 15:48:10 2014 (r269944) +++ head/lib/libc/net/sctp_sys_calls.c Wed Aug 13 15:50:16 2014 (r269945) @@ -377,6 +377,12 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_ENABLE_STREAM_RESET: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; + case SCTP_PR_STREAM_STATUS: + ((struct sctp_prstatus *)arg)->sprstat_assoc_id = id; + break; + case SCTP_PR_ASSOC_STATUS: + ((struct sctp_prstatus *)arg)->sprstat_assoc_id = id; + break; default: break; } Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/conf/options Wed Aug 13 15:50:16 2014 (r269945) @@ -457,6 +457,7 @@ SCTP_LTRACE_ERRORS opt_sctp.h # Log to K SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs SCTP_LOCAL_TRACE_BUF opt_sctp.h # Use tracebuffer exported via sysctl +SCTP_DETAILED_STR_STATS opt_sctp.h # Use per PR-SCTP policy stream stats # # # Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctp.h Wed Aug 13 15:50:16 2014 (r269945) @@ -140,6 +140,8 @@ struct sctp_paramhdr { #define SCTP_GET_ASSOC_NUMBER 0x00000104 /* ro */ #define SCTP_GET_ASSOC_ID_LIST 0x00000105 /* ro */ #define SCTP_TIMEOUTS 0x00000106 +#define SCTP_PR_STREAM_STATUS 0x00000107 +#define SCTP_PR_ASSOC_STATUS 0x00000108 /* * user socket options: BSD implementation specific Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctp_input.c Wed Aug 13 15:50:16 2014 (r269945) @@ -1469,6 +1469,11 @@ sctp_process_cookie_existing(struct mbuf int spec_flag = 0; uint32_t how_indx; +#if defined(SCTP_DETAILED_STR_STATS) + int j; + +#endif + net = *netp; /* I know that the TCB is non-NULL from the caller */ asoc = &stcb->asoc; @@ -1931,6 +1936,15 @@ sctp_process_cookie_existing(struct mbuf sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].chunks_on_queues = 0; +#if defined(SCTP_DETAILED_STR_STATS) + for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { + asoc->strmout[i].abandoned_sent[j] = 0; + asoc->strmout[i].abandoned_unsent[j] = 0; + } +#else + asoc->strmout[i].abandoned_sent[0] = 0; + asoc->strmout[i].abandoned_unsent[0] = 0; +#endif stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctp_output.c Wed Aug 13 15:50:16 2014 (r269945) @@ -3618,6 +3618,11 @@ sctp_process_cmsgs_for_init(struct sctp_ struct sctp_stream_out *tmp_str; unsigned int i; +#if defined(SCTP_DETAILED_STR_STATS) + int j; + +#endif + /* Default is NOT correct */ SCTPDBG(SCTP_DEBUG_OUTPUT1, "Ok, default:%d pre_open:%d\n", stcb->asoc.streamoutcnt, stcb->asoc.pre_open_streams); @@ -3638,6 +3643,15 @@ sctp_process_cmsgs_for_init(struct sctp_ TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].next_sequence_send = 0; +#if defined(SCTP_DETAILED_STR_STATS) + for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { + stcb->asoc.strmout[i].abandoned_sent[j] = 0; + stcb->asoc.strmout[i].abandoned_unsent[j] = 0; + } +#else + stcb->asoc.strmout[i].abandoned_sent[0] = 0; + stcb->asoc.strmout[i].abandoned_unsent[0] = 0; +#endif stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); @@ -11923,6 +11937,11 @@ sctp_send_str_reset_req(struct sctp_tcb struct sctp_stream_queue_pending *sp, *nsp; int i; +#if defined(SCTP_DETAILED_STR_STATS) + int j; + +#endif + oldstream = stcb->asoc.strmout; /* get some more */ SCTP_MALLOC(stcb->asoc.strmout, struct sctp_stream_out *, @@ -11968,6 +11987,15 @@ sctp_send_str_reset_req(struct sctp_tcb for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].chunks_on_queues = 0; +#if defined(SCTP_DETAILED_STR_STATS) + for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { + stcb->asoc.strmout[i].abandoned_sent[j] = 0; + stcb->asoc.strmout[i].abandoned_unsent[j] = 0; + } +#else + stcb->asoc.strmout[i].abandoned_sent[0] = 0; + stcb->asoc.strmout[i].abandoned_unsent[0] = 0; +#endif stcb->asoc.strmout[i].next_sequence_send = 0x0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctp_structs.h Wed Aug 13 15:50:16 2014 (r269945) @@ -587,6 +587,14 @@ struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; uint32_t chunks_on_queues; +#if defined(SCTP_DETAILED_STR_STATS) + uint32_t abandoned_unsent[SCTP_PR_SCTP_MAX + 1]; + uint32_t abandoned_sent[SCTP_PR_SCTP_MAX + 1]; +#else + /* Only the aggregation */ + uint32_t abandoned_unsent[1]; + uint32_t abandoned_sent[1]; +#endif uint16_t stream_no; uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; @@ -1211,6 +1219,8 @@ struct sctp_association { uint32_t timoshutdownack; struct timeval start_time; struct timeval discontinuity_time; + uint64_t abandoned_unsent[SCTP_PR_SCTP_MAX + 1]; + uint64_t abandoned_sent[SCTP_PR_SCTP_MAX + 1]; }; #endif Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctp_uio.h Wed Aug 13 15:50:16 2014 (r269945) @@ -249,18 +249,23 @@ struct sctp_snd_all_completes { SCTP_SACK_IMMEDIATELY)) != 0) /* for the endpoint */ -/* The lower byte is an enumeration of PR-SCTP policies */ +/* The lower four bits is an enumeration of PR-SCTP policies */ #define SCTP_PR_SCTP_NONE 0x0000/* Reliable transfer */ #define SCTP_PR_SCTP_TTL 0x0001/* Time based PR-SCTP */ #define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */ #define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */ +#define SCTP_PR_SCTP_MAX SCTP_PR_SCTP_RTX +#define SCTP_PR_SCTP_ALL 0x000f/* Used for aggregated stats */ #define PR_SCTP_POLICY(x) ((x) & 0x0f) -#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE) +#define PR_SCTP_ENABLED(x) ((PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE) && \ + (PR_SCTP_POLICY(x) != SCTP_PR_SCTP_ALL)) #define PR_SCTP_TTL_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL) #define PR_SCTP_BUF_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF) #define PR_SCTP_RTX_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX) -#define PR_SCTP_INVALID_POLICY(x) (PR_SCTP_POLICY(x) > SCTP_PR_SCTP_RTX) +#define PR_SCTP_INVALID_POLICY(x) (PR_SCTP_POLICY(x) > SCTP_PR_SCTP_MAX) +#define PR_SCTP_VALID_POLICY(x) (PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX) + /* Stat's */ struct sctp_pcbinfo { uint32_t ep_count; @@ -719,6 +724,14 @@ struct sctp_udpencaps { uint16_t sue_port; }; +struct sctp_prstatus { + sctp_assoc_t sprstat_assoc_id; + uint16_t sprstat_sid; + uint16_t sprstat_policy; + uint64_t sprstat_abandoned_unsent; + uint64_t sprstat_abandoned_sent; +}; + struct sctp_cwnd_args { struct sctp_nets *net; /* network to *//* FIXME: LP64 issue */ uint32_t cwnd_new_value;/* cwnd in k */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctp_usrreq.c Wed Aug 13 15:50:16 2014 (r269945) @@ -3510,6 +3510,72 @@ flags_out: } break; } + case SCTP_PR_STREAM_STATUS: + { + struct sctp_prstatus *sprstat; + uint16_t sid; + uint16_t policy; + + SCTP_CHECK_AND_CAST(sprstat, optval, struct sctp_prstatus, *optsize); + SCTP_FIND_STCB(inp, stcb, sprstat->sprstat_assoc_id); + + sid = sprstat->sprstat_sid; + policy = sprstat->sprstat_policy; +#if defined(SCTP_DETAILED_STR_STATS) + if ((stcb != NULL) && + (policy != SCTP_PR_SCTP_NONE) && + (sid < stcb->asoc.streamoutcnt) && + ((policy == SCTP_PR_SCTP_ALL) || + (PR_SCTP_VALID_POLICY(policy)))) { +#else + if ((stcb != NULL) && + (policy != SCTP_PR_SCTP_NONE) && + (sid < stcb->asoc.streamoutcnt) && + (policy == SCTP_PR_SCTP_ALL)) { +#endif + if (policy == SCTP_PR_SCTP_ALL) { + sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; + sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; + } else { + sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[policy]; + sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[policy]; + } + SCTP_TCB_UNLOCK(stcb); + *optsize = sizeof(struct sctp_prstatus); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + break; + } + case SCTP_PR_ASSOC_STATUS: + { + struct sctp_prstatus *sprstat; + uint16_t policy; + + SCTP_CHECK_AND_CAST(sprstat, optval, struct sctp_prstatus, *optsize); + SCTP_FIND_STCB(inp, stcb, sprstat->sprstat_assoc_id); + + policy = sprstat->sprstat_policy; + if ((stcb != NULL) && + (policy != SCTP_PR_SCTP_NONE) && + ((policy == SCTP_PR_SCTP_ALL) || + (PR_SCTP_VALID_POLICY(policy)))) { + if (policy == SCTP_PR_SCTP_ALL) { + sprstat->sprstat_abandoned_unsent = stcb->asoc.abandoned_unsent[0]; + sprstat->sprstat_abandoned_sent = stcb->asoc.abandoned_sent[0]; + } else { + sprstat->sprstat_abandoned_unsent = stcb->asoc.abandoned_unsent[policy]; + sprstat->sprstat_abandoned_sent = stcb->asoc.abandoned_sent[policy]; + } + SCTP_TCB_UNLOCK(stcb); + *optsize = sizeof(struct sctp_prstatus); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Aug 13 15:48:10 2014 (r269944) +++ head/sys/netinet/sctputil.c Wed Aug 13 15:50:16 2014 (r269945) @@ -896,6 +896,11 @@ sctp_init_asoc(struct sctp_inpcb *inp, s */ int i; +#if defined(SCTP_DETAILED_STR_STATS) + int j; + +#endif + asoc = &stcb->asoc; /* init all variables to a known value. */ SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_INUSE); @@ -1056,6 +1061,15 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].chunks_on_queues = 0; +#if defined(SCTP_DETAILED_STR_STATS) + for (j = 0; j < SCTP_PR_SCTP_MAX + 1; j++) { + asoc->strmout[i].abandoned_sent[j] = 0; + asoc->strmout[i].abandoned_unsent[j] = 0; + } +#else + asoc->strmout[i].abandoned_sent[0] = 0; + asoc->strmout[i].abandoned_unsent[0] = 0; +#endif asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); @@ -1111,6 +1125,10 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->timoshutdownack = 0; (void)SCTP_GETTIME_TIMEVAL(&asoc->start_time); asoc->discontinuity_time = asoc->start_time; + for (i = 0; i < SCTP_PR_SCTP_MAX + 1; i++) { + asoc->abandoned_unsent[i] = 0; + asoc->abandoned_sent[i] = 0; + } /* * sa_ignore MEMLEAK {memory is put in the assoc mapping array and * freed later when the association is freed. @@ -4713,6 +4731,21 @@ sctp_release_pr_sctp_chunk(struct sctp_t stream = tp1->rec.data.stream_number; seq = tp1->rec.data.stream_seq; + if (sent || !(tp1->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG)) { + stcb->asoc.abandoned_sent[0]++; + stcb->asoc.abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++; + stcb->asoc.strmout[stream].abandoned_sent[0]++; +#if defined(SCTP_DETAILED_STR_STATS) + stcb->asoc.strmout[stream].abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++; +#endif + } else { + stcb->asoc.abandoned_unsent[0]++; + stcb->asoc.abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++; + stcb->asoc.strmout[stream].abandoned_unsent[0]++; +#if defined(SCTP_DETAILED_STR_STATS) + stcb->asoc.strmout[stream].abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++; +#endif + } do { ret_sz += tp1->book_size; if (tp1->data != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 16:11:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E0D5C75; Wed, 13 Aug 2014 16:11:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79EF02B30; Wed, 13 Aug 2014 16:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DGBwIc007595; Wed, 13 Aug 2014 16:11:58 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DGBv0P007591; Wed, 13 Aug 2014 16:11:57 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201408131611.s7DGBv0P007591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 13 Aug 2014 16:11: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: r269946 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 16:11:58 -0000 Author: rpaulo Date: Wed Aug 13 16:11:57 2014 New Revision: 269946 URL: http://svnweb.freebsd.org/changeset/base/269946 Log: MFC r268300 r268541 r268544 r268565 r269775 r269838 r269839 r269840 r269842 r269844 r269899: BSD make support for generating and compiling USDT DTrace probes. Deleted: stable/10/share/mk/bsd.dtrace.mk Modified: stable/10/share/mk/Makefile stable/10/share/mk/bsd.dep.mk stable/10/share/mk/bsd.lib.mk stable/10/share/mk/bsd.prog.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/Makefile ============================================================================== --- stable/10/share/mk/Makefile Wed Aug 13 15:50:16 2014 (r269945) +++ stable/10/share/mk/Makefile Wed Aug 13 16:11:57 2014 (r269946) @@ -11,7 +11,6 @@ FILES= \ bsd.crunchgen.mk \ bsd.dep.mk \ bsd.doc.mk \ - bsd.dtrace.mk \ bsd.endian.mk \ bsd.files.mk \ bsd.incs.mk \ Modified: stable/10/share/mk/bsd.dep.mk ============================================================================== --- stable/10/share/mk/bsd.dep.mk Wed Aug 13 15:50:16 2014 (r269945) +++ stable/10/share/mk/bsd.dep.mk Wed Aug 13 16:11:57 2014 (r269946) @@ -73,7 +73,7 @@ tags: ${SRCS} CLEANFILES?= .if !exists(${.OBJDIR}/${DEPENDFILE}) -.for _S in ${SRCS:N*.[hly]} +.for _S in ${SRCS:N*.[dhly]} ${_S:R}.o: ${_S} .endfor .endif @@ -121,14 +121,36 @@ ${_YC:R}.o: ${_YC} .endfor # DTrace probe definitions +# libelf is currently needed for drti.o +.if ${SRCS:M*.d} +LDFLAGS+= -lelf +LDADD+= ${LIBELF} +CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR} +.endif .for _DSRC in ${SRCS:M*.d:N*/*} -.for _DH in ${_DSRC:R}.h -${_DH}: ${_DSRC} - ${DTRACE} -xnolibs -h -s ${.ALLSRC} -SRCS:= ${SRCS:S/${_DSRC}/${_DH}/} -CLEANFILES+= ${_DH} +.for _D in ${_DSRC:R} +DHDRS+= ${_D}.h +${_D}.h: ${_DSRC} + ${DTRACE} -xnolibs -h -s ${.ALLSRC} +SRCS:= ${SRCS:S/${_DSRC}/${_D}.h/} +OBJS+= ${_D}.o +CLEANFILES+= ${_D}.h ${_D}.o +${_D}.o: ${_D}.h ${OBJS:S/${_D}.o//} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ + ${OBJS:S/${_D}.o//} +.if defined(LIB) +CLEANFILES+= ${_D}.So ${_D}.po +${_D}.So: ${_D}.h ${SOBJS:S/${_D}.So//} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ + ${SOBJS:S/${_D}.So//} +${_D}.po: ${_D}.h ${POBJS:S/${_D}.po//} + ${DTRACE} -xnolibs -G -o ${.TARGET} -s ${.CURDIR}/${_DSRC} \ + ${POBJS:S/${_D}.po//} +.endif .endfor .endfor +beforedepend: ${DHDRS} +beforebuild: ${DHDRS} .endif .if !target(depend) Modified: stable/10/share/mk/bsd.lib.mk ============================================================================== --- stable/10/share/mk/bsd.lib.mk Wed Aug 13 15:50:16 2014 (r269945) +++ stable/10/share/mk/bsd.lib.mk Wed Aug 13 16:11:57 2014 (r269946) @@ -117,7 +117,8 @@ PO_FLAG=-pg ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} -all: objwarn +all: beforebuild .WAIT +beforebuild: objwarn .if defined(PRIVATELIB) _LIBDIR:=${LIBPRIVATEDIR} Modified: stable/10/share/mk/bsd.prog.mk ============================================================================== --- stable/10/share/mk/bsd.prog.mk Wed Aug 13 15:50:16 2014 (r269945) +++ stable/10/share/mk/bsd.prog.mk Wed Aug 13 16:11:57 2014 (r269946) @@ -146,7 +146,8 @@ MAN1= ${MAN} .endif .endif # defined(PROG) -all: objwarn ${PROG} ${SCRIPTS} +all: beforebuild .WAIT ${PROG} ${SCRIPTS} +beforebuild: objwarn .if ${MK_MAN} != "no" all: _manpages .endif From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 16:42:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DD879F7; Wed, 13 Aug 2014 16:42:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A7092EE4; Wed, 13 Aug 2014 16:42:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DGgj8x023263; Wed, 13 Aug 2014 16:42:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DGgj7G023262; Wed, 13 Aug 2014 16:42:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201408131642.s7DGgj7G023262@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 13 Aug 2014 16:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269948 - head/contrib/gcc/config/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 16:42:45 -0000 Author: dim Date: Wed Aug 13 16:42:44 2014 New Revision: 269948 URL: http://svnweb.freebsd.org/changeset/base/269948 Log: Supplement r259111 by also using correct casts in gcc's emmintrin.h for the first argument of the following builtin function: * __builtin_ia32_psrlqi128() takes __v2di instead of __v4si This should fix the following errors when building the graphics/webp port with base gcc: lossless_sse2.c:403: error: incompatible type for argument 1 of '__builtin_ia32_psrlqi128' lossless_sse2.c:404: error: incompatible type for argument 1 of '__builtin_ia32_psrlqi128' Reported by: Jos Chrispijn MFC after: 3 days Modified: head/contrib/gcc/config/i386/emmintrin.h Modified: head/contrib/gcc/config/i386/emmintrin.h ============================================================================== --- head/contrib/gcc/config/i386/emmintrin.h Wed Aug 13 16:20:41 2014 (r269947) +++ head/contrib/gcc/config/i386/emmintrin.h Wed Aug 13 16:42:44 2014 (r269948) @@ -1193,7 +1193,7 @@ _mm_srli_epi64 (__m128i __A, int __B) #define _mm_srli_epi32(__A, __B) \ ((__m128i)__builtin_ia32_psrldi128 ((__v4si)(__A), __B)) #define _mm_srli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psrlqi128 ((__v4si)(__A), __B)) + ((__m128i)__builtin_ia32_psrlqi128 ((__v2di)(__A), __B)) #endif static __inline __m128i __attribute__((__always_inline__)) From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 19:06:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12F984FE; Wed, 13 Aug 2014 19:06:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F298E20D7; Wed, 13 Aug 2014 19:06:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DJ6VW2087057; Wed, 13 Aug 2014 19:06:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DJ6UPN087045; Wed, 13 Aug 2014 19:06:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201408131906.s7DJ6UPN087045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 13 Aug 2014 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269950 - head/share/vt/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 19:06:32 -0000 Author: emaste Date: Wed Aug 13 19:06:29 2014 New Revision: 269950 URL: http://svnweb.freebsd.org/changeset/base/269950 Log: Copy country-code .iso syscons keymaps for vt(4) Existing syscons ISO 8859-1 keymaps (??.iso.kbd) are usable without change as Unicode keymaps for vt(4). Sponsored by: The FreeBSD Foundation Added: head/share/vt/keymaps/be.kbd - copied unchanged from r269585, head/share/syscons/keymaps/be.iso.kbd head/share/vt/keymaps/fr.kbd - copied unchanged from r269585, head/share/syscons/keymaps/fr.iso.kbd head/share/vt/keymaps/hr.kbd - copied unchanged from r269585, head/share/syscons/keymaps/hr.iso.kbd head/share/vt/keymaps/it.kbd - copied unchanged from r269585, head/share/syscons/keymaps/it.iso.kbd head/share/vt/keymaps/pt.kbd - copied unchanged from r269585, head/share/syscons/keymaps/pt.iso.kbd head/share/vt/keymaps/si.kbd - copied unchanged from r269585, head/share/syscons/keymaps/si.iso.kbd head/share/vt/keymaps/uk.kbd - copied unchanged from r269585, head/share/syscons/keymaps/uk.iso.kbd head/share/vt/keymaps/us.kbd - copied unchanged from r269585, head/share/syscons/keymaps/us.iso.kbd Modified: head/share/vt/keymaps/Makefile Modified: head/share/vt/keymaps/Makefile ============================================================================== --- head/share/vt/keymaps/Makefile Wed Aug 13 16:53:12 2014 (r269949) +++ head/share/vt/keymaps/Makefile Wed Aug 13 19:06:29 2014 (r269950) @@ -1,6 +1,16 @@ # $FreeBSD$ -FILES= pl.kbd ua.kbd ua.shift.alt.kbd +FILES= be.kbd \ + fr.kbd \ + hr.kbd \ + it.kbd \ + pl.kbd \ + pt.kbd \ + si.kbd \ + ua.kbd \ + ua.shift.alt.kbd \ + uk.kbd \ + us.kbd FILESDIR= ${SHAREDIR}/vt/keymaps Copied: head/share/vt/keymaps/be.kbd (from r269585, head/share/syscons/keymaps/be.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/be.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/be.iso.kbd) @@ -0,0 +1,114 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '&' '1' nop nop '|' '|' nop nop O + 003 233 '2' nul nul '@' '@' nul nul O + 004 '"' '3' nop nop '#' '#' nop nop O + 005 ''' '4' nop nop ''' '4' nop nop O + 006 '(' '5' nop nop '(' '5' nop nop O + 007 167 '6' rs rs '^' '^' rs rs O + 008 232 '7' nop nop 232 '7' nop nop O + 009 '!' '8' nop nop '!' '8' nop nop O + 010 231 '9' nop nop '{' '{' nop nop O + 011 224 '0' nop nop '}' '}' nop nop O + 012 ')' 176 nop nop ')' 176 nop nop O + 013 '-' '_' us us '-' '_' us us O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'a' 'A' soh soh 'a' 'A' soh soh C + 017 'z' 'Z' sub sub 'z' 'Z' sub sub C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '^' 168 esc esc '[' '[' esc esc O + 027 '$' '*' gs gs ']' ']' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 'm' 'M' cr cr 'm' 'M' cr cr C + 040 249 '%' nop nop ''' ''' nop nop O + 041 178 179 nop nop 178 179 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 181 163 nop nop '`' '`' nop nop O + 044 'w' 'W' etb etb 'w' 'W' etb etb C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 ',' '?' nop nop ',' '?' nop nop O + 051 ';' '.' nop nop ';' '.' nop nop O + 052 ':' '/' nop nop ':' '/' nop nop O + 053 '=' '+' nop nop '~' '~' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' fs fs '\' '\' '\' fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O Copied: head/share/vt/keymaps/fr.kbd (from r269585, head/share/syscons/keymaps/fr.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/fr.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/fr.iso.kbd) @@ -0,0 +1,114 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '&' '1' nop nop nop nop nop nop C + 003 233 '2' nul nul '~' nop nop nop C + 004 '"' '3' nop nop '#' nop nop nop C + 005 ''' '4' nop nop '{' nop nop nop C + 006 '(' '5' nop nop '[' nop nop nop C + 007 '-' '6' nop nop '|' nop nop nop C + 008 232 '7' nop nop '`' nop nop nop C + 009 '_' '8' nop nop '\' nop fs nop C + 010 231 '9' nop nop '^' nop nop nop C + 011 224 '0' nop nop '@' nop nop nop C + 012 ')' 176 nop nop ']' nop nop nop C + 013 '=' '+' nop nop '}' nop nop nop C + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'a' 'A' soh soh 226 228 dc1 dc1 C + 017 'z' 'Z' sub sub 'z' 'Z' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 237 236 em em C + 022 'u' 'U' nak nak 251 252 nak nak C + 023 'i' 'I' ht ht 238 239 ht ht C + 024 'o' 'O' si si 244 246 si si C + 025 'p' 'P' dle dle 247 230 dle dle C + 026 234 244 esc esc '[' '{' esc esc O + 027 '$' 163 gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'q' 'Q' dc1 dc1 'q' 'Q' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 'm' 'M' cr cr 'm' 'M' cr cr C + 040 249 '%' nul nul ''' '@' nul nul O + 041 178 nop nop nop '|' '|' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '*' 181 nop nop '#' '~' nop nop O + 044 'w' 'W' etb etb 'w' 'W' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 223 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 ',' '?' nop nop nop nop nop nop O + 051 ';' '.' nop nop ',' '<' nop nop O + 052 ':' '/' nop nop '.' '>' nop nop O + 053 '!' 167 nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' fs fs 171 187 fs fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O Copied: head/share/vt/keymaps/hr.kbd (from r269585, head/share/syscons/keymaps/hr.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/hr.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/hr.iso.kbd) @@ -0,0 +1,116 @@ +# Slovenian keyboard +# Blaz Zupan +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '~' '~' nop nop O + 003 '2' '"' nul nul 183 183 nul nul O + 004 '3' '#' nop nop '^' '^' nop nop O + 005 '4' '$' nop nop 162 162 nop nop O + 006 '5' '%' nop nop 176 176 nop nop O + 007 '6' '&' rs rs 178 178 rs rs O + 008 '7' '/' nop nop '`' '`' nop nop O + 009 '8' '(' nop nop 255 255 nop nop O + 010 '9' ')' nop nop ''' ''' nop nop O + 011 '0' '=' nop nop 189 189 nop nop O + 012 ''' '?' us us 168 168 us us O + 013 '+' '*' nop nop 184 184 nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 '\' '\' dc1 dc1 C + 017 'w' 'W' etb etb '|' '|' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'z' 'Z' sub sub 'z' 'Z' sub sub C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 185 169 esc esc 247 247 esc esc C + 027 240 208 gs gs 215 215 gs gs C + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack '[' '[' ack ack C + 034 'g' 'G' bel bel ']' ']' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 179 179 vt vt C + 038 'l' 'L' ff ff 163 163 ff ff C + 039 232 200 nop nop 232 200 nop nop C + 040 230 198 nop nop 223 223 nop nop C + 041 184 168 nop nop 184 168 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 190 174 fs fs 164 164 fs fs C + 044 'y' 'Y' em em 'y' 'Y' em em C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn '@' '@' syn syn C + 048 'b' 'B' stx stx '{' '{' stx stx C + 049 'n' 'N' so so '}' '}' so so C + 050 'm' 'M' cr cr 167 167 cr cr C + 051 ',' ';' nop nop '<' ';' '<' nop O + 052 '.' ':' nop nop '>' ':' '>' nop O + 053 '-' '_' nop nop '-' '_' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del ',' ',' ',' ',' ',' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop '<' '>' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O Copied: head/share/vt/keymaps/it.kbd (from r269585, head/share/syscons/keymaps/it.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/it.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/it.iso.kbd) @@ -0,0 +1,172 @@ +# $FreeBSD$ +# +# Aggiunte ad una tastiera italiana standard : +# +# -- ~ : SHIFT + ALT + a accentata +# -- { : SHIFT + [ +# : ALT + 7 +# -- } : SHIFT + ] +# : ALT + 0 +# -- [ : definita anche come ALT + 8 +# -- ] : definita anche come ALT + 9 +# -- ` : ALT + ' +# : CTRL + ' +# +# Per usare la mappatura dare i seguenti comandi: +# +# vidcontrol -f 8x16 iso15-8x16.fnt +# kbdcontrol -l it.iso.kbd +# setenv LANG it_IT.ISO8859-15 +# setenv MM_CHARSET iso-8859-15 +# setenv TERM cons25l1 +# +# Per l'utilizzo della stessa in modo permanente e/o +# per eventuali note su specifiche applicazioni: +# Gruppo utenti FreeBSD Italia - http://www.gufi.org +# Gianmarco Home Page - http://www.gufi.org/~gmarco +# +# +# Credits to: +# +# Gianmarco Giovannelli +# Nicola Vitale +# Marco Trentini +# +#################################################################### +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop 185 161 nop nop O + 003 '2' '"' nul duml 178 nop nul nul O + 004 '3' 163 nop nop 179 163 nop nop O + 005 '4' '$' nop nop 188 '$' nop nop O + 006 '5' '%' nop nop 189 nop nop nop O + 007 '6' '&' rs rs 190 nop rs rs O + 008 '7' '/' nop nop '{' nop nop nop O + 009 '8' '(' nop nop '[' nop nop nop O + 010 '9' ')' nop nop ']' 177 nop nop O + 011 '0' '=' nop nop '}' 176 nop nop O + 012 ''' '?' 96 dacu 96 191 us dgra O + 013 236 '^' nop dcir '~' dogo nop dtil O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 '@' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb nop nop etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 167 174 dc2 dc2 C + 020 't' 'T' dc4 dc4 nop nop dc4 dc4 C + 021 'y' 'Y' em em nop 165 em em C + 022 'u' 'U' nak nak nop nop nak nak C + 023 'i' 'I' ht ht nop nop ht ht C + 024 'o' 'O' si si 248 216 si si C + 025 'p' 'P' dle dle 254 222 dle dle C + 026 232 233 esc esc '[' '{' esc esc O + 027 '+' '*' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 230 198 soh soh C + 031 's' 'S' dc3 dc3 223 167 dc3 dc3 C + 032 'd' 'D' eot eot 240 208 eot eot C + 033 'f' 'F' ack ack nop 170 ack ack C + 034 'g' 'G' bel bel nop nop bel bel C + 035 'h' 'H' bs bs nop nop bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' '&' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 242 231 nop nop '@' ddac nop nop O + 040 224 176 nop drin '#' '~' nop dtil O + 041 '\' '|' fs nop 172 nop nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 249 167 fs dgra fs fs fs dbre O + 044 'z' 'Z' sub sub 171 60 sub sub C + 045 'x' 'X' can can 187 62 can can C + 046 'c' 'C' etx etx 162 169 etx etx C + 047 'v' 'V' syn syn nop 96 syn syn C + 048 'b' 'B' stx stx nop 39 stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 181 186 cr cr C + 051 ',' ';' nop nop 95 215 nop nop O + 052 '.' ':' nop nop 183 247 nop nop O + 053 '-' '_' nop nop ddot ddot nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop 124 166 nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr nscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot pdwn O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dacu ''' ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + ( 'o' 245 ) ( 'O' 213 ) + dmac 175 + dbre 000 + ddot 000 + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) + dsla 000 + drin 176 ( 'a' 229 ) ( 'A' 197 ) + dced 184 ( 'c' 231 ) ( 'C' 199 ) + dapo 000 + ddac 000 + dogo 000 + dcar 000 Copied: head/share/vt/keymaps/pt.kbd (from r269585, head/share/syscons/keymaps/pt.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/pt.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/pt.iso.kbd) @@ -0,0 +1,116 @@ +#pt.iso.kbd +#by: pm@dee.uc.pt +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '"' nul nul '@' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '&' rs rs '6' '^' rs rs O + 008 '7' '/' nop nop '{' '&' nop nop O + 009 '8' '(' nop nop '[' '*' nop nop O + 010 '9' ')' nop nop ']' '(' nop nop O + 011 '0' '=' nop nop '}' ')' nop nop O + 012 ''' '?' ns ns '-' '_' ns ns O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '+' '*' esc esc 'h' '{' esc esc O + 027 ''' '`' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 231 199 nop nop ';' ':' nop nop O + 040 nop nop nop nop ''' '"' nop nop O + 041 '\' '|' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '~' '^' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' ';' nop nop nop nop nop nop C + 052 '.' ':' nop nop '.' '>' nop nop O + 053 '-' '_' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' 130 ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr cr cr cr cr cr cr O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O Copied: head/share/vt/keymaps/si.kbd (from r269585, head/share/syscons/keymaps/si.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/si.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/si.iso.kbd) @@ -0,0 +1,116 @@ +# Slovenian keyboard +# Blaz Zupan +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '~' '~' nop nop O + 003 '2' '"' nul nul 183 183 nul nul O + 004 '3' '#' nop nop '^' '^' nop nop O + 005 '4' '$' nop nop 162 162 nop nop O + 006 '5' '%' nop nop 176 176 nop nop O + 007 '6' '&' rs rs 178 178 rs rs O + 008 '7' '/' nop nop '`' '`' nop nop O + 009 '8' '(' nop nop 255 255 nop nop O + 010 '9' ')' nop nop ''' ''' nop nop O + 011 '0' '=' nop nop 189 189 nop nop O + 012 ''' '?' us us 168 168 us us O + 013 '+' '*' nop nop 184 184 nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 '\' '\' dc1 dc1 C + 017 'w' 'W' etb etb '|' '|' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'z' 'Z' sub sub 'z' 'Z' sub sub C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 185 169 esc esc 247 247 esc esc C + 027 240 208 gs gs 215 215 gs gs C + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack '[' '[' ack ack C + 034 'g' 'G' bel bel ']' ']' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 179 179 vt vt C + 038 'l' 'L' ff ff 163 163 ff ff C + 039 232 200 nop nop 232 200 nop nop C + 040 230 198 nop nop 223 223 nop nop C + 041 184 168 nop nop 184 168 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 190 174 fs fs 164 164 fs fs C + 044 'y' 'Y' em em 'y' 'Y' em em C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn '@' '@' syn syn C + 048 'b' 'B' stx stx '{' '{' stx stx C + 049 'n' 'N' so so '}' '}' so so C + 050 'm' 'M' cr cr 167 167 cr cr C + 051 ',' ';' nop nop ',' ';' nop nop O + 052 '.' ':' nop nop '.' ':' nop nop O + 053 '-' '_' nop nop '-' '_' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del ',' ',' ',' ',' ',' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop '<' '>' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O Copied: head/share/vt/keymaps/uk.kbd (from r269585, head/share/syscons/keymaps/uk.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/uk.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/uk.iso.kbd) @@ -0,0 +1,114 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '`' '`' nop nop O + 003 '2' '"' nul nul '@' '@' nul nul O + 004 '3' 163 nop nop '#' '#' nop nop O + 005 '4' '$' 164 164 '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '^' '^' rs rs O + 008 '7' '&' nop nop '[' '[' esc esc O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop ']' ']' gs gs O + 011 '0' ')' nop nop '{' '{' nop nop O + 012 '-' '_' us us '|' '|' us us O + 013 '=' '+' nop nop '}' '}' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '@' nul nul ''' '@' nul nul O + 041 '`' 172 nop nop '|' '|' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '#' '~' nop nop '~' '~' nop nop O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '\' '|' fs fs '\' '|' fs fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O Copied: head/share/vt/keymaps/us.kbd (from r269585, head/share/syscons/keymaps/us.iso.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/us.kbd Wed Aug 13 19:06:29 2014 (r269950, copy of r269585, head/share/syscons/keymaps/us.iso.kbd) @@ -0,0 +1,114 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' us us '-' '_' us us O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '"' nop nop ''' '"' nop nop O + 041 '`' '~' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 19:43:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BED05214; Wed, 13 Aug 2014 19:43:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCBF25AA; Wed, 13 Aug 2014 19:43:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DJhNrW005034; Wed, 13 Aug 2014 19:43:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DJhNiq005031; Wed, 13 Aug 2014 19:43:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201408131943.s7DJhNiq005031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 13 Aug 2014 19:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269951 - in head: share/mk tools/tools/ath/athaggrstats tools/tools/ath/athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 19:43:23 -0000 Author: adrian Date: Wed Aug 13 19:43:22 2014 New Revision: 269951 URL: http://svnweb.freebsd.org/changeset/base/269951 Log: Make the libbsdstat useful again. Modified: head/share/mk/src.libnames.mk head/tools/tools/ath/athaggrstats/Makefile head/tools/tools/ath/athstats/Makefile Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Aug 13 19:06:29 2014 (r269950) +++ head/share/mk/src.libnames.mk Wed Aug 13 19:43:22 2014 (r269951) @@ -17,6 +17,10 @@ LIBATF_CXXDIR= ${ROOTOBJDIR}/lib/atf/lib LDATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.so LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.a +LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat +LDBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.so +LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a + LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc LDHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.so LIBHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.a Modified: head/tools/tools/ath/athaggrstats/Makefile ============================================================================== --- head/tools/tools/ath/athaggrstats/Makefile Wed Aug 13 19:06:29 2014 (r269950) +++ head/tools/tools/ath/athaggrstats/Makefile Wed Aug 13 19:43:22 2014 (r269951) @@ -12,8 +12,8 @@ CLEANFILES+= opt_ah.h CFLAGS+=-DATH_SUPPORT_ANI CFLAGS+=-DATH_SUPPORT_TDMA -USEPRIVATELIB= -LDADD=-lbsdstat +USEPRIVATELIB=bsdstat +LDADD= ${LDBSDSTAT} opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Wed Aug 13 19:06:29 2014 (r269950) +++ head/tools/tools/ath/athstats/Makefile Wed Aug 13 19:43:22 2014 (r269951) @@ -23,8 +23,9 @@ CFLAGS+=-DATH_SUPPORT_TDMA CFLAGS.clang+= -fbracket-depth=512 -USEPRIVATELIB= -LDADD= -lbsdstat +USEPRIVATELIB= bsdstat + +LDADD= ${LDBSDSTAT} opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 19:55:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50BB85BE; Wed, 13 Aug 2014 19:55:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CAF226B3; Wed, 13 Aug 2014 19:55:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DJtFHg009829; Wed, 13 Aug 2014 19:55:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DJtFIu009828; Wed, 13 Aug 2014 19:55:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201408131955.s7DJtFIu009828@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 13 Aug 2014 19:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269952 - head/share/vt/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 19:55:15 -0000 Author: emaste Date: Wed Aug 13 19:55:14 2014 New Revision: 269952 URL: http://svnweb.freebsd.org/changeset/base/269952 Log: Remove trailing whitespace Modified: head/share/vt/keymaps/it.kbd Modified: head/share/vt/keymaps/it.kbd ============================================================================== --- head/share/vt/keymaps/it.kbd Wed Aug 13 19:43:22 2014 (r269951) +++ head/share/vt/keymaps/it.kbd Wed Aug 13 19:55:14 2014 (r269952) @@ -4,12 +4,12 @@ # # -- ~ : SHIFT + ALT + a accentata # -- { : SHIFT + [ -# : ALT + 7 +# : ALT + 7 # -- } : SHIFT + ] # : ALT + 0 -# -- [ : definita anche come ALT + 8 -# -- ] : definita anche come ALT + 9 -# -- ` : ALT + ' +# -- [ : definita anche come ALT + 8 +# -- ] : definita anche come ALT + 9 +# -- ` : ALT + ' # : CTRL + ' # # Per usare la mappatura dare i seguenti comandi: @@ -20,8 +20,8 @@ # setenv MM_CHARSET iso-8859-15 # setenv TERM cons25l1 # -# Per l'utilizzo della stessa in modo permanente e/o -# per eventuali note su specifiche applicazioni: +# Per l'utilizzo della stessa in modo permanente e/o +# per eventuali note su specifiche applicazioni: # Gruppo utenti FreeBSD Italia - http://www.gufi.org # Gianmarco Home Page - http://www.gufi.org/~gmarco # @@ -32,7 +32,7 @@ # Nicola Vitale # Marco Trentini # -#################################################################### +#################################################################### # alt # scan cntrl alt alt cntrl lock # code base shift cntrl shift alt shift cntrl shift state @@ -77,7 +77,7 @@ 037 'k' 'K' vt vt 'k' '&' vt vt C 038 'l' 'L' ff ff 'l' 'L' ff ff C 039 242 231 nop nop '@' ddac nop nop O - 040 224 176 nop drin '#' '~' nop dtil O + 040 224 176 nop drin '#' '~' nop dtil O 041 '\' '|' fs nop 172 nop nop nop O 042 lshift lshift lshift lshift lshift lshift lshift lshift O 043 249 167 fs dgra fs fs fs dbre O @@ -146,22 +146,22 @@ 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O - dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) - ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) ( 'u' 249 ) ( 'U' 217 ) - dacu ''' ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) - ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) - ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) - dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) - ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + dacu ''' ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) ( 'u' 251 ) ( 'U' 219 ) - dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) ( 'o' 245 ) ( 'O' 213 ) dmac 175 dbre 000 ddot 000 - duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) - ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) dsla 000 drin 176 ( 'a' 229 ) ( 'A' 197 ) From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 21:18:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5E65161; Wed, 13 Aug 2014 21:18:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2C1620B3; Wed, 13 Aug 2014 21:18:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DLIVZR046743; Wed, 13 Aug 2014 21:18:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DLIVP9046742; Wed, 13 Aug 2014 21:18:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408132118.s7DLIVP9046742@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 13 Aug 2014 21:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269953 - head/sbin/newfs_msdos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 21:18:31 -0000 Author: pfg Date: Wed Aug 13 21:18:31 2014 New Revision: 269953 URL: http://svnweb.freebsd.org/changeset/base/269953 Log: Use "NO NAME" as the default unnamed label. Microsoft recommends avoiding the use of spaces in the string structures for FAT. Unfortunately they do just that by default in the case of unlabeled filesystems. Follow the default MS behavior to avoid confusion in common tools like file(1). This was actually the default behavior before r203868. Obtained from: NetBSD (CVS rev. 1.39) MFC after: 3 days Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Wed Aug 13 19:55:14 2014 (r269952) +++ head/sbin/newfs_msdos/newfs_msdos.c Wed Aug 13 21:18:31 2014 (r269953) @@ -689,7 +689,7 @@ main(int argc, char *argv[]) ((u_int)tm->tm_hour << 8 | (u_int)tm->tm_min)); mk4(bsx->exVolumeID, x); - mklabel(bsx->exVolumeLabel, opt_L ? opt_L : "NO_NAME"); + mklabel(bsx->exVolumeLabel, opt_L ? opt_L : "NO NAME"); sprintf(buf, "FAT%u", fat); setstr(bsx->exFileSysType, buf, sizeof(bsx->exFileSysType)); if (!opt_B) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 21:38:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD40E8BF; Wed, 13 Aug 2014 21:38:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9A6E228F; Wed, 13 Aug 2014 21:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DLcTJW056055; Wed, 13 Aug 2014 21:38:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DLcT6O056053; Wed, 13 Aug 2014 21:38:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201408132138.s7DLcT6O056053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 13 Aug 2014 21:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269954 - in head/lib/clang/include: clang/Config llvm/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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 21:38:29 -0000 Author: dim Date: Wed Aug 13 21:38:29 2014 New Revision: 269954 URL: http://svnweb.freebsd.org/changeset/base/269954 Log: Stop telling people to directly report llvm or clang bugs upstream, point them to the FreeBSD bug tracker instead, since we use our own patches. MFC after: 3 days Modified: head/lib/clang/include/clang/Config/config.h head/lib/clang/include/llvm/Config/config.h Modified: head/lib/clang/include/clang/Config/config.h ============================================================================== --- head/lib/clang/include/clang/Config/config.h Wed Aug 13 21:18:31 2014 (r269953) +++ head/lib/clang/include/clang/Config/config.h Wed Aug 13 21:38:29 2014 (r269954) @@ -6,7 +6,7 @@ #define CONFIG_H /* Bug report URL. */ -#define BUG_REPORT_URL "http://llvm.org/bugs/" +#define BUG_REPORT_URL "https://bugs.freebsd.org/submit/" /* Relative directory for resource files */ #define CLANG_RESOURCE_DIR "" Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Wed Aug 13 21:18:31 2014 (r269953) +++ head/lib/clang/include/llvm/Config/config.h Wed Aug 13 21:38:29 2014 (r269954) @@ -9,7 +9,7 @@ #include /* Bug report URL. */ -#define BUG_REPORT_URL "http://llvm.org/bugs/" +#define BUG_REPORT_URL "https://bugs.freebsd.org/submit/" /* Define if we have libxml2 */ /* #undef CLANG_HAVE_LIBXML */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 13 22:34:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CED1B69; Wed, 13 Aug 2014 22:34:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 692F72906; Wed, 13 Aug 2014 22:34:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DMYFLu083255; Wed, 13 Aug 2014 22:34:15 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DMYFl2083254; Wed, 13 Aug 2014 22:34:15 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408132234.s7DMYFl2083254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 13 Aug 2014 22:34: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: r269955 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 22:34:15 -0000 Author: gavin Date: Wed Aug 13 22:34:14 2014 New Revision: 269955 URL: http://svnweb.freebsd.org/changeset/base/269955 Log: Add a header to the entries for the removal of csup example files. This is a direct commit to 10, as the equivelent commit to head included other changes that will not be merged to stable branches. Modified: stable/10/ObsoleteFiles.inc Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Aug 13 21:38:29 2014 (r269954) +++ stable/10/ObsoleteFiles.inc Wed Aug 13 22:34:14 2014 (r269955) @@ -45,6 +45,7 @@ OLD_FILES+=usr/share/examples/libusb20/a OLD_FILES+=usr/share/man/man9/VOP_GETVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_DESTROYVOBJECT.9.gz +# 20140625: csup example files removal OLD_FILES+=usr/share/examples/cvsup/README OLD_FILES+=usr/share/examples/cvsup/cvs-supfile OLD_FILES+=usr/share/examples/cvsup/stable-supfile From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 04:20:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6DA15FD; Thu, 14 Aug 2014 04:20:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 928F12B4F; Thu, 14 Aug 2014 04:20:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4KFCL043471; Thu, 14 Aug 2014 04:20:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4KE7M043466; Thu, 14 Aug 2014 04:20:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408140420.s7E4KE7M043466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 04:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269956 - in head: lib/libc/arm/aeabi lib/msun/arm sys/arm/arm sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:20:15 -0000 Author: imp Date: Thu Aug 14 04:20:13 2014 New Revision: 269956 URL: http://svnweb.freebsd.org/changeset/base/269956 Log: From https://sourceware.org/ml/newlib/2014/msg00113.html By Richard Earnshaw at ARM > >GCC has for a number of years provides a set of pre-defined macros for >use with determining the ISA and features of the target during >pre-processing. However, the design was always somewhat cumbersome in >that each new architecture revision created a new define and then >removed the previous one. This meant that it was necessary to keep >updating the support code simply to recognise a new architecture being >added. > >The ACLE specification (ARM C Language Extentions) >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html) >provides a much more suitable interface and GCC has supported this >since gcc-4.8. > >This patch makes use of the ACLE pre-defines to map to the internal >feature definitions. To support older versions of GCC a compatibility >header is provided that maps the traditional pre-defines onto the new >ACLE ones. Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the couple of places in tree. clang already implements ACLE. Add a define that says we implement version 1.1, even though the implementation isn't quite complete. Added: head/sys/arm/include/acle-compat.h (contents, props changed) Modified: head/lib/libc/arm/aeabi/aeabi_vfp.h head/lib/msun/arm/fenv.c head/sys/arm/arm/disassem.c head/sys/arm/include/param.h Modified: head/lib/libc/arm/aeabi/aeabi_vfp.h ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_vfp.h Wed Aug 13 22:34:14 2014 (r269955) +++ head/lib/libc/arm/aeabi/aeabi_vfp.h Thu Aug 14 04:20:13 2014 (r269956) @@ -30,6 +30,8 @@ #ifndef AEABI_VFP_H #define AEABI_VFP_H +#include + /* * ASM helper macros. These allow the functions to be changed depending on * the endian-ness we are building for. @@ -49,7 +51,7 @@ * point falue. They will load the data from an ARM to a VFP register(s), * or from a VFP to an ARM register */ -#ifdef __ARMEB__ +#ifdef __ARM_BIG_ENDIAN #define LOAD_DREG(vreg, reg0, reg1) vmov vreg, reg1, reg0 #define UNLOAD_DREG(reg0, reg1, vreg) vmov reg1, reg0, vreg #else @@ -65,7 +67,7 @@ * C Helper macros */ -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if __ARM_ARCH >= 6 /* * Generate a function that will either call into the VFP implementation, * or the soft float version for a given __aeabi_* helper. The function Modified: head/lib/msun/arm/fenv.c ============================================================================== --- head/lib/msun/arm/fenv.c Wed Aug 13 22:34:14 2014 (r269955) +++ head/lib/msun/arm/fenv.c Thu Aug 14 04:20:13 2014 (r269956) @@ -30,7 +30,9 @@ #define __fenv_static #include "fenv.h" -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#include + +#if __ARM_ARCH >= 6 #define FENV_ARMv6 #endif Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Wed Aug 13 22:34:14 2014 (r269955) +++ head/sys/arm/arm/disassem.c Thu Aug 14 04:20:13 2014 (r269956) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* @@ -130,7 +131,7 @@ static const struct arm32_insn arm32_i[] { 0x0c500000, 0x04100000, "ldr", "daW" }, { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if __ARM_ARCH >= 6 { 0xffffffff, 0xf57ff01f, "clrex", "c" }, { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, Added: head/sys/arm/include/acle-compat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/acle-compat.h Thu Aug 14 04:20:13 2014 (r269956) @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2014 ARM 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. + * 3. The name of the company may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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 __ARM_ARCH + +/* ACLE standardises a set of pre-defines that describe the ARM architecture. + These were mostly implemented in GCC around GCC-4.8; older versions + have no, or only partial support. To provide a level of backwards + compatibility we try to work out what the definitions should be, given + the older pre-defines that GCC did produce. This isn't complete, but + it should be enough for use by routines that depend on this header. */ + +/* No need to handle ARMv8, GCC had ACLE support before that. */ + +#define __ARM_ACLE 101 + +# ifdef __ARM_ARCH_7__ +/* The common subset of ARMv7 in all profiles. */ +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_LDREX 7 +# define __ARM_FEATURE_UNALIGNED +# endif + +# if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__) +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_ARCH_ISA_ARM +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 15 +# define __ARM_FEATURE_UNALIGNED +# ifdef __ARM_ARCH_7A__ +# define __ARM_ARCH_PROFILE 'A' +# else +# define __ARM_ARCH_PROFILE 'R' +# endif +# endif + +# ifdef __ARM_ARCH_7EM__ +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 7 +# define __ARM_FEATURE_UNALIGNED +# define __ARM_ARCH_PROFILE 'M' +# endif + +# ifdef __ARM_ARCH_7M__ +# define __ARM_ARCH 7 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 7 +# define __ARM_FEATURE_UNALIGNED +# define __ARM_ARCH_PROFILE 'M' +# endif + +# ifdef __ARM_ARCH_6T2__ +# define __ARM_ARCH 6 +# define __ARM_ARCH_ISA_THUMB 2 +# define __ARM_ARCH_ISA_ARM +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_LDREX 4 +# define __ARM_FEATURE_UNALIGNED +# endif + +# ifdef __ARM_ARCH_6M__ +# define __ARM_ARCH 6 +# define __ARM_ARCH_ISA_THUMB 1 +# define __ARM_ARCH_PROFILE 'M' +# endif + +# if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) \ + || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) \ + || defined (__ARM_ARCH_6ZK__) +# define __ARM_ARCH 6 +# define __ARM_ARCH_ISA_THUMB 1 +# define __ARM_ARCH_ISA_ARM +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_SIMD32 +# define __ARM_FEATURE_DSP +# define __ARM_FEATURE_QBIT +# define __ARM_FEATURE_SAT +# define __ARM_FEATURE_UNALIGNED +# ifndef __thumb__ +# if defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__) +# define __ARM_FEATURE_LDREX 15 +# else +# define __ARM_FEATURE_LDREX 4 +# endif +# endif +# endif + +# if defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5E__) +# define __ARM_ARCH 5 +# define __ARM_ARCH_ISA_ARM +# ifdef __ARM_ARCH_5TE__ +# define __ARM_ARCH_ISA_THUMB 1 +# endif +# define __ARM_FEATURE_CLZ +# define __ARM_FEATURE_DSP +# endif + +# if defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5__) +# define __ARM_ARCH 5 +# define __ARM_ARCH_ISA_ARM +# ifdef __ARM_ARCH_5TE__ +# define __ARM_ARCH_ISA_THUMB 1 +# endif +# define __ARM_FEATURE_CLZ +# endif + +# ifdef __ARM_ARCH_4T__ +# define __ARM_ARCH 4 +# define __ARM_ARCH_ISA_ARM +# define __ARM_ARCH_ISA_THUMB 1 +# endif + +# ifdef __ARM_ARCH_4__ +# define __ARM_ARCH 4 +# define __ARM_ARCH_ISA_ARM +# endif + +# if defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__) +# define __ARM_ARCH 3 +# define __ARM_ARCH_ISA_ARM +# endif + +# ifdef __ARM_ARCH_2__ +# define __ARM_ARCH 2 +# define __ARM_ARCH_ISA_ARM +# endif + +# ifdef __ARMEB__ +# define __ARM_BIG_ENDIAN +# endif + +/* If we still don't know what the target architecture is, then we're + probably not using GCC. */ +# ifndef __ARM_ARCH +# error Unable to determine architecture version. +# endif + +#endif /* __ARM_ARCH */ Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Wed Aug 13 22:34:14 2014 (r269955) +++ head/sys/arm/include/param.h Thu Aug 14 04:20:13 2014 (r269956) @@ -46,13 +46,14 @@ */ #include +#include #define STACKALIGNBYTES (8 - 1) #define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES) #define __PCI_REROUTE_INTERRUPT -#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if __ARM_ARCH >= 6 #define _V6_SUFFIX "v6" #else #define _V6_SUFFIX "" @@ -64,7 +65,7 @@ #define _HF_SUFFIX "" #endif -#ifdef __ARMEB__ +#ifdef __ARM_BIG_ENDIAN #define _EB_SUFFIX "eb" #else #define _EB_SUFFIX "" From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 04:21:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B082A761; Thu, 14 Aug 2014 04:21:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91E422BD1; Thu, 14 Aug 2014 04:21:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4LFXI046347; Thu, 14 Aug 2014 04:21:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4LFdf046343; Thu, 14 Aug 2014 04:21:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408140421.s7E4LFdf046343@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 04:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269957 - in head/sys: arm/at91 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:21:15 -0000 Author: imp Date: Thu Aug 14 04:21:14 2014 New Revision: 269957 URL: http://svnweb.freebsd.org/changeset/base/269957 Log: Add support for FDT and !FDT configs on Atmel, though FDT isn't working yet. Bump rev on arm Makefile since files.at91 uses new '!' operator. Modified: head/sys/arm/at91/files.at91 head/sys/conf/Makefile.arm Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Thu Aug 14 04:20:13 2014 (r269956) +++ head/sys/arm/at91/files.at91 Thu Aug 14 04:21:14 2014 (r269957) @@ -3,28 +3,34 @@ arm/arm/cpufunc_asm_arm9.S standard arm/at91/at91_machdep.c standard arm/at91/at91_aic.c standard arm/at91/at91.c standard -arm/at91/at91_cfata.c optional at91_cfata -arm/at91/at91_mci.c optional at91_mci -dev/nand/nfc_at91.c optional nand +arm/at91/at91_aic.c standard arm/at91/at91_pio.c standard arm/at91/at91_pmc.c standard +arm/at91/at91_smc.c standard +arm/at91/at91_cfata.c optional at91_cfata +arm/at91/at91_common.c optional fdt +arm/at91/at91_mci.c optional at91_mci +arm/at91/at91_pinctrl.c optional fdt arm/at91/at91_pit.c optional at91sam9 arm/at91/at91_reset.S optional at91sam9 arm/at91/at91_rst.c optional at91sam9 arm/at91/at91_rtc.c optional at91_rtc -arm/at91/at91_smc.c standard +arm/at91/at91_sdramc.c optional fdt +arm/at91/at91_shdwc.c optional fdt arm/at91/at91_spi.c optional at91_spi \ dependency "spibus_if.h" arm/at91/at91_ssc.c optional at91_ssc arm/at91/at91_st.c optional at91rm9200 -arm/at91/at91_tc.c optional at91_tc +arm/at91/at91_tcb.c optional fdt arm/at91/at91_twi.c optional at91_twi arm/at91/at91_wdt.c optional at91_wdt arm/at91/if_ate.c optional ate arm/at91/if_macb.c optional macb -arm/at91/uart_bus_at91usart.c optional uart -arm/at91/uart_cpu_at91usart.c optional uart +arm/at91/uart_bus_at91usart.c optional uart ! fdt +arm/at91/uart_cpu_at91usart.c optional uart ! fdt arm/at91/uart_dev_at91usart.c optional uart +dev/uart/uart_cpu_fdt.c optional uart fdt +dev/nand/nfc_at91.c optional nand # # All the "systems on a chip" we support # @@ -54,5 +60,7 @@ arm/at91/board_tsc4370.c optional at91_b # usb # dev/usb/controller/at91dci.c optional at91_dci -dev/usb/controller/at91dci_atmelarm.c optional at91_dci -dev/usb/controller/ohci_atmelarm.c optional ohci +dev/usb/controller/at91dci_atmelarm.c optional at91_dci !fdt +dev/usb/controller/ohci_atmelarm.c optional ohci !fdt +dev/usb/controller/at91dci_fdt.c optional at91_dci fdt +dev/usb/controller/ohci_fdt.c optional ohci fdt Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Thu Aug 14 04:20:13 2014 (r269956) +++ head/sys/conf/Makefile.arm Thu Aug 14 04:21:14 2014 (r269957) @@ -17,7 +17,7 @@ # # Which version of config(8) is required. -%VERSREQ= 600012 +%VERSREQ= 600013 STD8X16FONT?= iso From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 04:21:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DE888C1; Thu, 14 Aug 2014 04:21:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AE992BD7; Thu, 14 Aug 2014 04:21:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4LLap046415; Thu, 14 Aug 2014 04:21:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4LLU6046413; Thu, 14 Aug 2014 04:21:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408140421.s7E4LLU6046413@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 04:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269958 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:21:21 -0000 Author: imp Date: Thu Aug 14 04:21:20 2014 New Revision: 269958 URL: http://svnweb.freebsd.org/changeset/base/269958 Log: Start to add FDT support. Added: head/sys/arm/at91/at91_common.c (contents, props changed) Modified: head/sys/arm/at91/at91_machdep.c Added: head/sys/arm/at91/at91_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_common.c Thu Aug 14 04:21:20 2014 (r269958) @@ -0,0 +1,90 @@ +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern const struct arm_devmap_entry at91_devmap[]; +extern struct bus_space at91_bs_tag; +bus_space_tag_t fdtbus_bs_tag = &at91_bs_tag; + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_aic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + int offset; + + if (fdt_is_compatible(node, "atmel,at91rm9200-aic")) + offset = 0; + else + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]) + offset; + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_aic_decode_ic, + NULL +}; + +static void +at91_eoi(void *unused) +{ + uint32_t *eoicr = (uint32_t *)(0xdffff000 + IC_EOICR); + + *eoicr = 0; +} + + +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + arm_post_filter = at91_eoi; + at91_soc_id(); + arm_devmap_register_table(at91_devmap); +} + +int +initarm_devmap_init(void) +{ + +// arm_devmap_add_entry(0xfff00000, 0x00100000); /* 1MB - uart, aic and timers*/ + + return (0); +} + +void +initarm_gpio_init(void) +{ +} + +void +initarm_late_init(void) +{ +} Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Aug 14 04:21:14 2014 (r269957) +++ head/sys/arm/at91/at91_machdep.c Thu Aug 14 04:21:20 2014 (r269958) @@ -43,6 +43,8 @@ * Created : 17/09/94 */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -111,8 +113,12 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) +extern struct bus_space at91_bs_tag; + struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; +uint32_t at91_master_clock; + /* Static device mappings. */ const struct arm_devmap_entry at91_devmap[] = { /* @@ -194,15 +200,6 @@ const struct arm_devmap_entry at91_devma { 0, 0, 0, 0, 0, } }; -/* Physical and virtual addresses for some global pages */ - -struct pv_addr systempage; -struct pv_addr msgbufpv; -struct pv_addr irqstack; -struct pv_addr undstack; -struct pv_addr abtstack; -struct pv_addr kernelstack; - #ifdef LINUX_BOOT_ABI extern int membanks; extern int memstart[]; @@ -444,6 +441,16 @@ board_init(void) } #endif +#ifndef FDT +/* Physical and virtual addresses for some global pages */ + +struct pv_addr msgbufpv; +struct pv_addr kernelstack; +struct pv_addr systempage; +struct pv_addr irqstack; +struct pv_addr abtstack; +struct pv_addr undstack; + void * initarm(struct arm_boot_params *abp) { @@ -651,6 +658,7 @@ initarm(struct arm_boot_params *abp) return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } +#endif /* * These functions are handled elsewhere, so make them nops here. From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 04:21:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B96FA02; Thu, 14 Aug 2014 04:21:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1865F2C04; Thu, 14 Aug 2014 04:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4LQXe046495; Thu, 14 Aug 2014 04:21:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4LQ4Y046488; Thu, 14 Aug 2014 04:21:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408140421.s7E4LQ4Y046488@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 04:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269959 - in head/sys/arm: arm at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:21:27 -0000 Author: imp Date: Thu Aug 14 04:21:25 2014 New Revision: 269959 URL: http://svnweb.freebsd.org/changeset/base/269959 Log: Add support for multipass to Atmel, for both FDT and !FDT cases. Modified: head/sys/arm/arm/nexus.c head/sys/arm/at91/at91_aic.c head/sys/arm/at91/at91_pit.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/std.atmel Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Thu Aug 14 04:21:20 2014 (r269958) +++ head/sys/arm/arm/nexus.c Thu Aug 14 04:21:25 2014 (r269959) @@ -362,4 +362,3 @@ nexus_ofw_map_intr(device_t dev, device_ return (interrupt); } #endif - Modified: head/sys/arm/at91/at91_aic.c ============================================================================== --- head/sys/arm/at91/at91_aic.c Thu Aug 14 04:21:20 2014 (r269958) +++ head/sys/arm/at91/at91_aic.c Thu Aug 14 04:21:25 2014 (r269959) @@ -176,13 +176,9 @@ static driver_t at91_aic_driver = { static devclass_t at91_aic_devclass; #ifdef FDT -DRIVER_MODULE(at91_aic, simplebus, at91_aic_driver, at91_aic_devclass, NULL, - NULL); -#else -DRIVER_MODULE(at91_aic, atmelarm, at91_aic_driver, at91_aic_devclass, NULL, - NULL); -#endif -/* not yet EARLY_DRIVER_MODULE(at91_aic, simplebus, at91_aic_driver, at91_aic_devclass, NULL, NULL, BUS_PASS_INTERRUPT); -*/ +#else +EARLY_DRIVER_MODULE(at91_aic, atmelarm, at91_aic_driver, at91_aic_devclass, + NULL, NULL, BUS_PASS_INTERRUPT); +#endif Modified: head/sys/arm/at91/at91_pit.c ============================================================================== --- head/sys/arm/at91/at91_pit.c Thu Aug 14 04:21:20 2014 (r269958) +++ head/sys/arm/at91/at91_pit.c Thu Aug 14 04:21:25 2014 (r269959) @@ -214,9 +214,9 @@ static driver_t at91_pit_driver = { static devclass_t at91_pit_devclass; #ifdef FDT -DRIVER_MODULE(at91_pit, simplebus, at91_pit_driver, at91_pit_devclass, NULL, - NULL); +EARLY_DRIVER_MODULE(at91_pit, simplebus, at91_pit_driver, at91_pit_devclass, + NULL, NULL, BUS_PASS_TIMER); #else -DRIVER_MODULE(at91_pit, atmelarm, at91_pit_driver, at91_pit_devclass, NULL, - NULL); +EARLY_DRIVER_MODULE(at91_pit, atmelarm, at91_pit_driver, at91_pit_devclass, + NULL, NULL, BUS_PASS_TIMER); #endif Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Thu Aug 14 04:21:20 2014 (r269958) +++ head/sys/arm/at91/at91_pmc.c Thu Aug 14 04:21:25 2014 (r269959) @@ -709,9 +709,9 @@ static driver_t at91_pmc_driver = { static devclass_t at91_pmc_devclass; #ifdef FDT -DRIVER_MODULE(at91_pmc, simplebus, at91_pmc_driver, at91_pmc_devclass, NULL, - NULL); +EARLY_DRIVER_MODULE(at91_pmc, simplebus, at91_pmc_driver, at91_pmc_devclass, + NULL, NULL, BUS_PASS_CPU); #else -DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, NULL, - NULL); +EARLY_DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, + NULL, NULL, BUS_PASS_CPU); #endif Modified: head/sys/arm/at91/std.atmel ============================================================================== --- head/sys/arm/at91/std.atmel Thu Aug 14 04:21:20 2014 (r269958) +++ head/sys/arm/at91/std.atmel Thu Aug 14 04:21:25 2014 (r269959) @@ -11,3 +11,5 @@ device at91sam9x5 # bring in the sam specific timers and such device at91sam9 + +options ARM_DEVICE_MULTIPASS From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 04:21:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B3B4B69; Thu, 14 Aug 2014 04:21:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 500432C65; Thu, 14 Aug 2014 04:21:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4LWXl046565; Thu, 14 Aug 2014 04:21:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4LV7N046562; Thu, 14 Aug 2014 04:21:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408140421.s7E4LV7N046562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 04:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269960 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:21:32 -0000 Author: imp Date: Thu Aug 14 04:21:31 2014 New Revision: 269960 URL: http://svnweb.freebsd.org/changeset/base/269960 Log: Add AIC to at91sam9260 support, now that it is needed for multipass to work. This gets my AT91SAM9260-based boards almost booting with current in multi pass. The MCI driver is broken, but it is equally broken before multi-pass. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9260reg.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Thu Aug 14 04:21:25 2014 (r269959) +++ head/sys/arm/at91/at91.c Thu Aug 14 04:21:31 2014 (r269960) @@ -255,7 +255,7 @@ at91_cpu_add_builtin_children(device_t d { int i; - for (i = 1; walker->name; i++, walker++) { + for (i = 0; walker->name; i++, walker++) { at91_add_child(dev, i, walker->name, walker->unit, walker->mem_base, walker->mem_len, walker->irq0, walker->irq1, walker->irq2); Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Thu Aug 14 04:21:25 2014 (r269959) +++ head/sys/arm/at91/at91sam9260.c Thu Aug 14 04:21:31 2014 (r269960) @@ -103,6 +103,7 @@ static const uint32_t at91_pio_base[] = static const struct cpu_devs at91_devs[] = { + DEVICE("at91_aic", AIC, 0), DEVICE("at91_pmc", PMC, 0), DEVICE("at91_wdt", WDT, 0), DEVICE("at91_rst", RSTC, 0), Modified: head/sys/arm/at91/at91sam9260reg.h ============================================================================== --- head/sys/arm/at91/at91sam9260reg.h Thu Aug 14 04:21:25 2014 (r269959) +++ head/sys/arm/at91/at91sam9260reg.h Thu Aug 14 04:21:31 2014 (r269960) @@ -220,6 +220,7 @@ #define AT91SAM9260_IRQ_RSTC AT91SAM9260_IRQ_SYSTEM #define AT91SAM9260_IRQ_OHCI AT91SAM9260_IRQ_UHP #define AT91SAM9260_IRQ_NAND (-1) +#define AT91SAM9260_IRQ_AIC (-1) #define AT91SAM9260_AIC_BASE 0xffff000 #define AT91SAM9260_AIC_SIZE 0x200 From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 04:42:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6568F92; Thu, 14 Aug 2014 04:42:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 933562E44; Thu, 14 Aug 2014 04:42:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E4gAV0056094; Thu, 14 Aug 2014 04:42:10 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E4gAAc056092; Thu, 14 Aug 2014 04:42:10 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201408140442.s7E4gAAc056092@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 14 Aug 2014 04:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269961 - in head: . lib/libopie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 04:42:10 -0000 Author: ache Date: Thu Aug 14 04:42:09 2014 New Revision: 269961 URL: http://svnweb.freebsd.org/changeset/base/269961 Log: Bump version because challenge buffer size changed MFC after: 1 week Modified: head/ObsoleteFiles.inc head/lib/libopie/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Aug 14 04:21:31 2014 (r269960) +++ head/ObsoleteFiles.inc Thu Aug 14 04:42:09 2014 (r269961) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140814: libopie version bump +OLD_LIBS+=usr/lib/libopie.so.7 +OLD_LIBS+=usr/lib32/libopie.so.7 # 20140811: otp-sha renamed to otp-sha1 OLD_FILES+=usr/bin/otp-sha OLD_FILES+=usr/share/man/man1/otp-sha.1.gz Modified: head/lib/libopie/Makefile ============================================================================== --- head/lib/libopie/Makefile Thu Aug 14 04:21:31 2014 (r269960) +++ head/lib/libopie/Makefile Thu Aug 14 04:42:09 2014 (r269961) @@ -4,7 +4,7 @@ # OPIE_DIST?= ${.CURDIR}/../../contrib/opie DIST_DIR= ${OPIE_DIST}/${.CURDIR:T} -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 KEYFILE?= \"/etc/opiekeys\" From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 05:00:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EE1D318; Thu, 14 Aug 2014 05:00:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7243D2014; Thu, 14 Aug 2014 05:00:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E50kEB061767; Thu, 14 Aug 2014 05:00:46 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E50krj061765; Thu, 14 Aug 2014 05:00:46 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201408140500.s7E50krj061765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 14 Aug 2014 05:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269962 - in head/sys/amd64/vmm: . intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 05:00:46 -0000 Author: neel Date: Thu Aug 14 05:00:45 2014 New Revision: 269962 URL: http://svnweb.freebsd.org/changeset/base/269962 Log: Use the max guest memory address when creating its iommu domain. Also, assert that the GPA being mapped in the domain is less than its maxaddr. Reviewed by: grehan Pointed out by: Anish Gupta (akgupt3@gmail.com) Modified: head/sys/amd64/vmm/intel/vtd.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Thu Aug 14 04:42:09 2014 (r269961) +++ head/sys/amd64/vmm/intel/vtd.c Thu Aug 14 05:00:45 2014 (r269962) @@ -448,6 +448,11 @@ vtd_update_mapping(void *arg, vm_paddr_t ptpindex = 0; ptpshift = 0; + KASSERT(gpa + len > gpa, ("%s: invalid gpa range %#lx/%#lx", __func__, + gpa, len)); + KASSERT(gpa + len <= dom->maxaddr, ("%s: gpa range %#lx/%#lx beyond " + "domain maxaddr %#lx", __func__, gpa, len, dom->maxaddr)); + if (gpa & PAGE_MASK) panic("vtd_create_mapping: unaligned gpa 0x%0lx", gpa); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu Aug 14 04:42:09 2014 (r269961) +++ head/sys/amd64/vmm/vmm.c Thu Aug 14 05:00:45 2014 (r269962) @@ -572,6 +572,21 @@ vm_malloc(struct vm *vm, vm_paddr_t gpa, return (0); } +static vm_paddr_t +vm_maxmem(struct vm *vm) +{ + int i; + vm_paddr_t gpa, maxmem; + + maxmem = 0; + for (i = 0; i < vm->num_mem_segs; i++) { + gpa = vm->mem_segs[i].gpa + vm->mem_segs[i].len; + if (gpa > maxmem) + maxmem = gpa; + } + return (maxmem); +} + static void vm_gpa_unwire(struct vm *vm) { @@ -709,7 +724,7 @@ vm_assign_pptdev(struct vm *vm, int bus, if (ppt_assigned_devices(vm) == 0) { KASSERT(vm->iommu == NULL, ("vm_assign_pptdev: iommu must be NULL")); - maxaddr = vmm_mem_maxaddr(); + maxaddr = vm_maxmem(vm); vm->iommu = iommu_create_domain(maxaddr); error = vm_gpa_wire(vm); From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 05:13:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D7D94F0; Thu, 14 Aug 2014 05:13:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A39B2152; Thu, 14 Aug 2014 05:13:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E5DP6K069700; Thu, 14 Aug 2014 05:13:25 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E5DPRb069698; Thu, 14 Aug 2014 05:13:25 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201408140513.s7E5DPRb069698@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 14 Aug 2014 05:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269963 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 05:13:25 -0000 Author: delphij Date: Thu Aug 14 05:13:24 2014 New Revision: 269963 URL: http://svnweb.freebsd.org/changeset/base/269963 Log: Re-instate UMA cached backend for 4K - 64K allocations. New consumers like geli(4) uses malloc(9) to allocate temporary buffers that gets free'ed shortly, causing frequent TLB shootdown as observed in hwpmc supported flame graph. Discussed with: jeff, alfred MFC after: 1 week Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Aug 14 05:00:45 2014 (r269962) +++ head/sys/kern/kern_malloc.c Thu Aug 14 05:13:24 2014 (r269963) @@ -120,7 +120,7 @@ static int kmemcount; #define KMEM_ZBASE 16 #define KMEM_ZMASK (KMEM_ZBASE - 1) -#define KMEM_ZMAX PAGE_SIZE +#define KMEM_ZMAX 65536 #define KMEM_ZSIZE (KMEM_ZMAX >> KMEM_ZSHIFT) static uint8_t kmemsize[KMEM_ZSIZE + 1]; @@ -151,21 +151,10 @@ struct { {1024, "1024", }, {2048, "2048", }, {4096, "4096", }, -#if PAGE_SIZE > 4096 {8192, "8192", }, -#if PAGE_SIZE > 8192 {16384, "16384", }, -#if PAGE_SIZE > 16384 {32768, "32768", }, -#if PAGE_SIZE > 32768 {65536, "65536", }, -#if PAGE_SIZE > 65536 -#error "Unsupported PAGE_SIZE" -#endif /* 65536 */ -#endif /* 32768 */ -#endif /* 16384 */ -#endif /* 8192 */ -#endif /* 4096 */ {0, NULL}, }; From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 05:31:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6273C8B5; Thu, 14 Aug 2014 05:31:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F85F22DB; Thu, 14 Aug 2014 05:31:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E5VeaO077793; Thu, 14 Aug 2014 05:31:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7E5VeWw077792; Thu, 14 Aug 2014 05:31:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201408140531.s7E5VeWw077792@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 14 Aug 2014 05:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269964 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 05:31:40 -0000 Author: delphij Date: Thu Aug 14 05:31:39 2014 New Revision: 269964 URL: http://svnweb.freebsd.org/changeset/base/269964 Log: Add a new loader tunable, vm.kmem_zmax which allows a system administrator to limit the maximum allocation size that malloc(9) would consider using the UMA cache allocator as backend. Suggested by: alfred MFC after: 2 weeks Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Aug 14 05:13:24 2014 (r269963) +++ head/sys/kern/kern_malloc.c Thu Aug 14 05:31:39 2014 (r269964) @@ -172,6 +172,10 @@ u_long vm_kmem_size; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, "Size of kernel memory"); +static u_long kmem_zmax = KMEM_ZMAX; +SYSCTL_ULONG(_vm, OID_AUTO, kmem_zmax, CTLFLAG_RDTUN, &kmem_zmax, 0, + "Maximum allocation size that malloc(9) would use UMA as backend"); + static u_long vm_kmem_size_min; SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RDTUN, &vm_kmem_size_min, 0, "Minimum size of kernel memory"); @@ -485,7 +489,7 @@ malloc(unsigned long size, struct malloc size = redzone_size_ntor(size); #endif - if (size <= KMEM_ZMAX) { + if (size <= kmem_zmax) { mtip = mtp->ks_handle; if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; @@ -776,6 +780,9 @@ mallocinit(void *dummy) uma_startup2(); + if (kmem_zmax < PAGE_SIZE || kmem_zmax > KMEM_ZMAX) + kmem_zmax = KMEM_ZMAX; + mt_zone = uma_zcreate("mt_zone", sizeof(struct malloc_type_internal), #ifdef INVARIANTS mtrash_ctor, mtrash_dtor, mtrash_init, mtrash_fini, @@ -800,7 +807,7 @@ mallocinit(void *dummy) } for (;i <= size; i+= KMEM_ZBASE) kmemsize[i >> KMEM_ZSHIFT] = indx; - + } } SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_SECOND, mallocinit, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 05:35:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63B1BA23; Thu, 14 Aug 2014 05:35:25 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 405DD23ED; Thu, 14 Aug 2014 05:35:24 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s7E5ZIF1082524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Aug 2014 22:35:18 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s7E5ZIbA082523; Wed, 13 Aug 2014 22:35:18 -0700 (PDT) (envelope-from jmg) Date: Wed, 13 Aug 2014 22:35:18 -0700 From: John-Mark Gurney To: Xin LI Subject: Re: svn commit: r269963 - head/sys/kern Message-ID: <20140814053518.GO83475@funkthat.com> References: <201408140513.s7E5DPRb069698@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201408140513.s7E5DPRb069698@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 13 Aug 2014 22:35:18 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 05:35:25 -0000 Xin LI wrote this message on Thu, Aug 14, 2014 at 05:13 +0000: > Author: delphij > Date: Thu Aug 14 05:13:24 2014 > New Revision: 269963 > URL: http://svnweb.freebsd.org/changeset/base/269963 > > Log: > Re-instate UMA cached backend for 4K - 64K allocations. New consumers > like geli(4) uses malloc(9) to allocate temporary buffers that gets > free'ed shortly, causing frequent TLB shootdown as observed in hwpmc > supported flame graph. Can we do even larger, like 128k for phys io sized blocks? geli can do allocations >128k, which could be broken into two parts, one in the <8k sized range and the other in 128k... Thanks for adding this... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 06:24:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC25E869; Thu, 14 Aug 2014 06:24:14 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AD3BF27E6; Thu, 14 Aug 2014 06:24:14 +0000 (UTC) Received: from delphij-macbook.local (unknown [IPv6:2001:470:83bf:0:d55:f338:5c8:c05c]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 9F3CE14D75; Wed, 13 Aug 2014 23:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1407997454; x=1408011854; bh=0xhD4VlvI8wJS8wSVz4D9PrFgoCLP3Mms6xr4y0YP5k=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=MZRx3h04v5I47r5UvhTz7QDETr+TJbQQP+g3zxhpLnC4jXdotuShqKs0a2pgIH5eS rLdf+kq/+RURXzN1oziLzBzbAd4sbTAtKTiiKZLo2t5DsGbX+BUBXcITspqBTryM/a xFwj5LvdF8woraJIaDcYpT7cDcJwOi9x4GqPkEPQ= Message-ID: <53EC560B.5000104@delphij.net> Date: Wed, 13 Aug 2014 23:24:11 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: John-Mark Gurney , Xin LI Subject: Re: svn commit: r269963 - head/sys/kern References: <201408140513.s7E5DPRb069698@svn.freebsd.org> <20140814053518.GO83475@funkthat.com> In-Reply-To: <20140814053518.GO83475@funkthat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 06:24:15 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 8/13/14 10:35 PM, John-Mark Gurney wrote: > Xin LI wrote this message on Thu, Aug 14, 2014 at 05:13 +0000: >> Author: delphij Date: Thu Aug 14 05:13:24 2014 New Revision: >> 269963 URL: http://svnweb.freebsd.org/changeset/base/269963 >> >> Log: Re-instate UMA cached backend for 4K - 64K allocations. New >> consumers like geli(4) uses malloc(9) to allocate temporary >> buffers that gets free'ed shortly, causing frequent TLB shootdown >> as observed in hwpmc supported flame graph. > > Can we do even larger, like 128k for phys io sized blocks? Sure (Actually I'm running with 128k and 256k buckets enabled on my own storage box; with r269964 we can easily add new buckets without actually activating them by default). However, I'm relented to add them right now because the current malloc(9) implementation would use the next bucket size, which is 2x of the previous one, when the requested size is only a little bit larger than the smaller chunk's size. In real world the larger bucket could eat more memory than all smaller but greater than page-sized bucket combined (the actual consumption is still small, though). I think eventually the right way to go is to adopt more sophisticated allocation strategy like the one used in jemalloc(3) and this changeset is more-or-less temporary for now: I committed it mainly because it eliminated a large portion of unwanted TLB shootdowns I have observed with very reasonable overhead (a few megabytes of RAM). > geli can do allocations >128k, which could be broken into two > parts, one in the <8k sized range and the other in 128k... Yes, this is another issue that I'd like to solve. -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJT7FYKAAoJEJW2GBstM+nsfIwP+gI+gPP2msCOIOpYSYK0hP50 xi5Bk4MDOpEZ7J4z4zWwqGXygDdgBUGXTGoAB1+3LwRD4/F+kEVlFFoRuUZTxsBC dstHq9X29omZ8xnLnQ7GTRPWaULHP7gX8RmJvJ8IH2ElYwUwe0whDNIaK4esqKOb Td1Lgse+FcozpMBaP4cIOtTXMBU1xY27n6i9EqXYQL2iuRFrehyD+DHyQ5M6cU5L FdOrX0+SsJ8ybG0KAPRl0VgjZSzBv74AeOz+DOF4EX2YkajcrvTG8JIShyY401Ou WiaE3dMaQvG1InpRH3Yu0twqTsinmu5xvunNJ3/8pE0C+OGSdcvd7Lvt6L4J5Isl f4tcfUbpvV2ja9tIHw//s8YYD6eRdd+AioeOwsOYwEWB9IbG/fE3BZUPKk3Xgtvz /m9SWKzFq8JMYrBOLpGeFSVQvpOHoH3ceiauzL0UqgTbyFX6zQibmpVxhTQLNUYF Fg16hk6HfRmxCQP22OB760pEjIGyQJzDDAjme7XYtkthsqbapU+tJQNb5+MY2T0p nI55dFHxKISBA5dhTNNt22vUN0A7VjKp0kYt9JhtlTJC/SX1BU2O5T1nYa2nsgrK 3xAgmLYBMj9LWl1ncp+/+Yv+FZZ25xgTae2sAGrX2cFHRy6/ifevVpP8BVupw5z0 BPpAtyp11WVwOPB1N4UB =6OMC -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 07:50:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0E3BA9D; Thu, 14 Aug 2014 07:50:41 +0000 (UTC) Received: from mailrelay003.isp.belgacom.be (mailrelay003.isp.belgacom.be [195.238.6.53]) by mx1.freebsd.org (Postfix) with ESMTP id CF3CB2091; Thu, 14 Aug 2014 07:50:40 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiENALtp7FNR8aPl/2dsb2JhbABagw1STQuCecp0h0gBgRAXd4QEAQUjMyMQCw4GBAICBSECAg8qHgaIWQEIsFSDLJIUF4EsjW0zB4J5gVMBBJVDhnWBWJMng147 Received: from 229.163-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.163.229]) by relay.skynet.be with ESMTP; 14 Aug 2014 09:50:33 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id s7E7oW4j001202; Thu, 14 Aug 2014 09:50:32 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 14 Aug 2014 09:50:31 +0200 From: Tijl Coosemans To: Ed Maste Subject: Re: svn commit: r269950 - head/share/vt/keymaps Message-ID: <20140814095031.5da55195@kalimero.tijl.coosemans.org> In-Reply-To: <201408131906.s7DJ6UPN087045@svn.freebsd.org> References: <201408131906.s7DJ6UPN087045@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 07:50:41 -0000 On Wed, 13 Aug 2014 19:06:30 +0000 (UTC) Ed Maste wrote: > Author: emaste > Date: Wed Aug 13 19:06:29 2014 > New Revision: 269950 > URL: http://svnweb.freebsd.org/changeset/base/269950 >=20 > Log: > Copy country-code .iso syscons keymaps for vt(4) > =20 > Existing syscons ISO 8859-1 keymaps (??.iso.kbd) are usable without > change as Unicode keymaps for vt(4). On European layouts the alt+e 164 is iso-8859-15 =E2=82=AC and not iso-8859= -1 =C2=A4 From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 12:16:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 769D7739; Thu, 14 Aug 2014 12:16:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628D32DBB; Thu, 14 Aug 2014 12:16:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7ECG4ct062553; Thu, 14 Aug 2014 12:16:04 GMT (envelope-from roberto@FreeBSD.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7ECG4Ov062550; Thu, 14 Aug 2014 12:16:04 GMT (envelope-from roberto@FreeBSD.org) Message-Id: <201408141216.s7ECG4Ov062550@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: roberto set sender to roberto@FreeBSD.org using -f From: Ollivier Robert Date: Thu, 14 Aug 2014 12:16: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: r269967 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 12:16:04 -0000 Author: roberto Date: Thu Aug 14 12:16:03 2014 New Revision: 269967 URL: http://svnweb.freebsd.org/changeset/base/269967 Log: MFC r269662: 10 has a new flex (2.5.37) and the config.h for unbound has been updated to take this into account. Alas it breaks source upgrade from any version of 9 because flex is not built as a bootstrap-tools (it would be for older versions). That means "libunbound/configlexer.c" is built with the old flex but using config.h for the new one. Build is thus broken going from 9.* to 10. Make flex a bootstrap-tools entry if host is less than 1000033 to take into account the flex update in 10. Tested on both 9.2-RC3 and 9.3 by myself and dim@. Running buildworld in head but as both 10 and 11 has the new flex, it will not matter. Reviewed by: imp Approved by: des, imp MFC after: 1 week Phabric: D554 Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Aug 14 08:42:16 2014 (r269966) +++ stable/10/Makefile.inc1 Thu Aug 14 12:16:03 2014 (r269967) @@ -1218,10 +1218,6 @@ _mklocale= usr.bin/mklocale _sed= usr.bin/sed .endif -.if ${BOOTSTRAPPING} < 900006 -_lex= usr.bin/lex -.endif - .if ${BOOTSTRAPPING} < 1000002 _m4= usr.bin/m4 .endif @@ -1244,6 +1240,10 @@ _nmtree= lib/libnetbsd \ _cat= bin/cat .endif +.if ${BOOTSTRAPPING} < 1000033 +_lex= usr.bin/lex +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 12:31:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94576BE6; Thu, 14 Aug 2014 12:31:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F3062FF6; Thu, 14 Aug 2014 12:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7ECVJpJ069433; Thu, 14 Aug 2014 12:31:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7ECVJu7069353; Thu, 14 Aug 2014 12:31:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201408141231.s7ECVJu7069353@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 14 Aug 2014 12:31: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: r269968 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 12:31:19 -0000 Author: trasz Date: Thu Aug 14 12:31:18 2014 New Revision: 269968 URL: http://svnweb.freebsd.org/changeset/base/269968 Log: MFC r267614: Add "iscsictl -M", which allows one to change session parameters without removing it and adding back. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.8 stable/10/usr.bin/iscsictl/iscsictl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Thu Aug 14 12:16:03 2014 (r269967) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Thu Aug 14 12:31:18 2014 (r269968) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2014 +.Dd June 18, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -47,6 +47,17 @@ .Fl A .Fl n Ar nickname Op Fl c Ar path .Nm +.Fl M +.Fl i Ar session-id +.Op Fl p Ar portal +.Op Fl t Ar target +.Op Fl u Ar user +.Op Fl s Ar secret +.Nm +.Fl M +.Fl i Ar session-id +.Op Fl n Ar nickname Op Fl c Ar path +.Nm .Fl R .Op Fl p Ar portal .Op Fl t Ar target @@ -68,6 +79,8 @@ The following options are available: .Bl -tag -width ".Fl A" .It Fl A Add session. +.It Fl M +Modify session. .It Fl R Remove session. .It Fl L @@ -84,6 +97,10 @@ Target host name or address used for Sen When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, and the temporary discovery session will be removed. +.It Fl i +Session ID, as displayed by +.Nm +.Fl v . .It Fl n The "nickname" of session defined in the configuration file. .It Fl p Modified: stable/10/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.c Thu Aug 14 12:16:03 2014 (r269967) +++ stable/10/usr.bin/iscsictl/iscsictl.c Thu Aug 14 12:31:18 2014 (r269968) @@ -350,6 +350,82 @@ kernel_add(int iscsi_fd, const struct ta } static int +kernel_modify(int iscsi_fd, unsigned int session_id, const struct target *targ) +{ + struct iscsi_session_modify ism; + int error; + + memset(&ism, 0, sizeof(ism)); + ism.ism_session_id = session_id; + conf_from_target(&ism.ism_conf, targ); + error = ioctl(iscsi_fd, ISCSISMODIFY, &ism); + if (error != 0) + warn("ISCSISMODIFY"); + return (error); +} + +static void +kernel_modify_some(int iscsi_fd, unsigned int session_id, const char *target, + const char *target_addr, const char *user, const char *secret) +{ + struct iscsi_session_state *states = NULL; + struct iscsi_session_state *state; + struct iscsi_session_conf *conf; + struct iscsi_session_list isl; + struct iscsi_session_modify ism; + unsigned int i, nentries = 1; + int error; + + for (;;) { + states = realloc(states, + nentries * sizeof(struct iscsi_session_state)); + if (states == NULL) + err(1, "realloc"); + + memset(&isl, 0, sizeof(isl)); + isl.isl_nentries = nentries; + isl.isl_pstates = states; + + error = ioctl(iscsi_fd, ISCSISLIST, &isl); + if (error != 0 && errno == EMSGSIZE) { + nentries *= 4; + continue; + } + break; + } + if (error != 0) + errx(1, "ISCSISLIST"); + + for (i = 0; i < isl.isl_nentries; i++) { + state = &states[i]; + + if (state->iss_id == session_id) + break; + } + if (i == isl.isl_nentries) + errx(1, "session-id %u not found", session_id); + + conf = &state->iss_conf; + + if (target != NULL) + strlcpy(conf->isc_target, target, sizeof(conf->isc_target)); + if (target_addr != NULL) + strlcpy(conf->isc_target_addr, target_addr, + sizeof(conf->isc_target_addr)); + if (user != NULL) + strlcpy(conf->isc_user, user, sizeof(conf->isc_user)); + if (secret != NULL) + strlcpy(conf->isc_secret, secret, sizeof(conf->isc_secret)); + + memset(&ism, 0, sizeof(ism)); + ism.ism_session_id = session_id; + memcpy(&ism.ism_conf, conf, sizeof(ism.ism_conf)); + error = ioctl(iscsi_fd, ISCSISMODIFY, &ism); + if (error != 0) + warn("ISCSISMODIFY"); +} + +static int kernel_remove(int iscsi_fd, const struct target *targ) { struct iscsi_session_remove isr; @@ -404,7 +480,7 @@ kernel_list(int iscsi_fd, const struct t state = &states[i]; conf = &state->iss_conf; - printf("Session ID: %d\n", state->iss_id); + printf("Session ID: %u\n", state->iss_id); printf("Initiator name: %s\n", conf->isc_initiator); printf("Initiator portal: %s\n", conf->isc_initiator_addr); @@ -482,6 +558,10 @@ usage(void) "[-u user -s secret]\n"); fprintf(stderr, " iscsictl -A -a [-c path]\n"); fprintf(stderr, " iscsictl -A -n nickname [-c path]\n"); + fprintf(stderr, " iscsictl -M -i session-id [-p portal] " + "[-t target] [-u user] [-s secret]\n"); + fprintf(stderr, " iscsictl -M -i session-id -n nickname " + "[-c path]\n"); fprintf(stderr, " iscsictl -R [-p portal] [-t target]\n"); fprintf(stderr, " iscsictl -R -a\n"); fprintf(stderr, " iscsictl -R -n nickname [-c path]\n"); @@ -503,20 +583,25 @@ checked_strdup(const char *s) int main(int argc, char **argv) { - int Aflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0; + int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0; const char *conf_path = DEFAULT_CONFIG_PATH; char *nickname = NULL, *discovery_host = NULL, *host = NULL, *target = NULL, *user = NULL, *secret = NULL; + long long session_id = -1; + char *end; int ch, error, iscsi_fd, retval, saved_errno; int failed = 0; struct conf *conf; struct target *targ; - while ((ch = getopt(argc, argv, "ARLac:d:n:p:t:u:s:v")) != -1) { + while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:v")) != -1) { switch (ch) { case 'A': Aflag = 1; break; + case 'M': + Mflag = 1; + break; case 'R': Rflag = 1; break; @@ -532,6 +617,16 @@ main(int argc, char **argv) case 'd': discovery_host = optarg; break; + case 'i': + session_id = strtol(optarg, &end, 10); + if ((size_t)(end - optarg) != strlen(optarg)) + errx(1, "trailing characters after session-id"); + if (session_id < 0) + errx(1, "session-id cannot be negative"); + if (session_id > UINT_MAX) + errx(1, "session-id cannot be greater than %u", + UINT_MAX); + break; case 'n': nickname = optarg; break; @@ -559,10 +654,10 @@ main(int argc, char **argv) if (argc != 0) usage(); - if (Aflag + Rflag + Lflag == 0) + if (Aflag + Mflag + Rflag + Lflag == 0) Lflag = 1; - if (Aflag + Rflag + Lflag > 1) - errx(1, "at most one of -A, -R, or -L may be specified"); + if (Aflag + Mflag + Rflag + Lflag > 1) + errx(1, "at most one of -A, -M, -R, or -L may be specified"); /* * Note that we ignore unneccessary/inapplicable "-c" flag; so that @@ -614,9 +709,33 @@ main(int argc, char **argv) if (secret != NULL && user == NULL) errx(1, "-s must always be used with -u"); + if (session_id != -1) + errx(1, "-i cannot be used with -A"); if (vflag != 0) errx(1, "-v cannot be used with -A"); + } else if (Mflag != 0) { + if (session_id == -1) + errx(1, "-M requires -i"); + + if (discovery_host != NULL) + errx(1, "-M and -d are mutually exclusive"); + if (aflag != 0) + errx(1, "-M and -a are mutually exclusive"); + if (nickname != NULL) { + if (host != NULL) + errx(1, "-n and -p and mutually exclusive"); + if (target != NULL) + errx(1, "-n and -t and mutually exclusive"); + if (user != NULL) + errx(1, "-n and -u and mutually exclusive"); + if (secret != NULL) + errx(1, "-n and -s and mutually exclusive"); + } + + if (vflag != 0) + errx(1, "-v cannot be used with -M"); + } else if (Rflag != 0) { if (user != NULL) errx(1, "-R and -u are mutually exclusive"); @@ -646,6 +765,8 @@ main(int argc, char **argv) } else errx(1, "must specify either -a, -n, -t, or -p"); + if (session_id != -1) + errx(1, "-i cannot be used with -R"); if (vflag != 0) errx(1, "-v cannot be used with -R"); @@ -664,6 +785,9 @@ main(int argc, char **argv) errx(1, "-L and -n and mutually exclusive"); if (discovery_host != NULL) errx(1, "-L and -d and mutually exclusive"); + + if (session_id != -1) + errx(1, "-i cannot be used with -L"); } iscsi_fd = open(ISCSI_PATH, O_RDWR); @@ -687,15 +811,20 @@ main(int argc, char **argv) conf = conf_new_from_file(conf_path); targ = target_find(conf, nickname); if (targ == NULL) - errx(1, "target %s not found in the configuration file", - nickname); + errx(1, "target %s not found in %s", + nickname, conf_path); if (Aflag != 0) failed += kernel_add(iscsi_fd, targ); + else if (Mflag != 0) + failed += kernel_modify(iscsi_fd, session_id, targ); else if (Rflag != 0) failed += kernel_remove(iscsi_fd, targ); else failed += kernel_list(iscsi_fd, targ, vflag); + } else if (Mflag != 0) { + kernel_modify_some(iscsi_fd, session_id, target, host, + user, secret); } else { if (Aflag != 0 && target != NULL) { if (valid_iscsi_name(target) == false) From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 12:33:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCE11D37; Thu, 14 Aug 2014 12:33:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8B02207F; Thu, 14 Aug 2014 12:33:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7ECXOFJ071693; Thu, 14 Aug 2014 12:33:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7ECXO4s071691; Thu, 14 Aug 2014 12:33:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201408141233.s7ECXO4s071691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 14 Aug 2014 12:33: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: r269969 - stable/10/usr.bin/iscsictl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 12:33:25 -0000 Author: trasz Date: Thu Aug 14 12:33:24 2014 New Revision: 269969 URL: http://svnweb.freebsd.org/changeset/base/269969 Log: MFC r267615: Rename a variable; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.c Thu Aug 14 12:31:18 2014 (r269968) +++ stable/10/usr.bin/iscsictl/iscsictl.c Thu Aug 14 12:33:24 2014 (r269969) @@ -585,7 +585,7 @@ main(int argc, char **argv) { int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0; const char *conf_path = DEFAULT_CONFIG_PATH; - char *nickname = NULL, *discovery_host = NULL, *host = NULL, + char *nickname = NULL, *discovery_host = NULL, *portal = NULL, *target = NULL, *user = NULL, *secret = NULL; long long session_id = -1; char *end; @@ -631,7 +631,7 @@ main(int argc, char **argv) nickname = optarg; break; case 'p': - host = optarg; + portal = optarg; break; case 't': target = optarg; @@ -666,7 +666,7 @@ main(int argc, char **argv) */ if (Aflag != 0) { if (aflag != 0) { - if (host != NULL) + if (portal != NULL) errx(1, "-a and -p and mutually exclusive"); if (target != NULL) errx(1, "-a and -t and mutually exclusive"); @@ -679,7 +679,7 @@ main(int argc, char **argv) if (discovery_host != NULL) errx(1, "-a and -d and mutually exclusive"); } else if (nickname != NULL) { - if (host != NULL) + if (portal != NULL) errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); @@ -690,17 +690,17 @@ main(int argc, char **argv) if (discovery_host != NULL) errx(1, "-n and -d and mutually exclusive"); } else if (discovery_host != NULL) { - if (host != NULL) + if (portal != NULL) errx(1, "-d and -p and mutually exclusive"); if (target != NULL) errx(1, "-d and -t and mutually exclusive"); } else { - if (target == NULL && host == NULL) + if (target == NULL && portal == NULL) errx(1, "must specify -a, -n or -t/-p"); - if (target != NULL && host == NULL) + if (target != NULL && portal == NULL) errx(1, "-t must always be used with -p"); - if (host != NULL && target == NULL) + if (portal != NULL && target == NULL) errx(1, "-p must always be used with -t"); } @@ -723,7 +723,7 @@ main(int argc, char **argv) if (aflag != 0) errx(1, "-M and -a are mutually exclusive"); if (nickname != NULL) { - if (host != NULL) + if (portal != NULL) errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); @@ -745,22 +745,22 @@ main(int argc, char **argv) errx(1, "-R and -d are mutually exclusive"); if (aflag != 0) { - if (host != NULL) + if (portal != NULL) errx(1, "-a and -p and mutually exclusive"); if (target != NULL) errx(1, "-a and -t and mutually exclusive"); if (nickname != NULL) errx(1, "-a and -n and mutually exclusive"); } else if (nickname != NULL) { - if (host != NULL) + if (portal != NULL) errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); - } else if (host != NULL) { + } else if (portal != NULL) { if (target != NULL) errx(1, "-p and -t and mutually exclusive"); } else if (target != NULL) { - if (host != NULL) + if (portal != NULL) errx(1, "-t and -p and mutually exclusive"); } else errx(1, "must specify either -a, -n, -t, or -p"); @@ -773,7 +773,7 @@ main(int argc, char **argv) } else { assert(Lflag != 0); - if (host != NULL) + if (portal != NULL) errx(1, "-L and -p and mutually exclusive"); if (target != NULL) errx(1, "-L and -t and mutually exclusive"); @@ -823,7 +823,7 @@ main(int argc, char **argv) else failed += kernel_list(iscsi_fd, targ, vflag); } else if (Mflag != 0) { - kernel_modify_some(iscsi_fd, session_id, target, host, + kernel_modify_some(iscsi_fd, session_id, target, portal, user, secret); } else { if (Aflag != 0 && target != NULL) { @@ -841,7 +841,7 @@ main(int argc, char **argv) targ->t_address = discovery_host; } else { targ->t_session_type = SESSION_TYPE_NORMAL; - targ->t_address = host; + targ->t_address = portal; } targ->t_user = user; targ->t_secret = secret; From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 12:50:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 763E04C2; Thu, 14 Aug 2014 12:50:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60E7C21D9; Thu, 14 Aug 2014 12:50:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7ECoQZW077956; Thu, 14 Aug 2014 12:50:26 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7ECoQ2i077955; Thu, 14 Aug 2014 12:50:26 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408141250.s7ECoQ2i077955@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 14 Aug 2014 12:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269970 - stable/10/usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 12:50:26 -0000 Author: gavin Date: Thu Aug 14 12:50:25 2014 New Revision: 269970 URL: http://svnweb.freebsd.org/changeset/base/269970 Log: Merge r266206 from head (by bjk): Review pass through jail.8 Replace usage of "prison" with "jail", since that term has mostly dropped out of use. Note once at the beginning that the "prison" term is equivalent, but do not use it otherwise. [1] Some grammar issues. Some mdoc formatting fixes. Consistently use \(em for em dashes, with spaces around it. Avoid contractions. Prefer ssh to telnet. PR: 176832 [1] Modified: stable/10/usr.sbin/jail/jail.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Thu Aug 14 12:33:24 2014 (r269969) +++ stable/10/usr.sbin/jail/jail.8 Thu Aug 14 12:50:25 2014 (r269970) @@ -63,7 +63,9 @@ The .Nm utility creates new jails, or modifies or removes existing jails. -A jail is specified via parameters on the command line, or in the +A jail +.Pq or Dq prison +is specified via parameters on the command line, or in the .Xr jail.conf 5 file. .Pp @@ -73,7 +75,7 @@ At least one of the options or .Fl r must be specified. -These options are used alone or in combination describe the operation to +These options are used alone or in combination to describe the operation to perform: .Bl -tag -width indent .It Fl c @@ -82,8 +84,7 @@ The jail .Va jid and .Va name -parameters (if specified) on the command line, -or any jails +parameters (if specified on the command line) must not refer to an existing jail. .It Fl m Modify an existing jail. @@ -97,14 +98,15 @@ Some parameters may not be changed on a Remove the .Ar jail specified by jid or name. -All jailed processes are killed, and all children of this jail are also +All jailed processes are killed, and all jails that are +children of this jail are also removed. .It Fl rc Restart an existing jail. The jail is first removed and then re-created, as if -.Dq Nm Fl c -and .Dq Nm Fl r +and +.Dq Nm Fl c were run in succession. .It Fl cm Create a jail if it does not exist, or modify the jail if it does exist. @@ -134,7 +136,7 @@ Resolve the parameter (or .Va hostname ) and add all IP addresses returned by the resolver -to the list of addresses for this prison. +to the list of addresses for this jail. This is equivalent to the .Va ip_hostname parameter. @@ -146,7 +148,7 @@ option. .It Fl J Ar jid_file Write a .Ar jid_file -file, containing parameters used to start the jail. +file, containing the parameters used to start the jail. .It Fl l Run commands in a clean environment. This is deprecated and is equivalent to the exec.clean parameter. @@ -166,7 +168,7 @@ Only error messages will be printed. A variation of the .Fl r option that removes an existing jail without using the configuration file. -No removal-related parameters for this jail will be used - the jail will +No removal-related parameters for this jail will be used \(em the jail will simply be removed. .It Fl s Ar securelevel Set the @@ -183,7 +185,7 @@ and .Va exec.system_jail_user parameters. .It Fl U Ar username -The user name from jailed environment as whom jailed commands should run. +The user name from the jailed environment as whom jailed commands should run. This is deprecated and is equivalent to the .Va exec.jail_user parameter. @@ -237,13 +239,12 @@ This mode will always create a new jail, .Fl c and .Fl m -options don't apply (and must not exist). +options do not apply (and must not be present). .Ss Jail Parameters Parameters in the .Xr jail.conf 5 -file, or on the command line, are generally in -.Dq name=value -form. +file, or on the command line, are generally of the form +.Dq name=value . Some parameters are boolean, and do not have a value but are set by the name alone with or without a .Dq no @@ -264,9 +265,10 @@ for details). .Pp The .Nm -utility recognizes two classes of parameters. There are the true jail +utility recognizes two classes of parameters. +There are the true jail parameters that are passed to the kernel when the jail is created, -can be seen with +which can be seen with .Xr jls 8 , and can (usually) be changed with .Dq Nm Fl m . @@ -314,26 +316,26 @@ parameter is implied by the file format, and need not be explicitly set when using the configuration file. .It Va path -The directory which is to be the root of the prison. -Any commands run inside the prison, either by +The directory which is to be the root of the jail. +Any commands run inside the jail, either by .Nm or from .Xr jexec 8 , are run from this directory. .It Va ip4.addr -A list of IPv4 addresses assigned to the prison. +A list of IPv4 addresses assigned to the jail. If this is set, the jail is restricted to using only these addresses. Any attempts to use other addresses fail, and attempts to use wildcard addresses silently use the jailed address instead. -For IPv4 the first address given will be kept used as the source address -in case source address selection on unbound sockets cannot find a better +For IPv4 the first address given will be used as the source address +when source address selection on unbound sockets cannot find a better match. -It is only possible to start multiple jails with the same IP address, +It is only possible to start multiple jails with the same IP address if none of the jails has more than this single overlapping IP address assigned to itself. .It Va ip4.saddrsel A boolean option to change the formerly mentioned behaviour and disable -IPv4 source address selection for the prison in favour of the primary +IPv4 source address selection for the jail in favour of the primary IPv4 address of the jail. Source address selection is enabled by default for all jails and the .Va ip4.nosaddrsel @@ -345,8 +347,8 @@ Possible values are to allow unrestricted access to all system addresses, .Dq new to restrict addresses via -.Va ip4.addr -above, and +.Va ip4.addr , +and .Dq disable to stop the jail from using IPv4 entirely. Setting the @@ -354,14 +356,14 @@ Setting the parameter implies a value of .Dq new . .It Va ip6.addr , Va ip6.saddrsel , Va ip6 -A set of IPv6 options for the prison, the counterparts to +A set of IPv6 options for the jail, the counterparts to .Va ip4.addr , .Va ip4.saddrsel and .Va ip4 above. .It vnet -Create the prison with its own virtual network stack, +Create the jail with its own virtual network stack, with its own network interfaces, addresses, routing table, etc. The kernel must have been compiled with the .Sy VIMAGE option @@ -373,7 +375,7 @@ and .Dq new to create a new network stack. .It Va host.hostname -The hostname of the prison. +The hostname of the jail. Other similar parameters are .Va host.domainname , .Va host.hostuuid @@ -392,7 +394,7 @@ Setting any of the above fields implies The value of the jail's .Va kern.securelevel sysctl. -A jail never has a lower securelevel than the default system, but by +A jail never has a lower securelevel than its parent system, but by setting this parameter it may have a higher one. If the system securelevel is changed, any jail securelevels will be at least as secure. @@ -432,12 +434,12 @@ section for more information. The number of descendants of this jail, including its own child jails and any jails created under them. .It Va enforce_statfs -This determines which information processes in a jail are able to get +This determines what information processes in a jail are able to get about mount points. It affects the behaviour of the following syscalls: .Xr statfs 2 , .Xr fstatfs 2 , -.Xr getfsstat 2 +.Xr getfsstat 2 , and .Xr fhstatfs 2 (as well as similar compatibility syscalls). @@ -488,12 +490,12 @@ namespace across the host and jail envir within a jail would be able to communicate with (and potentially interfere with) processes outside of the jail, and in other jails. .It Va allow.raw_sockets -The prison root is allowed to create raw sockets. +The jail root is allowed to create raw sockets. Setting this parameter allows utilities like .Xr ping 8 and .Xr traceroute 8 -to operate inside the prison. +to operate inside the jail. If this is set, the source IP addresses are enforced to comply with the IP address bound to the jail, regardless of whether or not the @@ -523,10 +525,10 @@ privileged users inside the jail will be devfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. -Please consider restricting the devfs ruleset with the +The devfs ruleset should be restricted from the default by using the .Va devfs_ruleset option. .It Va allow.mount.nullfs @@ -534,7 +536,7 @@ privileged users inside the jail will be nullfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. .It Va allow.mount.procfs @@ -542,7 +544,7 @@ privileged users inside the jail will be procfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. .It Va allow.mount.tmpfs @@ -550,7 +552,7 @@ privileged users inside the jail will be tmpfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. .It Va allow.mount.zfs @@ -558,7 +560,7 @@ privileged users inside the jail will be ZFS file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. See @@ -566,7 +568,7 @@ See for information on how to configure the ZFS filesystem to operate from within a jail. .It Va allow.quotas -The prison root may administer quotas on the jail's filesystem(s). +The jail root may administer quotas on the jail's filesystem(s). This includes filesystems that the jail may share with other jails or with non-jailed parts of the system. .It Va allow.socket_af @@ -576,33 +578,33 @@ have not had jail functionality added to .El .El .Pp -There are pseudo-parameters that aren't passed to the kernel, but are +There are pseudo-parameters that are not passed to the kernel, but are used by .Nm -to set up the prison environment, often by running specified commands +to set up the jail environment, often by running specified commands when jails are created or removed. The .Va exec.* command parameters are .Xr sh 1 -command lines that are run in either the system or prison environment. +command lines that are run in either the system or jail environment. They may be given multiple values, which run would the specified commands in sequence. All commands must succeed (return a zero exit status), or the jail will -not be created or removed. +not be created or removed, as appropriate. .Pp The pseudo-parameters are: .Bl -tag -width indent .It Va exec.prestart -Command(s) to run in the system environment before a prison is created. +Command(s) to run in the system environment before a jail is created. .It Va exec.start -Command(s) to run in the prison environment when a jail is created. +Command(s) to run in the jail environment when a jail is created. A typical command to run is .Dq sh /etc/rc . .It Va command A synonym for .Va exec.start -for use when specifying a prison directly on the command line. +for use when specifying a jail directly on the command line. Unlike other parameters whose value is a single string, .Va command uses the remainder of the @@ -616,7 +618,7 @@ commands have completed. .It Va exec.prestop Command(s) to run in the system environment before a jail is removed. .It Va exec.stop -Command(s) to run in the prison environment before a jail is removed, +Command(s) to run in the jail environment before a jail is removed, and after any .Va exec.prestop commands have completed. @@ -641,14 +643,14 @@ is imported from the current environment The environment variables from the login class capability database for the target login are also set. .It Va exec.jail_user -The user to run commands as, when running in the prison environment. +The user to run commands as, when running in the jail environment. The default is to run the commands as the current user. .It Va exec.system_jail_user This boolean option looks for the .Va exec.jail_user in the system .Xr passwd 5 -file, instead of in the prison's file. +file, instead of in the jail's file. .It Va exec.system_user The user to run commands as, when running in the system environment. The default is to run the commands as the current user. @@ -656,35 +658,35 @@ The default is to run the commands as th The maximum amount of time to wait for a command to complete, in seconds. If a command is still running after this timeout has passed, -the jail not be created or removed. +the jail will not be created or removed, as appropriate. .It Va exec.consolelog A file to direct command output (stdout and stderr) to. .It Va exec.fib -The FIB (routing table) to set when running commands inside the prison. +The FIB (routing table) to set when running commands inside the jail. .It Va stop.timeout -The maximum amount of time to wait for a prison's processes to exit +The maximum amount of time to wait for a jail's processes to exit after sending them a .Dv SIGTERM signal (which happens after the .Va exec.stop commands have completed). -After this many seconds have passed, the prison will be removed, which +After this many seconds have passed, the jail will be removed, which will kill any remaining processes. If this is set to zero, no .Dv SIGTERM -is sent and the prison is immediately removed. +is sent and the jail is immediately removed. The default is 10 seconds. .It Va interface -A network interface to add the prison's IP addresses +A network interface to add the jail's IP addresses .Va ( ip4.addr and .Va ip6.addr ) to. An alias for each address will be added to the interface before the -prison is created, and will be removed from the interface after the -prison is removed. +jail is created, and will be removed from the interface after the +jail is removed. .It Va ip4.addr -In addition to the IP addresses that are passed to the kernel, and +In addition to the IP addresses that are passed to the kernel, an interface, netmask and additional paramters (as supported by .Xr ifconfig 8 Ns ) may also be specified, in the form @@ -692,8 +694,9 @@ may also be specified, in the form If an interface is given before the IP address, an alias for the address will be added to that interface, as it is with the .Va interface -parameter. If a netmask in either dotted-quad or CIDR form is given -after IP address, it will be used when adding the IP alias. +parameter. +If a netmask in either dotted-quad or CIDR form is given +after an IP address, it will be used when adding the IP alias. If additional parameters are specified then they will also be used when adding the IP alias. .It Va ip6.addr @@ -704,20 +707,20 @@ may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix param ... . .It Va vnet.interface A network interface to give to a vnet-enabled jail after is it created. -The interface will automatically be returned when the jail is removed. +The interface will automatically be released when the jail is removed. .It Va ip_hostname Resolve the .Va host.hostname parameter and add all IP addresses returned by the resolver to the list of addresses -.Va ( ip4.addr +.Po Va ip4.addr or -.Va ip6.addr ) -for this prison. +.Va ip6.addr Pc +for this jail. This may affect default address selection for outgoing IPv4 connections -of prisons. +from jails. The address first returned by the resolver for each address family -will be used as primary address. +will be used as the primary address. .It Va mount A filesystem to mount before creating the jail (and to unmount after removing it), given as a single @@ -735,7 +738,7 @@ filesystem on the chrooted directory, and apply the ruleset in the .Va devfs_ruleset parameter (or a default of ruleset 4: devfsrules_jail) -to restrict the devices visible inside the prison. +to restrict the devices visible inside the jail. .It Va mount.fdescfs Mount a .Xr fdescfs 5 @@ -768,11 +771,11 @@ is required, so as to provide the necessary command line tools, daemons, libraries, application configuration files, etc. However, for a virtual server configuration, a fair amount of -additional work is required so as to configure the +additional work is required so as to replace the .Dq boot process. This manual page documents the configuration steps necessary to support -either of these steps, although the configuration steps may be +either of these steps, although the configuration steps may need to be refined based on local requirements. .Ss "Setting up a Jail Directory Tree" To set up a jail directory tree containing an entire @@ -792,7 +795,7 @@ In many cases this example would put far In the other extreme case a jail might contain only one file: the executable to be run in the jail. .Pp -We recommend experimentation and caution that it is a lot easier to +We recommend experimentation, and caution that it is a lot easier to start with a .Dq fat jail and remove things until it stops working, @@ -811,13 +814,13 @@ for a jail named Substitute below as needed with your own directory, IP address, and hostname. .Ss "Setting up the Host Environment" -First, you will want to set up your real system's environment to be +First, set up the real system's environment to be .Dq jail-friendly . For consistency, we will refer to the parent box as the .Dq "host environment" , and to the jailed virtual machine as the .Dq "jail environment" . -Since jail is implemented using IP aliases, one of the first things to do +Since jails are implemented using IP aliases, one of the first things to do is to disable IP services on the host system that listen on all local IP addresses for a service. If a network service is present in the host environment that binds all @@ -840,13 +843,12 @@ rpcbind_enable="NO" is the native IP address for the host system, in this example. Daemons that run out of .Xr inetd 8 -can be easily set to use only the specified host IP address. +can be easily configured to use only the specified host IP address. Other daemons -will need to be manually configured\(emfor some this is possible through -the +will need to be manually configured \(em for some this is possible through .Xr rc.conf 5 flags entries; for others it is necessary to modify per-application -configuration files, or to recompile the applications. +configuration files, or to recompile the application. The following frequently deployed services must have their individual configuration files modified to limit the application to listening to a specific IP address: @@ -884,7 +886,7 @@ easily reconfigured to use only specific hosted directly from the kernel. Any third-party network software running in the host environment should also be checked and configured so that it -does not bind all IP addresses, which would result in those services' also +does not bind all IP addresses, which would result in those services also appearing to be offered by the jail environments. .Pp Once @@ -897,7 +899,7 @@ etc.). Start any jail for the first time without configuring the network interface so that you can clean it up a little and set up accounts. As -with any machine (virtual or not) you will need to set a root password, time +with any machine (virtual or not), you will need to set a root password, time zone, etc. Some of these steps apply only if you intend to run a full virtual server inside the jail; others apply both for constraining a particular application @@ -921,7 +923,7 @@ etc. .It Configure .Pa /etc/resolv.conf -so that name resolution within the jail will work correctly +so that name resolution within the jail will work correctly. .It Run .Xr newaliases 1 @@ -929,13 +931,13 @@ to quell .Xr sendmail 8 warnings. .It -Set a root password, probably different from the real host system +Set a root password, probably different from the real host system. .It -Set the timezone +Set the timezone. .It -Add accounts for users in the jail environment +Add accounts for users in the jail environment. .It -Install any packages the environment requires +Install any packages the environment requires. .El .Pp You may also want to perform any package-specific configuration (web servers, @@ -995,11 +997,12 @@ and other processes running within the j with the .Ql J flag appearing beside jailed processes. -To see an active list of jails, use the -.Xr jls 8 -utility. -You should also be able to -.Xr telnet 1 +To see an active list of jails, use +.Xr jls 8 . +If +.Xr sshd 8 +is enabled in the jail environment, you should be able to +.Xr ssh 1 to the hostname or IP address of the jailed environment, and log in using the accounts you created previously. .Pp @@ -1027,7 +1030,7 @@ This will send the .Dv SIGTERM or .Dv SIGKILL -signals to all processes in the jail - be careful not to run this from +signals to all processes in the jail \(em be careful not to run this from the host environment! Once all of the jail's processes have died, unless the jail was created with the @@ -1082,18 +1085,18 @@ or any file system inside a jail unless the file system is marked jail-friendly, the jail's .Va allow.mount -parameter is set and the jail's +parameter is set, and the jail's .Va enforce_statfs parameter is lower than 2. .Pp Multiple jails sharing the same file system can influence each other. -For example a user in one jail can fill the file system also +For example, a user in one jail can fill the file system, leaving no space for processes in the other jail. Trying to use .Xr quota 1 -to prevent this will not work either as the file system quotas +to prevent this will not work either, as the file system quotas are not aware of jails but only look at the user and group IDs. -This means the same user ID in two jails share the same file +This means the same user ID in two jails share a single file system quota. One would need to use one file system per jail to make this work. .Ss "Sysctl MIB Entries" @@ -1104,11 +1107,11 @@ is one) or not (value is zero). .Pp The variable .Va security.jail.max_af_ips -determines how may address per address family a prison may have. +determines how may address per address family a jail may have. The default is 255. .Pp Some MIB variables have per-jail settings. -Changes to these variables by a jailed process do not effect the host +Changes to these variables by a jailed process do not affect the host environment, only the jail environment. These variables are .Va kern.securelevel , @@ -1133,7 +1136,7 @@ of 0 indicates the jail is a child of th jail if the current process isn't jailed). .Pp Jailed processes are not allowed to confer greater permissions than they -themselves are given, e.g. if a jail is created with +themselves are given, e.g., if a jail is created with .Va allow.nomount , it is not able to create a jail with .Va allow.mount From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 13:25:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7994F221; Thu, 14 Aug 2014 13:25:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 665D62693; Thu, 14 Aug 2014 13:25:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EDP6Si095055; Thu, 14 Aug 2014 13:25:06 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EDP6UE095054; Thu, 14 Aug 2014 13:25:06 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201408141325.s7EDP6UE095054@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Aug 2014 13:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269972 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 13:25:06 -0000 Author: smh Date: Thu Aug 14 13:25:05 2014 New Revision: 269972 URL: http://svnweb.freebsd.org/changeset/base/269972 Log: Renamed hw.ixgbe.unsupported_sfp -> hw.ix.unsupported_sfp This now matches all other ixgbe sysctl / tunables. Sponsored by: Multiplay Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Aug 14 13:24:59 2014 (r269971) +++ head/sys/dev/ixgbe/ixgbe.c Thu Aug 14 13:25:05 2014 (r269972) @@ -317,7 +317,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLA ** doing so you are on your own :) */ static int allow_unsupported_sfp = FALSE; -TUNABLE_INT("hw.ixgbe.unsupported_sfp", &allow_unsupported_sfp); +TUNABLE_INT("hw.ix.unsupported_sfp", &allow_unsupported_sfp); /* ** HW RSC control: From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 13:45:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1F576BF; Thu, 14 Aug 2014 13:45:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE11A286B; Thu, 14 Aug 2014 13:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EDj4SW004362; Thu, 14 Aug 2014 13:45:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EDj391004351; Thu, 14 Aug 2014 13:45:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201408141345.s7EDj391004351@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 14 Aug 2014 13:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269973 - head/share/vt/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 13:45:05 -0000 Author: emaste Date: Thu Aug 14 13:45:02 2014 New Revision: 269973 URL: http://svnweb.freebsd.org/changeset/base/269973 Log: Fix euro symbol in copied keymaps These were copied from share/syscons/keymaps/??.iso.kbd. They were not actually ISO 8859-1 as assumed. When interpreted as Unicode they ended up with the generic currency sign (U+00A4) instead of the euro (U+20AC). Reported by: Claude Buisson, tijl@ Modified: head/share/vt/keymaps/be.kbd head/share/vt/keymaps/fr.kbd head/share/vt/keymaps/hr.kbd head/share/vt/keymaps/it.kbd head/share/vt/keymaps/pt.kbd head/share/vt/keymaps/uk.kbd Modified: head/share/vt/keymaps/be.kbd ============================================================================== --- head/share/vt/keymaps/be.kbd Thu Aug 14 13:25:05 2014 (r269972) +++ head/share/vt/keymaps/be.kbd Thu Aug 14 13:45:02 2014 (r269973) @@ -21,7 +21,7 @@ 015 ht btab nop nop ht btab nop nop O 016 'a' 'A' soh soh 'a' 'A' soh soh C 017 'z' 'Z' sub sub 'z' 'Z' sub sub C - 018 'e' 'E' enq enq 164 'E' enq enq C + 018 'e' 'E' enq enq 8364 'E' enq enq C 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C 021 'y' 'Y' em em 'y' 'Y' em em C Modified: head/share/vt/keymaps/fr.kbd ============================================================================== --- head/share/vt/keymaps/fr.kbd Thu Aug 14 13:25:05 2014 (r269972) +++ head/share/vt/keymaps/fr.kbd Thu Aug 14 13:45:02 2014 (r269973) @@ -21,7 +21,7 @@ 015 ht btab nop nop ht btab nop nop O 016 'a' 'A' soh soh 226 228 dc1 dc1 C 017 'z' 'Z' sub sub 'z' 'Z' etb etb C - 018 'e' 'E' enq enq 164 'E' enq enq C + 018 'e' 'E' enq enq 8364 'E' enq enq C 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C 021 'y' 'Y' em em 237 236 em em C Modified: head/share/vt/keymaps/hr.kbd ============================================================================== --- head/share/vt/keymaps/hr.kbd Thu Aug 14 13:25:05 2014 (r269972) +++ head/share/vt/keymaps/hr.kbd Thu Aug 14 13:45:02 2014 (r269973) @@ -48,7 +48,7 @@ 040 230 198 nop nop 223 223 nop nop C 041 184 168 nop nop 184 168 nop nop O 042 lshift lshift lshift lshift lshift lshift lshift lshift O - 043 190 174 fs fs 164 164 fs fs C + 043 190 174 fs fs 8364 8364 fs fs C 044 'y' 'Y' em em 'y' 'Y' em em C 045 'x' 'X' can can 'x' 'X' can can C 046 'c' 'C' etx etx 'c' 'C' etx etx C Modified: head/share/vt/keymaps/it.kbd ============================================================================== --- head/share/vt/keymaps/it.kbd Thu Aug 14 13:25:05 2014 (r269972) +++ head/share/vt/keymaps/it.kbd Thu Aug 14 13:45:02 2014 (r269973) @@ -55,7 +55,7 @@ 015 ht btab nop nop ht btab nop nop O 016 'q' 'Q' dc1 dc1 '@' 'Q' dc1 dc1 C 017 'w' 'W' etb etb nop nop etb etb C - 018 'e' 'E' enq enq 164 'E' enq enq C + 018 'e' 'E' enq enq 8364 'E' enq enq C 019 'r' 'R' dc2 dc2 167 174 dc2 dc2 C 020 't' 'T' dc4 dc4 nop nop dc4 dc4 C 021 'y' 'Y' em em nop 165 em em C Modified: head/share/vt/keymaps/pt.kbd ============================================================================== --- head/share/vt/keymaps/pt.kbd Thu Aug 14 13:25:05 2014 (r269972) +++ head/share/vt/keymaps/pt.kbd Thu Aug 14 13:45:02 2014 (r269973) @@ -23,7 +23,7 @@ 015 ht btab nop nop ht btab nop nop O 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C 017 'w' 'W' etb etb 'w' 'W' etb etb C - 018 'e' 'E' enq enq 164 'E' enq enq C + 018 'e' 'E' enq enq 8364 'E' enq enq C 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C 021 'y' 'Y' em em 'y' 'Y' em em C Modified: head/share/vt/keymaps/uk.kbd ============================================================================== --- head/share/vt/keymaps/uk.kbd Thu Aug 14 13:25:05 2014 (r269972) +++ head/share/vt/keymaps/uk.kbd Thu Aug 14 13:45:02 2014 (r269973) @@ -8,7 +8,7 @@ 002 '1' '!' nop nop '`' '`' nop nop O 003 '2' '"' nul nul '@' '@' nul nul O 004 '3' 163 nop nop '#' '#' nop nop O - 005 '4' '$' 164 164 '4' '$' nop nop O + 005 '4' '$' 8364 8364 '4' '$' nop nop O 006 '5' '%' nop nop '5' '%' nop nop O 007 '6' '^' rs rs '^' '^' rs rs O 008 '7' '&' nop nop '[' '[' esc esc O @@ -21,7 +21,7 @@ 015 ht btab nop nop ht btab nop nop O 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C 017 'w' 'W' etb etb 'w' 'W' etb etb C - 018 'e' 'E' enq enq 164 'E' enq enq C + 018 'e' 'E' enq enq 8364 'E' enq enq C 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C 021 'y' 'Y' em em 'y' 'Y' em em C From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 13:57:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAF88A48; Thu, 14 Aug 2014 13:57:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF1E02992; Thu, 14 Aug 2014 13:57:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EDvI6T009203; Thu, 14 Aug 2014 13:57:18 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EDvIj5009201; Thu, 14 Aug 2014 13:57:18 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201408141357.s7EDvIj5009201@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Aug 2014 13:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269974 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 13:57:19 -0000 Author: smh Date: Thu Aug 14 13:57:17 2014 New Revision: 269974 URL: http://svnweb.freebsd.org/changeset/base/269974 Log: Added 4K quirks for Corsair Force GT and Samsung 840 SSDs MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Aug 14 13:45:02 2014 (r269973) +++ head/sys/cam/ata/ata_da.c Thu Aug 14 13:57:17 2014 (r269974) @@ -299,10 +299,10 @@ static struct ada_quirk_entry ada_quirk_ }, { /* - * Corsair Force GT SSDs + * Corsair Force GT & GS SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force GT*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Corsair Force G*", "*" }, /*quirks*/ADA_Q_4K }, { @@ -443,6 +443,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Samsung 840 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 840*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Aug 14 13:45:02 2014 (r269973) +++ head/sys/cam/scsi/scsi_da.c Thu Aug 14 13:57:17 2014 (r269974) @@ -967,10 +967,10 @@ static struct da_quirk_entry da_quirk_ta }, { /* - * Corsair Force GT SSDs + * Corsair Force GT & GS SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ - { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force GT*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Corsair Force G*", "*" }, /*quirks*/DA_Q_4K }, { @@ -1111,6 +1111,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Samsung 840 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 840*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 14:07:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5147D3E; Thu, 14 Aug 2014 14:07:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5AD52A83; Thu, 14 Aug 2014 14:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EE75UG013866; Thu, 14 Aug 2014 14:07:05 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EE75lC013864; Thu, 14 Aug 2014 14:07:05 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201408141407.s7EE75lC013864@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Aug 2014 14:07: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: r269975 - in stable/10: . sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 14:07:05 -0000 Author: smh Date: Thu Aug 14 14:07:05 2014 New Revision: 269975 URL: http://svnweb.freebsd.org/changeset/base/269975 Log: Make the ixgbe tunables now match their sysctl counterparts. Previously the tunables and sysctls had different names for example: hw.ixgbe.enable_aim => hw.ix.enable_aim Anyone using ixgbe tunables should ensure they update /boot/loader.conf. This is a direct commit to stable as the changes to sysctls in head already fix this issue in a different way. Sponsored by: Multiplay Modified: stable/10/UPDATING stable/10/sys/dev/ixgbe/ixgbe.c Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Aug 14 13:57:17 2014 (r269974) +++ stable/10/UPDATING Thu Aug 14 14:07:05 2014 (r269975) @@ -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. +20140814: + The ixgbe tunables now match their sysctl counterparts, for example: + hw.ixgbe.enable_aim => hw.ix.enable_aim + Anyone using ixgbe tunables should ensure they update /boot/loader.conf. + 20140801: The NFSv4.1 server committed by r269398 changes the internal function call interfaces used between the NFS and krpc modules. Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Thu Aug 14 13:57:17 2014 (r269974) +++ stable/10/sys/dev/ixgbe/ixgbe.c Thu Aug 14 14:07:05 2014 (r269975) @@ -244,18 +244,18 @@ static SYSCTL_NODE(_hw, OID_AUTO, ix, CT ** traffic for that interrupt vector */ static int ixgbe_enable_aim = TRUE; -TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); +TUNABLE_INT("hw.ix.enable_aim", &ixgbe_enable_aim); SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RW, &ixgbe_enable_aim, 0, "Enable adaptive interrupt moderation"); static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); -TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); +TUNABLE_INT("hw.ix.max_interrupt_rate", &ixgbe_max_interrupt_rate); SYSCTL_INT(_hw_ix, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, &ixgbe_max_interrupt_rate, 0, "Maximum interrupts per second"); /* How many packets rxeof tries to clean at a time */ static int ixgbe_rx_process_limit = 256; -TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); +TUNABLE_INT("hw.ix.rx_process_limit", &ixgbe_rx_process_limit); SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, &ixgbe_rx_process_limit, 0, "Maximum number of received packets to process at a time," @@ -263,7 +263,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_ /* How many packets txeof tries to clean at a time */ static int ixgbe_tx_process_limit = 256; -TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); +TUNABLE_INT("hw.ix.tx_process_limit", &ixgbe_tx_process_limit); SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, &ixgbe_tx_process_limit, 0, "Maximum number of sent packets to process at a time," @@ -283,7 +283,7 @@ static int ixgbe_smart_speed = ixgbe_sma * but this allows it to be forced off for testing. */ static int ixgbe_enable_msix = 1; -TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); +TUNABLE_INT("hw.ix.enable_msix", &ixgbe_enable_msix); SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, "Enable MSI-X interrupts"); @@ -294,7 +294,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix * can be overriden manually here. */ static int ixgbe_num_queues = 0; -TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues); +TUNABLE_INT("hw.ix.num_queues", &ixgbe_num_queues); SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, "Number of queues to configure, 0 indicates autoconfigure"); @@ -304,13 +304,13 @@ SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, ** the better performing choice. */ static int ixgbe_txd = PERFORM_TXD; -TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); +TUNABLE_INT("hw.ix.txd", &ixgbe_txd); SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, "Number of transmit descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; -TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); +TUNABLE_INT("hw.ix.rxd", &ixgbe_rxd); SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0, "Number of receive descriptors per queue"); @@ -320,7 +320,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLA ** doing so you are on your own :) */ static int allow_unsupported_sfp = FALSE; -TUNABLE_INT("hw.ixgbe.unsupported_sfp", &allow_unsupported_sfp); +TUNABLE_INT("hw.ix.unsupported_sfp", &allow_unsupported_sfp); /* ** HW RSC control: From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 14:17:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FDFE19F; Thu, 14 Aug 2014 14:17:47 +0000 (UTC) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id B1DD22B9B; Thu, 14 Aug 2014 14:17:46 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnYGADPE7FNR8aPl/2dsb2JhbABagw1TTQqCesp3h0kBgRUXd4QEAQUjMyMQCw4KAgIFIQICDyoeBohZAQiwHJU6F4EsjW0zB4J5gVMBBJVDhnWBWJMng147LwGCTgEBAQ Received: from 229.163-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.163.229]) by relay.skynet.be with ESMTP; 14 Aug 2014 16:17:39 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id s7EEHciC004844; Thu, 14 Aug 2014 16:17:38 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 14 Aug 2014 16:17:37 +0200 From: Tijl Coosemans To: Ed Maste Subject: Re: svn commit: r269973 - head/share/vt/keymaps Message-ID: <20140814161737.26eed58f@kalimero.tijl.coosemans.org> In-Reply-To: <201408141345.s7EDj391004351@svn.freebsd.org> References: <201408141345.s7EDj391004351@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 14:17:47 -0000 On Thu, 14 Aug 2014 13:45:03 +0000 (UTC) Ed Maste wrote: > Modified: head/share/vt/keymaps/hr.kbd > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/vt/keymaps/hr.kbd Thu Aug 14 13:25:05 2014 (r269972) > +++ head/share/vt/keymaps/hr.kbd Thu Aug 14 13:45:02 2014 (r269973) > @@ -48,7 +48,7 @@ > 040 230 198 nop nop 223 223 nop nop C > 041 184 168 nop nop 184 168 nop nop O > 042 lshift lshift lshift lshift lshift lshift lshift lshift O > - 043 190 174 fs fs 164 164 fs fs C > + 043 190 174 fs fs 8364 8364 fs fs C This was correct I think. See: http://commons.wikimedia.org/wiki/File:Croatian_keyboard_layout.jpg But both hr.kbd and si.kbd are iso-8859-2 or iso-8859-16 so they need other conversions (e.g. 163 is =C5=81). From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 14:22:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 877DE34D; Thu, 14 Aug 2014 14:22:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A1C52CC2; Thu, 14 Aug 2014 14:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EEMDfs022325; Thu, 14 Aug 2014 14:22:13 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EEMDhc022323; Thu, 14 Aug 2014 14:22:13 GMT (envelope-from se@FreeBSD.org) Message-Id: <201408141422.s7EEMDhc022323@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 14 Aug 2014 14:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269976 - head/usr.sbin/kbdmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 14:22:13 -0000 Author: se Date: Thu Aug 14 14:22:12 2014 New Revision: 269976 URL: http://svnweb.freebsd.org/changeset/base/269976 Log: Add support for NEWCONS to kbdmap and vidfont. The path to keymaps and fonts is selected based on the existence and value of "sysctl kern.vty". MFC after: 1 week Modified: head/usr.sbin/kbdmap/kbdmap.c head/usr.sbin/kbdmap/kbdmap.h Modified: head/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- head/usr.sbin/kbdmap/kbdmap.c Thu Aug 14 14:07:05 2014 (r269975) +++ head/usr.sbin/kbdmap/kbdmap.c Thu Aug 14 14:22:12 2014 (r269976) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -47,10 +48,10 @@ static const char *lang_default = DEFAUL static const char *font; static const char *lang; static const char *program; -static const char *keymapdir = DEFAULT_KEYMAP_DIR; -static const char *fontdir = DEFAULT_FONT_DIR; +static const char *keymapdir = DEFAULT_VT_KEYMAP_DIR; +static const char *fontdir = DEFAULT_VT_FONT_DIR; +static const char *font_default = DEFAULT_VT_FONT; static const char *sysconfig = DEFAULT_SYSCONFIG; -static const char *font_default = DEFAULT_FONT; static const char *font_current; static const char *dir; static const char *menu = ""; @@ -146,6 +147,22 @@ add_keymap(const char *desc, int mark, c } /* + * Return 0 if syscons is in use (to select legacy defaults). + */ +static int +check_newcons(void) +{ + size_t len; + char term[3]; + + len = 3; + if (sysctlbyname("kern.vty", &term, &len, NULL, 0) != 0 || + strcmp(term, "vt") != 0) + return 0; + return -1; +} + +/* * Figure out the default language to use. */ static const char * @@ -815,6 +832,12 @@ main(int argc, char **argv) sleep(2); } + if (check_newcons() == 0) { + keymapdir = DEFAULT_SC_KEYMAP_DIR; + fontdir = DEFAULT_SC_FONT_DIR; + font_default = DEFAULT_SC_FONT; + } + SLIST_INIT(&head); lang = get_locale(); Modified: head/usr.sbin/kbdmap/kbdmap.h ============================================================================== --- head/usr.sbin/kbdmap/kbdmap.h Thu Aug 14 14:07:05 2014 (r269975) +++ head/usr.sbin/kbdmap/kbdmap.h Thu Aug 14 14:22:12 2014 (r269976) @@ -28,7 +28,12 @@ #define DEFAULT_LANG "en" -#define DEFAULT_KEYMAP_DIR "/usr/share/syscons/keymaps" -#define DEFAULT_FONT_DIR "/usr/share/syscons/fonts" #define DEFAULT_SYSCONFIG "/etc/rc.conf" -#define DEFAULT_FONT "cp437-8x16.fnt" + +#define DEFAULT_SC_KEYMAP_DIR "/usr/share/syscons/keymaps" +#define DEFAULT_SC_FONT_DIR "/usr/share/syscons/fonts" +#define DEFAULT_SC_FONT "cp437-8x16.fnt" + +#define DEFAULT_VT_KEYMAP_DIR "/usr/share/vt/keymaps" +#define DEFAULT_VT_FONT_DIR "/usr/share/vt/fonts" +#define DEFAULT_VT_FONT "vgarom-thin-8x16.fnt" From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 14:26:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FC57578; Thu, 14 Aug 2014 14:26:25 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA3F92D01; Thu, 14 Aug 2014 14:26:24 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id l13so13714527iga.10 for ; Thu, 14 Aug 2014 07:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=VostWDEySvKRk5/Sl1K0BAhmZwzpl+GM4h46EXX5il0=; b=vZTfHZ1GsakGBZsFZhgmqdC6PzJjZDvwnt/fIahd1Uwc35uQQUo7H0RmyUt5sDbS+i 9TsdVcnjv3vY7oXjJiUIIXT9F4cpx8c+aUvs2iCywKOcKSpO1jCzYVS3FQ/a1BTwyZRV jNlkWxozZ9oA6WQbq7DLMeu8N7reR7QB4Ya67gPpGx171bHC5E8UQ5mgnzjEp56IVpdA MMCiuv3naOryiHxnqGBu1gGxTicAFwyeVcky2qtcMzn55mLIxqMOLmCl1mmbJRuBNkby Khr8Rs9izLoJA3HjnszmqMAnRccKZBC3iCDNBXceP0FiT3MtNgYEBk+XPUG0HtQgFov8 IrPA== X-Received: by 10.50.28.75 with SMTP id z11mr59240614igg.11.1408026384060; Thu, 14 Aug 2014 07:26:24 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.131.38 with HTTP; Thu, 14 Aug 2014 07:26:04 -0700 (PDT) In-Reply-To: <20140814161737.26eed58f@kalimero.tijl.coosemans.org> References: <201408141345.s7EDj391004351@svn.freebsd.org> <20140814161737.26eed58f@kalimero.tijl.coosemans.org> From: Ed Maste Date: Thu, 14 Aug 2014 10:26:04 -0400 X-Google-Sender-Auth: K_2xO1ckhONCdX2M7McVkRnGgrk Message-ID: Subject: Re: svn commit: r269973 - head/share/vt/keymaps To: Tijl Coosemans , Stefan Esser Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 14:26:25 -0000 On 14 August 2014 10:17, Tijl Coosemans wrote: > This was correct I think. See: > http://commons.wikimedia.org/wiki/File:Croatian_keyboard_layout.jpg > > But both hr.kbd and si.kbd are iso-8859-2 or iso-8859-16 so they need > other conversions (e.g. 163 is =C5=81). Yeah, it seems I was tripped up by the inconsistent use of '.iso' in the keymap names. In any case, rather than incrementally fixing these I'll just hold off and let Stefan include the fixes in the broader set of keymap fixes, which I believe will arrive in the next day or two. From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 14:59:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C19DE1AD; Thu, 14 Aug 2014 14:59:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE202212C; Thu, 14 Aug 2014 14:59:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EExenD037373; Thu, 14 Aug 2014 14:59:40 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EExeht037372; Thu, 14 Aug 2014 14:59:40 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201408141459.s7EExeht037372@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Aug 2014 14:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269977 - head/bin/pkill/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 14:59:40 -0000 Author: asomers Date: Thu Aug 14 14:59:40 2014 New Revision: 269977 URL: http://svnweb.freebsd.org/changeset/base/269977 Log: Skip pgrep-j and pkill-j if jail or jls is not installed. Even though jail is part of the base system, it can be disabled by src.conf settings. Therefore, it should be listed as a required program for tests that use it. CR: D603 MFC after: 3 days Sponsored by: Spectra Logic Modified: head/bin/pkill/tests/Makefile Modified: head/bin/pkill/tests/Makefile ============================================================================== --- head/bin/pkill/tests/Makefile Thu Aug 14 14:22:12 2014 (r269976) +++ head/bin/pkill/tests/Makefile Thu Aug 14 14:59:40 2014 (r269977) @@ -14,6 +14,7 @@ TAP_TESTS_SH+= pgrep-g_test TAP_TESTS_SH+= pgrep-i_test TAP_TESTS_SH+= pgrep-j_test TEST_METADATA.pgrep-j_test+= required_user="root" +TEST_METADATA.pgrep-j_test+= required_programs="jail jls" TAP_TESTS_SH+= pgrep-l_test TAP_TESTS_SH+= pgrep-n_test TAP_TESTS_SH+= pgrep-o_test @@ -31,6 +32,7 @@ TAP_TESTS_SH+= pkill-g_test TAP_TESTS_SH+= pkill-i_test TAP_TESTS_SH+= pkill-j_test TEST_METADATA.pkill-j_test+= required_user="root" +TEST_METADATA.pkill-j_test+= required_programs="jail jls" TAP_TESTS_SH+= pkill-s_test TAP_TESTS_SH+= pkill-t_test TAP_TESTS_SH+= pkill-x_test From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 15:46:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48DB35DB for ; Thu, 14 Aug 2014 15:46:09 +0000 (UTC) Received: from mail.egr.msu.edu (gribble.egr.msu.edu [35.9.37.169]) by mx1.freebsd.org (Postfix) with ESMTP id 222E92742 for ; Thu, 14 Aug 2014 15:46:08 +0000 (UTC) Received: from gribble (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id EC4562BB7D for ; Thu, 14 Aug 2014 11:46:00 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by gribble (gribble.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XrMymJ1BYslU for ; Thu, 14 Aug 2014 11:46:00 -0400 (EDT) Received: from EGR authenticated sender Message-ID: <53ECD9B8.7000502@egr.msu.edu> Date: Thu, 14 Aug 2014 11:46:00 -0400 From: Adam McDougall User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: svn commit: r269975 - in stable/10: . sys/dev/ixgbe References: <201408141407.s7EE75lC013864@svn.freebsd.org> In-Reply-To: <201408141407.s7EE75lC013864@svn.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 15:46:09 -0000 On 08/14/2014 10:07, Steven Hartland wrote: > Author: smh > Date: Thu Aug 14 14:07:05 2014 > New Revision: 269975 > URL: http://svnweb.freebsd.org/changeset/base/269975 > > Log: > Make the ixgbe tunables now match their sysctl counterparts. > > Previously the tunables and sysctls had different names for example: > hw.ixgbe.enable_aim => hw.ix.enable_aim > > Anyone using ixgbe tunables should ensure they update /boot/loader.conf. > > This is a direct commit to stable as the changes to sysctls in head > already fix this issue in a different way. > > Sponsored by: Multiplay > Modified: stable/10/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- stable/10/sys/dev/ixgbe/ixgbe.c Thu Aug 14 13:57:17 2014 (r269974) > +++ stable/10/sys/dev/ixgbe/ixgbe.c Thu Aug 14 14:07:05 2014 (r269975) > @@ -244,18 +244,18 @@ static SYSCTL_NODE(_hw, OID_AUTO, ix, CT > ** traffic for that interrupt vector > */ > static int ixgbe_enable_aim = TRUE; > -TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); > +TUNABLE_INT("hw.ix.enable_aim", &ixgbe_enable_aim); > SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RW, &ixgbe_enable_aim, 0, > "Enable adaptive interrupt moderation"); I'm not using ix yet, but could you retain the old tunables in 10 as hidden ones so configurations do not break? From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 15:46:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70130621; Thu, 14 Aug 2014 15:46:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D9652744; Thu, 14 Aug 2014 15:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EFkGfB059257; Thu, 14 Aug 2014 15:46:16 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EFkGgo059256; Thu, 14 Aug 2014 15:46:16 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201408141546.s7EFkGgo059256@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 14 Aug 2014 15:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269978 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 15:46:16 -0000 Author: alc Date: Thu Aug 14 15:46:15 2014 New Revision: 269978 URL: http://svnweb.freebsd.org/changeset/base/269978 Log: Avoid pointless (but harmless) actions on unmanaged pages. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Aug 14 14:59:40 2014 (r269977) +++ head/sys/vm/vm_fault.c Thu Aug 14 15:46:15 2014 (r269978) @@ -851,8 +851,9 @@ vnode_locked: if (hardfault) fs.entry->next_read = fs.pindex + faultcount - reqpage; - if ((prot & VM_PROT_WRITE) != 0 || - (fault_flags & VM_FAULT_DIRTY) != 0) { + if (((prot & VM_PROT_WRITE) != 0 || + (fault_flags & VM_FAULT_DIRTY) != 0) && + (fs.m->oflags & VPO_UNMANAGED) == 0) { vm_object_set_writeable_dirty(fs.object); /* From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:01:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D087B67; Thu, 14 Aug 2014 16:01:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE1E428A1; Thu, 14 Aug 2014 16:01:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EG1XuO067365; Thu, 14 Aug 2014 16:01:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EG1XXT067364; Thu, 14 Aug 2014 16:01:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408141601.s7EG1XXT067364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 16:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269979 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:01:34 -0000 Author: imp Date: Thu Aug 14 16:01:33 2014 New Revision: 269979 URL: http://svnweb.freebsd.org/changeset/base/269979 Log: Streamline format extensions. Either the compiler supports them, and we enable them and format wordings. Or it doesn't, and we disable format warnings because the kernel uses the extensions pervasively. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Aug 14 15:46:15 2014 (r269978) +++ head/sys/conf/kern.mk Thu Aug 14 16:01:33 2014 (r269979) @@ -29,14 +29,13 @@ NO_WSOMETIMES_UNINITIALIZED= -Wno-error- # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-error-unused-function \ - ${NO_WFORMAT} + -Wno-error-parentheses-equality -Wno-error-unused-function .endif # External compilers may not support our format extensions. Allow them # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} == "no" -NO_WFORMAT= -Wno-format +FORMAT_EXTENSIONS= -Wno-format .else FORMAT_EXTENSIONS= -fformat-extensions .endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:01:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CC59C9D; Thu, 14 Aug 2014 16:01:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E52272914; Thu, 14 Aug 2014 16:01:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EG1cIG067425; Thu, 14 Aug 2014 16:01:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EG1cX8067424; Thu, 14 Aug 2014 16:01:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408141601.s7EG1cX8067424@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 16:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269980 - head/sys/dev/cs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:01:39 -0000 Author: imp Date: Thu Aug 14 16:01:38 2014 New Revision: 269980 URL: http://svnweb.freebsd.org/changeset/base/269980 Log: Delete pp_isadma. It isn't use, and the code that used it has been commented out (temporarily) since 1998 when this driver hit the tree. Also, no need to compute the ethernet header and then never use it. Modified: head/sys/dev/cs/if_cs.c Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Thu Aug 14 16:01:33 2014 (r269979) +++ head/sys/dev/cs/if_cs.c Thu Aug 14 16:01:38 2014 (r269980) @@ -264,7 +264,7 @@ cs_cs89x0_probe(device_t dev) uint16_t id; char chip_revision; uint16_t eeprom_buff[CHKSUM_LEN]; - int chip_type, pp_isaint, pp_isadma; + int chip_type, pp_isaint; sc->dev = dev; error = cs_alloc_port(dev, 0, CS_89x0_IO_PORTS); @@ -299,11 +299,9 @@ cs_cs89x0_probe(device_t dev) if (chip_type == CS8900) { pp_isaint = PP_CS8900_ISAINT; - pp_isadma = PP_CS8900_ISADMA; sc->send_cmd = TX_CS8900_AFTER_ALL; } else { pp_isaint = PP_CS8920_ISAINT; - pp_isadma = PP_CS8920_ISADMA; sc->send_cmd = TX_CS8920_AFTER_ALL; } @@ -381,17 +379,6 @@ cs_cs89x0_probe(device_t dev) if (!(sc->flags & CS_NO_IRQ)) cs_writereg(sc, pp_isaint, irq); - /* - * Temporary disabled - * - if (drq>0) - cs_writereg(sc, pp_isadma, drq); - else { - device_printf(dev, "incorrect drq\n",); - return (0); - } - */ - if (bootverbose) device_printf(dev, "CS89%c0%s rev %c media%s%s%s\n", chip_type == CS8900 ? '0' : '2', @@ -702,7 +689,6 @@ cs_get_packet(struct cs_softc *sc) { struct ifnet *ifp = sc->ifp; int status, length; - struct ether_header *eh; struct mbuf *m; #ifdef CS_DEBUG @@ -746,8 +732,6 @@ cs_get_packet(struct cs_softc *sc) bus_read_multi_2(sc->port_res, RX_FRAME_PORT, mtod(m, uint16_t *), (length + 1) >> 1); - eh = mtod(m, struct ether_header *); - #ifdef CS_DEBUG for (i=0;im_data+i))); From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:01:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B48DD9; Thu, 14 Aug 2014 16:01:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FADE2928; Thu, 14 Aug 2014 16:01:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EG1k58067485; Thu, 14 Aug 2014 16:01:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EG1kZp067484; Thu, 14 Aug 2014 16:01:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408141601.s7EG1kZp067484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 16:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269981 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:01:47 -0000 Author: imp Date: Thu Aug 14 16:01:46 2014 New Revision: 269981 URL: http://svnweb.freebsd.org/changeset/base/269981 Log: Disable all inline warnings on gcc >= 4.3. Not sure exactly where the cutover is, but we need better tools to cope with inline tuning per compiler version than we have. This is a quick bandaid until such tools are around. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Aug 14 16:01:38 2014 (r269980) +++ head/sys/conf/kern.mk Thu Aug 14 16:01:46 2014 (r269981) @@ -32,6 +32,10 @@ CWARNEXTRA?= -Wno-error-tautological-com -Wno-error-parentheses-equality -Wno-error-unused-function .endif +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40300 +CWARNEXTRA?= -Wno-inline +.endif + # External compilers may not support our format extensions. Allow them # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} == "no" From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:01:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09D97E42; Thu, 14 Aug 2014 16:01:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAF31292A; Thu, 14 Aug 2014 16:01:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EG1pLh067542; Thu, 14 Aug 2014 16:01:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EG1psM067541; Thu, 14 Aug 2014 16:01:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408141601.s7EG1psM067541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 16:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269982 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:01:52 -0000 Author: imp Date: Thu Aug 14 16:01:51 2014 New Revision: 269982 URL: http://svnweb.freebsd.org/changeset/base/269982 Log: ins is only set and unused, but only when we're not doing software single stepping. Only set it when we're doing that by bending style(9) rules a little to avoid even worse #ifdef soup. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Thu Aug 14 16:01:46 2014 (r269981) +++ head/sys/ddb/db_run.c Thu Aug 14 16:01:51 2014 (r269982) @@ -188,14 +188,14 @@ db_restart_at_pc(watchpt) if ((db_run_mode == STEP_COUNT) || (db_run_mode == STEP_RETURN) || (db_run_mode == STEP_CALLT)) { - db_expr_t ins; - /* * We are about to execute this instruction, * so count it now. */ - - ins = db_get_value(pc, sizeof(int), FALSE); +#ifdef SOFTWARE_SSTEP + db_expr_t ins = +#endif + db_get_value(pc, sizeof(int), FALSE); db_inst_count++; db_load_count += inst_load(ins); db_store_count += inst_store(ins); From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:07:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03AEA24F; Thu, 14 Aug 2014 16:07:15 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC85229A5; Thu, 14 Aug 2014 16:07:14 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B6C95B93B; Thu, 14 Aug 2014 12:07:13 -0400 (EDT) From: John Baldwin To: Peter Wemm Subject: Re: svn commit: r269847 - in stable/10: contrib/apr contrib/apr/docs contrib/apr/encoding contrib/apr/file_io/unix contrib/apr/include contrib/apr/include/arch/unix contrib/apr/include/private contrib/... Date: Thu, 14 Aug 2014 11:14:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53e9707c.2d6c.2d976b@svn.freebsd.org> <201408121119.32037.jhb@freebsd.org> <5874043.odmAkWF3cI@overcee.wemm.org> In-Reply-To: <5874043.odmAkWF3cI@overcee.wemm.org> MIME-Version: 1.0 Message-Id: <201408141114.37992.jhb@freebsd.org> Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 14 Aug 2014 12:07:13 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:07:15 -0000 On Tuesday, August 12, 2014 4:23:16 pm Peter Wemm wrote: > On Tuesday 12 August 2014 11:19:31 John Baldwin wrote: > > On Monday, August 11, 2014 9:40:12 pm Peter Wemm wrote: > > > Author: peter > > > Date: Tue Aug 12 01:40:11 2014 > > > New Revision: 269847 > > > URL: http://svnweb.freebsd.org/changeset/base/269847 > > > > > > Log: > > > MFC r266728,266731,266735,266736,268135,268960,269833 > > > > > > Update apr 1.4.8 -> 1.5.1 > > > Update apr-util 1.5.2 -> 1.5.3 > > > Update serf 1.3.4 -> 1.3.7 > > > Update svnlite 1.8.8 -> 1.8.10 > > > Deal with svnlite.1 manpage. > > > > Isn't this merge a little quick? 1.8.10 only went into head about 6 hours > > before this commit. The 1.8.8 merge to 10 was also rather quick (less than > > an hour after it was merged to HEAD). If the security issues noted in the > > commit for HEAD are severe enough to warrant an immediate merge, then there > > should probably be an advisory. Otherwise, I think svn updates should > > probably have some bake time in HEAD before going to stable. > > The jumbo-MFC was mostly to gather up the updates that have been baking in > head for a while. 10.1 is coming up soon. > > It just seemed silly to MFC everything except a specific, targeted security fix. > I suspect that for every question I got about including the security update, > I'd have received 5 times as many asking why I hadn't included it. Surely the MFC could have waited 3 days or so though? We generally default to having some sort of bake-in period for MFCs and only bypassing that if there is an urgent need (such as an SA). The code flush for 10.1 is still a week away. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:17:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CFC5E00; Thu, 14 Aug 2014 16:17:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89B2C2B4E; Thu, 14 Aug 2014 16:17:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EGHN6g072716; Thu, 14 Aug 2014 16:17:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EGHNMc072715; Thu, 14 Aug 2014 16:17:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408141617.s7EGHNMc072715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 16:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269983 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:17:23 -0000 Author: imp Date: Thu Aug 14 16:17:23 2014 New Revision: 269983 URL: http://svnweb.freebsd.org/changeset/base/269983 Log: Only install the boot loader if it actually exists. This is a stop-gap change, since larger changes to use geom more exclusively to create partitions is in th works. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Aug 14 16:01:51 2014 (r269982) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Aug 14 16:17:23 2014 (r269983) @@ -581,8 +581,14 @@ create_i386_diskimage ( ) ( fdisk ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. - boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} - bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 + if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then + boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} + fi + if [ -f ${NANO_WORLDDIR}/boot/boot ]; then + bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 + else + bsdlabel -w ${MD}s1 + fi bsdlabel ${MD}s1 # Create first image From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:17:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7213FF47; Thu, 14 Aug 2014 16:17:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46A7E2B52; Thu, 14 Aug 2014 16:17:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EGHVJE072782; Thu, 14 Aug 2014 16:17:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EGHUwU072778; Thu, 14 Aug 2014 16:17:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408141617.s7EGHUwU072778@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 16:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269984 - in head/tools/tools/nanobsd: . dhcpd rescue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:17:31 -0000 Author: imp Date: Thu Aug 14 16:17:30 2014 New Revision: 269984 URL: http://svnweb.freebsd.org/changeset/base/269984 Log: create_$ARCH_diskimage never really took off. Collapse back down to just one. Modified: head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/nanobsd.sh head/tools/tools/nanobsd/rescue/common Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Thu Aug 14 16:17:23 2014 (r269983) +++ head/tools/tools/nanobsd/dhcpd/common Thu Aug 14 16:17:30 2014 (r269984) @@ -261,11 +261,6 @@ die() exit 1 } -create_amd64_diskimage() -{ - create_i386_diskimage "$*" -} - # Automatically include the packaging port here so it is always first so it # builds the port and adds the package so we can add other packages. add_port ports-mgmt/pkg Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Aug 14 16:17:23 2014 (r269983) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Aug 14 16:17:30 2014 (r269984) @@ -487,7 +487,7 @@ populate_data_slice ( ) ( populate_slice "$1" "$2" "$3" "$4" ) -create_i386_diskimage ( ) ( +create_diskimage ( ) ( pprint 2 "build diskimage" pprint 3 "log: ${NANO_OBJ}/_.di" @@ -649,11 +649,6 @@ create_i386_diskimage ( ) ( ) > ${NANO_OBJ}/_.di 2>&1 ) -# i386 and amd64 are identical for disk images -create_amd64_diskimage ( ) ( - create_i386_diskimage -) - last_orders () ( # Redefine this function with any last orders you may have # after the build completed, for instance to copy the finished @@ -1106,7 +1101,7 @@ setup_nanobsd prune_usr run_late_customize if $do_image ; then - create_${NANO_ARCH}_diskimage + create_diskimage else pprint 2 "Skipping image build (as instructed)" fi Modified: head/tools/tools/nanobsd/rescue/common ============================================================================== --- head/tools/tools/nanobsd/rescue/common Thu Aug 14 16:17:23 2014 (r269983) +++ head/tools/tools/nanobsd/rescue/common Thu Aug 14 16:17:30 2014 (r269984) @@ -106,11 +106,3 @@ last_orders () ( -o bootimage="i386;_.w/boot/cdboot" -o no-emul-boot _.disk.iso _.w/ ) ) - -#create_i386_diskimage () { -# #currently not used -#} - -#create_amd64_diskimage () { -# create_i386_diskimage -#} From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:25:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 725BA556; Thu, 14 Aug 2014 16:25:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6D72D02; Thu, 14 Aug 2014 16:25:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EGPiJO077368; Thu, 14 Aug 2014 16:25:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EGPi8X077367; Thu, 14 Aug 2014 16:25:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201408141625.s7EGPi8X077367@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 14 Aug 2014 16:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269985 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:25:44 -0000 Author: gjb Date: Thu Aug 14 16:25:43 2014 New Revision: 269985 URL: http://svnweb.freebsd.org/changeset/base/269985 Log: Update the URL to the phabricator instance. Sponsored by: The FreeBSD Foundation Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Thu Aug 14 16:17:30 2014 (r269984) +++ head/.arcconfig Thu Aug 14 16:25:43 2014 (r269985) @@ -1,5 +1,5 @@ { "project.name": "S", - "phabricator.uri" : "https://phabric.freebsd.org/", + "phabricator.uri" : "https://reviews.freebsd.org/", "history.immutable" : true } From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:45:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4846B51; Thu, 14 Aug 2014 16:45:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D06362FE5; Thu, 14 Aug 2014 16:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EGj2sO086671; Thu, 14 Aug 2014 16:45:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EGj2GF086670; Thu, 14 Aug 2014 16:45:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201408141645.s7EGj2GF086670@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 Aug 2014 16:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269987 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:45:03 -0000 Author: markj Date: Thu Aug 14 16:45:02 2014 New Revision: 269987 URL: http://svnweb.freebsd.org/changeset/base/269987 Log: MFC r257877: Don't try to use the 32-bit drti.o unless the data model is explicitly set to ILP32. Otherwise dtrace -G will attempt to use it on amd64 if it can't determine which data model to use, which happens when -64 is omitted and no object files are provided, e.g. with # dtrace -G -n BEGIN This would result in a linker error, but now works properly. Also remove an unnecessary #ifdef. Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Aug 14 16:45:01 2014 (r269986) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Aug 14 16:45:02 2014 (r269987) @@ -1790,7 +1790,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, d * Arches which default to 64-bit need to explicitly use * the 32-bit library path. */ - int use_32 = !(dtp->dt_oflags & DTRACE_O_LP64); + int use_32 = (dtp->dt_oflags & DTRACE_O_ILP32); #else /* * Arches which are 32-bit only just use the normal @@ -1805,9 +1805,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, d len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile, drti) + 1; -#if !defined(sun) len *= 2; -#endif cmd = alloca(len); (void) snprintf(cmd, len, fmt, dtp->dt_ld_path, file, From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 16:45:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB9E7B50; Thu, 14 Aug 2014 16:45:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6FE02FE3; Thu, 14 Aug 2014 16:45:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EGj1Bj086627; Thu, 14 Aug 2014 16:45:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EGj1Ef086626; Thu, 14 Aug 2014 16:45:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201408141645.s7EGj1Ef086626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 Aug 2014 16:45: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: r269986 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 16:45:02 -0000 Author: markj Date: Thu Aug 14 16:45:01 2014 New Revision: 269986 URL: http://svnweb.freebsd.org/changeset/base/269986 Log: MFC r257877: Don't try to use the 32-bit drti.o unless the data model is explicitly set to ILP32. Otherwise dtrace -G will attempt to use it on amd64 if it can't determine which data model to use, which happens when -64 is omitted and no object files are provided, e.g. with # dtrace -G -n BEGIN This would result in a linker error, but now works properly. Also remove an unnecessary #ifdef. Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Aug 14 16:25:43 2014 (r269985) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Aug 14 16:45:01 2014 (r269986) @@ -1871,7 +1871,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, d * Arches which default to 64-bit need to explicitly use * the 32-bit library path. */ - int use_32 = !(dtp->dt_oflags & DTRACE_O_LP64); + int use_32 = (dtp->dt_oflags & DTRACE_O_ILP32); #else /* * Arches which are 32-bit only just use the normal @@ -1886,9 +1886,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, d len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile, drti) + 1; -#if !defined(sun) len *= 2; -#endif cmd = alloca(len); (void) snprintf(cmd, len, fmt, dtp->dt_ld_path, file, From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 18:03:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B082F37E; Thu, 14 Aug 2014 18:03:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8354A28AA; Thu, 14 Aug 2014 18:03:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EI3cdG023758; Thu, 14 Aug 2014 18:03:38 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EI3c6a023757; Thu, 14 Aug 2014 18:03:38 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201408141803.s7EI3c6a023757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Thu, 14 Aug 2014 18:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269989 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 18:03:38 -0000 Author: neel Date: Thu Aug 14 18:03:38 2014 New Revision: 269989 URL: http://svnweb.freebsd.org/changeset/base/269989 Log: Reword comment to match the interrupt mode names from the MPtable spec. Reviewed by: tychon Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Thu Aug 14 17:31:04 2014 (r269988) +++ head/sys/amd64/vmm/io/vatpic.c Thu Aug 14 18:03:38 2014 (r269989) @@ -195,26 +195,29 @@ vatpic_notify_intr(struct vatpic *vatpic atpic->mask, atpic->request, atpic->service); /* + * From Section 3.6.2, "Interrupt Modes", in the + * MPtable Specification, Version 1.4 + * * PIC interrupts are routed to both the Local APIC * and the I/O APIC to support operation in 1 of 3 * modes. * * 1. Legacy PIC Mode: the PIC effectively bypasses - * all APIC components. In mode '1' the local APIC is + * all APIC components. In this mode the local APIC is * disabled and LINT0 is reconfigured as INTR to * deliver the PIC interrupt directly to the CPU. * * 2. Virtual Wire Mode: the APIC is treated as a * virtual wire which delivers interrupts from the PIC - * to the CPU. In mode '2' LINT0 is programmed as + * to the CPU. In this mode LINT0 is programmed as * ExtINT to indicate that the PIC is the source of * the interrupt. * - * 3. Symmetric I/O Mode: PIC interrupts are fielded - * by the I/O APIC and delivered to the appropriate - * CPU. In mode '3' the I/O APIC input 0 is - * programmed as ExtINT to indicate that the PIC is - * the source of the interrupt. + * 3. Virtual Wire Mode via I/O APIC: PIC interrupts are + * fielded by the I/O APIC and delivered to the appropriate + * CPU. In this mode the I/O APIC input 0 is programmed + * as ExtINT to indicate that the PIC is the source of the + * interrupt. */ atpic->intr_raised = true; lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 18:16:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 335448F3; Thu, 14 Aug 2014 18:16:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 064FE2A4D; Thu, 14 Aug 2014 18:16:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EIGRrG028908; Thu, 14 Aug 2014 18:16:27 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EIGROq028907; Thu, 14 Aug 2014 18:16:27 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408141816.s7EIGROq028907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 14 Aug 2014 18:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269991 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 18:16:28 -0000 Author: gavin Date: Thu Aug 14 18:16:27 2014 New Revision: 269991 URL: http://svnweb.freebsd.org/changeset/base/269991 Log: Allow iwn105fw and iwn135 firmwares to be compiled into the kernel. MFC after: 1 week Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 14 18:08:51 2014 (r269990) +++ head/sys/conf/files Thu Aug 14 18:16:27 2014 (r269991) @@ -1596,6 +1596,34 @@ iwn1000.fw optional iwn1000fw | iwnfw compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn1000.fw" +iwn105fw.c optional iwn105fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn105.fw:iwn105fw -miwn105fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn105fw.c" +iwn105fw.fwo optional iwn105fw | iwnfw \ + dependency "iwn105.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwn105fw.fwo" +iwn105.fw optional iwn105fw | iwnfw \ + dependency "$S/contrib/dev/iwn/iwlwifi-105-6-18.168.6.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwn105.fw" +iwn135fw.c optional iwn135fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn135.fw:iwn135fw -miwn135fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn135fw.c" +iwn135fw.fwo optional iwn135fw | iwnfw \ + dependency "iwn135.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwn135fw.fwo" +iwn135.fw optional iwn135fw | iwnfw \ + dependency "$S/contrib/dev/iwn/iwlwifi-135-6-18.168.6.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwn135.fw" iwn2000fw.c optional iwn2000fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn2000.fw:iwn2000fw -miwn2000fw -c${.TARGET}" \ no-implicit-rule before-depend local \ From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 18:29:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67C21D9A; Thu, 14 Aug 2014 18:29:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5437D2B9E; Thu, 14 Aug 2014 18:29:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EITu8J033849; Thu, 14 Aug 2014 18:29:56 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EITtZe033846; Thu, 14 Aug 2014 18:29:55 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408141829.s7EITtZe033846@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 14 Aug 2014 18:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269992 - in head/sys: amd64/conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 18:29:56 -0000 Author: gavin Date: Thu Aug 14 18:29:55 2014 New Revision: 269992 URL: http://svnweb.freebsd.org/changeset/base/269992 Log: Update i386/NOTES and amd64/NOTES files to contain the complete list of firmwares for iwn(4) and sort them. MFC after: 1 week Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Thu Aug 14 18:16:27 2014 (r269991) +++ head/sys/amd64/conf/NOTES Thu Aug 14 18:29:55 2014 (r269992) @@ -307,7 +307,8 @@ options DRM_DEBUG # Include debug print # Requires the ipw firmware module # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters # Requires the iwi firmware module -# iwn: Intel Wireless WiFi Link 4965/1000/5000/6000 802.11 network adapters +# iwn: Intel Wireless WiFi Link 1000/105/135/2000/4965/5000/6000/6050 abgn +# 802.11 network adapters # Requires the iwn firmware module # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlxen: Mellanox ConnectX HCA Ethernet @@ -347,12 +348,18 @@ device wpi # Intel 3945ABG wireless NI # iwiibssfw: IBSS mode firmware # iwimonitorfw: Monitor mode firmware # Intel Wireless WiFi Link 4965/1000/5000/6000 series firmware: -# iwnfw: Single module to support the 4965/1000/5000/5150/6000 -# iwn4965fw: Specific module for the 4965 only +# iwnfw: Single module to support all devices # iwn1000fw: Specific module for the 1000 only +# iwn105fw: Specific module for the 105 only +# iwn135fw: Specific module for the 135 only +# iwn2000fw: Specific module for the 2000 only +# iwn2030fw: Specific module for the 2030 only +# iwn4965fw: Specific module for the 4965 only # iwn5000fw: Specific module for the 5000 only # iwn5150fw: Specific module for the 5150 only # iwn6000fw: Specific module for the 6000 only +# iwn6000g2afw: Specific module for the 6000g2a only +# iwn6000g2bfw: Specific module for the 6000g2b only # iwn6050fw: Specific module for the 6050 only # wpifw: Intel 3945ABG Wireless LAN Controller firmware @@ -365,11 +372,17 @@ device ipwbssfw device ipwibssfw device ipwmonitorfw device iwnfw -device iwn4965fw device iwn1000fw +device iwn105fw +device iwn135fw +device iwn2000fw +device iwn2030fw +device iwn4965fw device iwn5000fw device iwn5150fw device iwn6000fw +device iwn6000g2afw +device iwn6000g2bfw device iwn6050fw device wpifw Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Aug 14 18:16:27 2014 (r269991) +++ head/sys/i386/conf/NOTES Thu Aug 14 18:29:55 2014 (r269992) @@ -578,7 +578,8 @@ hint.mse.0.irq="5" # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters # Requires the iwi firmware module -# iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters +# iwn: Intel Wireless WiFi Link 1000/105/135/2000/4965/5000/6000/6050 abgn +# 802.11 network adapters # Requires the iwn firmware module # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlxen: Mellanox ConnectX HCA Ethernet @@ -656,12 +657,18 @@ device wpi # Intel 3945ABG wireless NI # iwiibssfw: IBSS mode firmware # iwimonitorfw: Monitor mode firmware # Intel Wireless WiFi Link 4965/1000/5000/6000 series firmware: -# iwnfw: Single module to support the 4965/1000/5000/5150/6000 -# iwn4965fw: Specific module for the 4965 only +# iwnfw: Single module to support all devices # iwn1000fw: Specific module for the 1000 only +# iwn105fw: Specific module for the 105 only +# iwn135fw: Specific module for the 135 only +# iwn2000fw: Specific module for the 2000 only +# iwn2030fw: Specific module for the 2030 only +# iwn4965fw: Specific module for the 4965 only # iwn5000fw: Specific module for the 5000 only # iwn5150fw: Specific module for the 5150 only # iwn6000fw: Specific module for the 6000 only +# iwn6000g2afw: Specific module for the 6000g2a only +# iwn6000g2bfw: Specific module for the 6000g2b only # iwn6050fw: Specific module for the 6050 only # wpifw: Intel 3945ABG Wireless LAN Controller firmware @@ -674,11 +681,17 @@ device ipwbssfw device ipwibssfw device ipwmonitorfw device iwnfw -device iwn4965fw device iwn1000fw +device iwn105fw +device iwn135fw +device iwn2000fw +device iwn2030fw +device iwn4965fw device iwn5000fw device iwn5150fw device iwn6000fw +device iwn6000g2afw +device iwn6000g2bfw device iwn6050fw device wpifw From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 18:38:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFD0E390; Thu, 14 Aug 2014 18:38:38 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 73C392D11; Thu, 14 Aug 2014 18:38:38 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id s7EIcVbj098248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Aug 2014 11:38:31 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id s7EIcVV9098247; Thu, 14 Aug 2014 11:38:31 -0700 (PDT) (envelope-from sgk) Date: Thu, 14 Aug 2014 11:38:31 -0700 From: Steve Kargl To: Gavin Atkinson Subject: Re: svn commit: r269992 - in head/sys: amd64/conf i386/conf Message-ID: <20140814183831.GA98162@troutmask.apl.washington.edu> References: <201408141829.s7EITtZe033846@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201408141829.s7EITtZe033846@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 18:38:38 -0000 On Thu, Aug 14, 2014 at 06:29:55PM +0000, Gavin Atkinson wrote: > Author: gavin > Date: Thu Aug 14 18:29:55 2014 > New Revision: 269992 > URL: http://svnweb.freebsd.org/changeset/base/269992 > > Log: > Update i386/NOTES and amd64/NOTES files to contain the complete list of > firmwares for iwn(4) and sort them. > > MFC after: 1 week > 'man iwn' seems to be missing iwn105fw and iwn135fw. I don't build or use modules, so I'm not sure if these can be loaded as modules, but you need something like Index: iwn.4 =================================================================== --- iwn.4 (revision 269758) +++ iwn.4 (working copy) @@ -45,6 +45,8 @@ You also need to select a firmware for your device. Choose one from: .Bd -ragged -offset indent +.Cd "device iwn105fw" +.Cd "device iwn135fw" .Cd "device iwn1000fw" .Cd "device iwn2000fw" .Cd "device iwn2030fw" @@ -69,6 +71,8 @@ .Xr loader.conf 5 : .Bd -literal -offset indent if_iwn_load="YES" +iwn105fw_load="YES" +iwn135fw_load="YES" iwn1000fw_load="YES" iwn2000fw_load="YES" iwn2030fw_load="YES" -- Steve From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 18:57:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC5F6EB7; Thu, 14 Aug 2014 18:57:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD7B4201B; Thu, 14 Aug 2014 18:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EIvlCL047355; Thu, 14 Aug 2014 18:57:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EIvkGt047351; Thu, 14 Aug 2014 18:57:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408141857.s7EIvkGt047351@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 14 Aug 2014 18:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269998 - in head/sys: net netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 18:57:48 -0000 Author: glebius Date: Thu Aug 14 18:57:46 2014 New Revision: 269998 URL: http://svnweb.freebsd.org/changeset/base/269998 Log: - Count global pf(4) statistics in counter(9). - Do not count global number of states and of src_nodes, use uma_zone_get_cur() to obtain values. - Struct pf_status becomes merely an ioctl API structure, and moves to netpfil/pf/pf.h with its constants. - V_pf_status is now of type struct pf_kstatus. Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf.h head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Aug 14 18:46:36 2014 (r269997) +++ head/sys/net/pfvar.h Thu Aug 14 18:57:46 2014 (r269998) @@ -1123,27 +1123,6 @@ struct pf_pdesc { #define PF_DPORT_RANGE 0x01 /* Dest port uses range */ #define PF_RPORT_RANGE 0x02 /* RDR'ed port uses range */ -/* Counters for other things we want to keep track of */ -#define LCNT_STATES 0 /* states */ -#define LCNT_SRCSTATES 1 /* max-src-states */ -#define LCNT_SRCNODES 2 /* max-src-nodes */ -#define LCNT_SRCCONN 3 /* max-src-conn */ -#define LCNT_SRCCONNRATE 4 /* max-src-conn-rate */ -#define LCNT_OVERLOAD_TABLE 5 /* entry added to overload table */ -#define LCNT_OVERLOAD_FLUSH 6 /* state entries flushed */ -#define LCNT_MAX 7 /* total+1 */ - -#define LCNT_NAMES { \ - "max states per rule", \ - "max-src-states", \ - "max-src-nodes", \ - "max-src-conn", \ - "max-src-conn-rate", \ - "overload table insertion", \ - "overload flush states", \ - NULL \ -} - /* UDP state enumeration */ #define PFUDPS_NO_TRAFFIC 0 #define PFUDPS_SINGLE 1 @@ -1172,16 +1151,6 @@ struct pf_pdesc { NULL \ } -#define FCNT_STATE_SEARCH 0 -#define FCNT_STATE_INSERT 1 -#define FCNT_STATE_REMOVALS 2 -#define FCNT_MAX 3 - -#define SCNT_SRC_NODE_SEARCH 0 -#define SCNT_SRC_NODE_INSERT 1 -#define SCNT_SRC_NODE_REMOVALS 2 -#define SCNT_MAX 3 - #define ACTION_SET(a, x) \ do { \ if ((a) != NULL) \ @@ -1193,24 +1162,22 @@ struct pf_pdesc { if ((a) != NULL) \ *(a) = (x); \ if (x < PFRES_MAX) \ - V_pf_status.counters[x]++; \ + counter_u64_add(V_pf_status.counters[x], 1); \ } while (0) -struct pf_status { - u_int64_t counters[PFRES_MAX]; - u_int64_t lcounters[LCNT_MAX]; /* limit counters */ - u_int64_t fcounters[FCNT_MAX]; - u_int64_t scounters[SCNT_MAX]; - u_int64_t pcounters[2][2][3]; - u_int64_t bcounters[2][2]; - u_int32_t running; - u_int32_t states; - u_int32_t src_nodes; - u_int32_t since; - u_int32_t debug; - u_int32_t hostid; +struct pf_kstatus { + counter_u64_t counters[PFRES_MAX]; /* reason for passing/dropping */ + counter_u64_t lcounters[LCNT_MAX]; /* limit counters */ + counter_u64_t fcounters[FCNT_MAX]; /* state operation counters */ + counter_u64_t scounters[SCNT_MAX]; /* src_node operation counters */ + uint32_t states; + uint32_t src_nodes; + uint32_t running; + uint32_t since; + uint32_t debug; + uint32_t hostid; char ifname[IFNAMSIZ]; - u_int8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; + uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; }; struct pf_divert { @@ -1704,8 +1671,8 @@ int pf_match_tag(struct mbuf *, struct int pf_tag_packet(struct mbuf *, struct pf_pdesc *, int); void pf_qid2qname(u_int32_t, char *); -VNET_DECLARE(struct pf_status, pf_status); -#define V_pf_status VNET(pf_status) +VNET_DECLARE(struct pf_kstatus, pf_status); +#define V_pf_status VNET(pf_status) struct pf_limit { uma_zone_t zone; Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Aug 14 18:46:36 2014 (r269997) +++ head/sys/netpfil/pf/pf.c Thu Aug 14 18:57:46 2014 (r269998) @@ -110,7 +110,7 @@ VNET_DEFINE(struct pf_altqqueue, pf_alt VNET_DEFINE(struct pf_palist, pf_pabuf); VNET_DEFINE(struct pf_altqqueue *, pf_altqs_active); VNET_DEFINE(struct pf_altqqueue *, pf_altqs_inactive); -VNET_DEFINE(struct pf_status, pf_status); +VNET_DEFINE(struct pf_kstatus, pf_status); VNET_DEFINE(u_int32_t, ticket_altqs_active); VNET_DEFINE(u_int32_t, ticket_altqs_inactive); @@ -469,13 +469,13 @@ pf_src_connlimit(struct pf_state **state if ((*state)->rule.ptr->max_src_conn && (*state)->rule.ptr->max_src_conn < (*state)->src_node->conn) { - V_pf_status.lcounters[LCNT_SRCCONN]++; + counter_u64_add(V_pf_status.lcounters[LCNT_SRCCONN], 1); bad++; } if ((*state)->rule.ptr->max_src_conn_rate.limit && pf_check_threshold(&(*state)->src_node->conn_rate)) { - V_pf_status.lcounters[LCNT_SRCCONNRATE]++; + counter_u64_add(V_pf_status.lcounters[LCNT_SRCCONNRATE], 1); bad++; } @@ -523,7 +523,7 @@ pf_overload_task(void *v, int pending) bzero(&p, sizeof(p)); SLIST_FOREACH(pfoe, &queue, next) { - V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; + counter_u64_add(V_pf_status.lcounters[LCNT_OVERLOAD_TABLE], 1); if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("%s: blocking address ", __func__); pf_print_host(&pfoe->addr, 0, pfoe->af); @@ -559,7 +559,8 @@ pf_overload_task(void *v, int pending) SLIST_REMOVE(&queue, pfoe, pf_overload_entry, next); free(pfoe, M_PFTEMP); } else - V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; + counter_u64_add( + V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH], 1); /* If nothing to flush, return. */ if (SLIST_EMPTY(&queue)) { @@ -609,7 +610,7 @@ pf_find_src_node(struct pf_addr *src, st struct pf_srchash *sh; struct pf_src_node *n; - V_pf_status.scounters[SCNT_SRC_NODE_SEARCH]++; + counter_u64_add(V_pf_status.scounters[SCNT_SRC_NODE_SEARCH], 1); sh = &V_pf_srchash[pf_hashsrc(src, af)]; PF_HASHROW_LOCK(sh); @@ -645,7 +646,8 @@ pf_insert_src_node(struct pf_src_node ** counter_u64_fetch(rule->src_nodes) < rule->max_src_nodes) (*sn) = uma_zalloc(V_pf_sources_z, M_NOWAIT | M_ZERO); else - V_pf_status.lcounters[LCNT_SRCNODES]++; + counter_u64_add(V_pf_status.lcounters[LCNT_SRCNODES], + 1); if ((*sn) == NULL) { PF_HASHROW_UNLOCK(sh); return (-1); @@ -664,12 +666,12 @@ pf_insert_src_node(struct pf_src_node ** if ((*sn)->rule.ptr != NULL) counter_u64_add((*sn)->rule.ptr->src_nodes, 1); PF_HASHROW_UNLOCK(sh); - V_pf_status.scounters[SCNT_SRC_NODE_INSERT]++; - V_pf_status.src_nodes++; + counter_u64_add(V_pf_status.scounters[SCNT_SRC_NODE_INSERT], 1); } else { if (rule->max_src_states && (*sn)->states >= rule->max_src_states) { - V_pf_status.lcounters[LCNT_SRCSTATES]++; + counter_u64_add(V_pf_status.lcounters[LCNT_SRCSTATES], + 1); return (-1); } } @@ -688,8 +690,7 @@ pf_unlink_src_node_locked(struct pf_src_ LIST_REMOVE(src, entry); if (src->rule.ptr) counter_u64_add(src->rule.ptr->src_nodes, -1); - V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; - V_pf_status.src_nodes--; + counter_u64_add(V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS], 1); } void @@ -1203,7 +1204,7 @@ pf_state_insert(struct pfi_kif *kif, str /* One for keys, one for ID hash. */ refcount_init(&s->refs, 2); - V_pf_status.fcounters[FCNT_STATE_INSERT]++; + counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1); if (pfsync_insert_state_ptr != NULL) pfsync_insert_state_ptr(s); @@ -1220,7 +1221,7 @@ pf_find_state_byid(uint64_t id, uint32_t struct pf_idhash *ih; struct pf_state *s; - V_pf_status.fcounters[FCNT_STATE_SEARCH]++; + counter_u64_add(V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; @@ -1247,7 +1248,7 @@ pf_find_state(struct pfi_kif *kif, struc struct pf_state *s; int idx; - V_pf_status.fcounters[FCNT_STATE_SEARCH]++; + counter_u64_add(V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); kh = &V_pf_keyhash[pf_hashkey((struct pf_state_key *)key)]; @@ -1291,7 +1292,7 @@ pf_find_state_all(struct pf_state_key_cm struct pf_state *s, *ret = NULL; int idx, inout = 0; - V_pf_status.fcounters[FCNT_STATE_SEARCH]++; + counter_u64_add(V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); kh = &V_pf_keyhash[pf_hashkey((struct pf_state_key *)key)]; @@ -1519,6 +1520,8 @@ pf_purge_expired_src_nodes() } pf_free_src_nodes(&freelist); + + V_pf_status.src_nodes = uma_zone_get_cur(V_pf_sources_z); } static void @@ -1613,7 +1616,7 @@ pf_free_state(struct pf_state *cur) pf_normalize_tcp_cleanup(cur); uma_zfree(V_pf_state_z, cur); - V_pf_status.fcounters[FCNT_STATE_REMOVALS]++; + counter_u64_add(V_pf_status.fcounters[FCNT_STATE_REMOVALS], 1); } /* @@ -3454,7 +3457,7 @@ pf_create_state(struct pf_rule *r, struc /* check maximums */ if (r->max_states && (counter_u64_fetch(r->states_cur) >= r->max_states)) { - V_pf_status.lcounters[LCNT_STATES]++; + counter_u64_add(V_pf_status.lcounters[LCNT_STATES], 1); REASON_SET(&reason, PFRES_MAXSTATES); return (PF_DROP); } Modified: head/sys/netpfil/pf/pf.h ============================================================================== --- head/sys/netpfil/pf/pf.h Thu Aug 14 18:46:36 2014 (r269997) +++ head/sys/netpfil/pf/pf.h Thu Aug 14 18:57:46 2014 (r269998) @@ -145,7 +145,57 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE NULL \ } +/* Counters for other things we want to keep track of */ +#define LCNT_STATES 0 /* states */ +#define LCNT_SRCSTATES 1 /* max-src-states */ +#define LCNT_SRCNODES 2 /* max-src-nodes */ +#define LCNT_SRCCONN 3 /* max-src-conn */ +#define LCNT_SRCCONNRATE 4 /* max-src-conn-rate */ +#define LCNT_OVERLOAD_TABLE 5 /* entry added to overload table */ +#define LCNT_OVERLOAD_FLUSH 6 /* state entries flushed */ +#define LCNT_MAX 7 /* total+1 */ + +#define LCNT_NAMES { \ + "max states per rule", \ + "max-src-states", \ + "max-src-nodes", \ + "max-src-conn", \ + "max-src-conn-rate", \ + "overload table insertion", \ + "overload flush states", \ + NULL \ +} + +/* state operation counters */ +#define FCNT_STATE_SEARCH 0 +#define FCNT_STATE_INSERT 1 +#define FCNT_STATE_REMOVALS 2 +#define FCNT_MAX 3 + +/* src_node operation counters */ +#define SCNT_SRC_NODE_SEARCH 0 +#define SCNT_SRC_NODE_INSERT 1 +#define SCNT_SRC_NODE_REMOVALS 2 +#define SCNT_MAX 3 + #define PF_TABLE_NAME_SIZE 32 #define PF_QNAME_SIZE 64 +struct pf_status { + uint64_t counters[PFRES_MAX]; + uint64_t lcounters[LCNT_MAX]; + uint64_t fcounters[FCNT_MAX]; + uint64_t scounters[SCNT_MAX]; + uint64_t pcounters[2][2][3]; + uint64_t bcounters[2][2]; + uint32_t running; + uint32_t states; + uint32_t src_nodes; + uint32_t since; + uint32_t debug; + uint32_t hostid; + char ifname[IFNAMSIZ]; + uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; +}; + #endif /* _NET_PF_H_ */ Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Aug 14 18:46:36 2014 (r269997) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Aug 14 18:57:46 2014 (r269998) @@ -265,6 +265,15 @@ pfattach(void) /* XXX do our best to avoid a conflict */ V_pf_status.hostid = arc4random(); + for (int i = 0; i < PFRES_MAX; i++) + V_pf_status.counters[i] = counter_u64_alloc(M_WAITOK); + for (int i = 0; i < LCNT_MAX; i++) + V_pf_status.lcounters[i] = counter_u64_alloc(M_WAITOK); + for (int i = 0; i < FCNT_MAX; i++) + V_pf_status.fcounters[i] = counter_u64_alloc(M_WAITOK); + for (int i = 0; i < SCNT_MAX; i++) + V_pf_status.scounters[i] = counter_u64_alloc(M_WAITOK); + if ((error = kproc_create(pf_purge_thread, curvnet, NULL, 0, 0, "pf purge")) != 0) /* XXXGL: leaked all above. */ @@ -1787,8 +1796,32 @@ DIOCGETSTATES_full: case DIOCGETSTATUS: { struct pf_status *s = (struct pf_status *)addr; + PF_RULES_RLOCK(); - bcopy(&V_pf_status, s, sizeof(struct pf_status)); + s->running = V_pf_status.running; + s->since = V_pf_status.since; + s->debug = V_pf_status.debug; + s->hostid = V_pf_status.hostid; + s->states = V_pf_status.states; + s->src_nodes = V_pf_status.src_nodes; + + for (int i = 0; i < PFRES_MAX; i++) + s->counters[i] = + counter_u64_fetch(V_pf_status.counters[i]); + for (int i = 0; i < LCNT_MAX; i++) + s->lcounters[i] = + counter_u64_fetch(V_pf_status.lcounters[i]); + for (int i = 0; i < FCNT_MAX; i++) + s->fcounters[i] = + counter_u64_fetch(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + s->scounters[i] = + counter_u64_fetch(V_pf_status.scounters[i]); + + bcopy(V_pf_status.ifname, s->ifname, IFNAMSIZ); + bcopy(V_pf_status.pf_chksum, s->pf_chksum, + PF_MD5_DIGEST_LENGTH); + pfi_update_status(s->ifname, s); PF_RULES_RUNLOCK(); break; @@ -1809,9 +1842,12 @@ DIOCGETSTATES_full: case DIOCCLRSTATUS: { PF_RULES_WLOCK(); - bzero(V_pf_status.counters, sizeof(V_pf_status.counters)); - bzero(V_pf_status.fcounters, sizeof(V_pf_status.fcounters)); - bzero(V_pf_status.scounters, sizeof(V_pf_status.scounters)); + for (int i = 0; i < PFRES_MAX; i++) + counter_u64_zero(V_pf_status.counters[i]); + for (int i = 0; i < FCNT_MAX; i++) + counter_u64_zero(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + counter_u64_zero(V_pf_status.scounters[i]); V_pf_status.since = time_second; if (*V_pf_status.ifname) pfi_update_status(V_pf_status.ifname, NULL); @@ -3157,7 +3193,6 @@ DIOCCHANGEADDR_error: pf_clear_srcnodes(NULL); pf_purge_expired_src_nodes(); - V_pf_status.src_nodes = 0; break; } @@ -3455,6 +3490,15 @@ shutdown_pf(void) counter_u64_free(V_pf_default_rule.states_tot); counter_u64_free(V_pf_default_rule.src_nodes); + for (int i = 0; i < PFRES_MAX; i++) + counter_u64_free(V_pf_status.counters[i]); + for (int i = 0; i < LCNT_MAX; i++) + counter_u64_free(V_pf_status.lcounters[i]); + for (int i = 0; i < FCNT_MAX; i++) + counter_u64_free(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + counter_u64_free(V_pf_status.scounters[i]); + do { if ((error = pf_begin_rules(&t[0], PF_RULESET_SCRUB, &nn)) != 0) { From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 19:14:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8F44752; Thu, 14 Aug 2014 19:14:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B62D2217; Thu, 14 Aug 2014 19:14:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EJEPY5056169; Thu, 14 Aug 2014 19:14:25 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EJEPb3056167; Thu, 14 Aug 2014 19:14:25 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408141914.s7EJEPb3056167@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 14 Aug 2014 19:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269999 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 19:14:25 -0000 Author: gavin Date: Thu Aug 14 19:14:24 2014 New Revision: 269999 URL: http://svnweb.freebsd.org/changeset/base/269999 Log: Update iwn(4) and iwnfw(4) man pages to reflect all available firmware. MFC after: 1 week Modified: head/share/man/man4/iwn.4 head/share/man/man4/iwnfw.4 Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Thu Aug 14 18:57:46 2014 (r269998) +++ head/share/man/man4/iwn.4 Thu Aug 14 19:14:24 2014 (r269999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2014 +.Dd August 14, 2014 .Dt IWN 4 .Os .Sh NAME @@ -46,6 +46,8 @@ You also need to select a firmware for y Choose one from: .Bd -ragged -offset indent .Cd "device iwn1000fw" +.Cd "device iwn105fw" +.Cd "device iwn135fw" .Cd "device iwn2000fw" .Cd "device iwn2030fw" .Cd "device iwn4965fw" @@ -70,6 +72,8 @@ module at boot time, place the following .Bd -literal -offset indent if_iwn_load="YES" iwn1000fw_load="YES" +iwn105fw_load="YES" +iwn135fw_load="YES" iwn2000fw_load="YES" iwn2030fw_load="YES" iwn4965fw_load="YES" Modified: head/share/man/man4/iwnfw.4 ============================================================================== --- head/share/man/man4/iwnfw.4 Thu Aug 14 18:57:46 2014 (r269998) +++ head/share/man/man4/iwnfw.4 Thu Aug 14 19:14:24 2014 (r269999) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2014 +.Dd August 14, 2014 .Dt IWNFW 4 .Os .Sh NAME @@ -36,11 +36,15 @@ kernel configuration file: .Cd "device iwnfw" .Ed .Pp -This will include three firmware images inside the kernel. +This will include firmware images for all +.Xr iwn 4 +devices inside the kernel. If you want to pick only the firmware image for your network adapter choose one of the following: .Bd -ragged -offset indent .Cd "device iwn1000fw" +.Cd "device iwn105fw" +.Cd "device iwn135fw" .Cd "device iwn2000fw" .Cd "device iwn2030fw" .Cd "device iwn4965fw" @@ -57,6 +61,8 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent iwn1000fw_load="YES" +iwn105fw_load="YES" +iwn135fw_load="YES" iwn2000fw_load="YES" iwn2030fw_load="YES" iwn4965fw_load="YES" @@ -69,7 +75,7 @@ iwn6050fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Wireless WiFi Link 1000, 2000, 2030, 4965, 5000 and 6000 series of +Intel Wireless WiFi Link 105, 135, 1000, 2000, 2030, 4965, 5000 and 6000 series of IEEE 802.11n adapters. It may be statically linked into the kernel, or loaded as a module. From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 19:15:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7E718E5; Thu, 14 Aug 2014 19:15:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4A682224; Thu, 14 Aug 2014 19:15:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EJFK0u056380; Thu, 14 Aug 2014 19:15:20 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EJFK5b056379; Thu, 14 Aug 2014 19:15:20 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408141915.s7EJFK5b056379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 14 Aug 2014 19:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270000 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 19:15:21 -0000 Author: gavin Date: Thu Aug 14 19:15:20 2014 New Revision: 270000 URL: http://svnweb.freebsd.org/changeset/base/270000 Log: Sync list of supported devices in the man page with the driver. MFC after: 1 week Modified: head/share/man/man4/iwn.4 Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Thu Aug 14 19:14:24 2014 (r269999) +++ head/share/man/man4/iwn.4 Thu Aug 14 19:15:20 2014 (r270000) @@ -93,11 +93,13 @@ driver provides support for: .It Intel Centrino Advanced-N 6200 .It Intel Centrino Advanced-N 6205 .It Intel Centrino Advanced-N 6230 +.It Intel Centrino Advanced-N 6235 .It Intel Centrino Advanced-N + WiMAX 6250 .It Intel Centrino Ultimate-N 6300 .It Intel Centrino Wireless-N 100 .It Intel Centrino Wireless-N 105 .It Intel Centrino Wireless-N 130 +.It Intel Centrino Wireless-N 135 .It Intel Centrino Wireless-N 1000 .It Intel Centrino Wireless-N 1030 .It Intel Centrino Wireless-N 2200 From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 19:22:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEBE0B3C; Thu, 14 Aug 2014 19:22:34 +0000 (UTC) Received: from mail-gw12.york.ac.uk (mail-gw12.york.ac.uk [144.32.129.162]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93F25240E; Thu, 14 Aug 2014 19:22:34 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.64.162]:41582) by mail-gw12.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1XI0bR-00057s-UO; Thu, 14 Aug 2014 20:22:25 +0100 Date: Thu, 14 Aug 2014 20:22:25 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Steve Kargl Subject: Re: svn commit: r269992 - in head/sys: amd64/conf i386/conf In-Reply-To: <20140814183831.GA98162@troutmask.apl.washington.edu> Message-ID: References: <201408141829.s7EITtZe033846@svn.freebsd.org> <20140814183831.GA98162@troutmask.apl.washington.edu> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 19:22:34 -0000 On Thu, 14 Aug 2014, Steve Kargl wrote: > On Thu, Aug 14, 2014 at 06:29:55PM +0000, Gavin Atkinson wrote: > > Author: gavin > > Date: Thu Aug 14 18:29:55 2014 > > New Revision: 269992 > > > > Log: > > Update i386/NOTES and amd64/NOTES files to contain the complete list of > > firmwares for iwn(4) and sort them. > > > 'man iwn' seems to be missing iwn105fw and iwn135fw. > I don't build or use modules, so I'm not sure if > these can be loaded as modules, but you need something > like [...] Thanks, I've just fixed this (unfortunately I committed the changes before seeing your email, otherwise I would have credited you). Gavin From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 22:01:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D8BDB4A; Thu, 14 Aug 2014 22:01:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E922BBC; Thu, 14 Aug 2014 20:20:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EKKNQT085510; Thu, 14 Aug 2014 20:20:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EKKMP5085498; Thu, 14 Aug 2014 20:20:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201408142020.s7EKKMP5085498@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 Aug 2014 20:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270002 - in stable/10: include 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 22:01:28 -0000 Author: jhb Date: Thu Aug 14 20:20:21 2014 New Revision: 270002 URL: http://svnweb.freebsd.org/changeset/base/270002 Log: MFC 268531,269079,269204: Fix various edge cases with rewinddir(), seekdir(), and telldir(): - In the unionfs case, opendir() and fdopendir() read the directory's full contents and cache it. This cache is not refreshed when rewinddir() is called, so rewinddir() will not notice updates to a directory. Fix this by splitting the code to fetch a directory's contents out of __opendir_common() into a new _filldir() function and call this from rewinddir() when operating on a unionfs directory. - If rewinddir() is called on a directory opened with fdopendir() before any directory entries are fetched, rewinddir() will not adjust the seek location of the backing file descriptor. If the file descriptor passed to fdopendir() had a non-zero offset, the rewinddir() will not rewind to the beginning. Fix this by always seeking back to 0 in rewinddir(). This means the dd_rewind hack can also be removed. - Add missing locking to rewinddir() - POSIX says that passing a location returned by telldir() to seekdir() after an intervening call to rewinddir() is undefined, so reclaim any pending telldir() cookies in the directory when rewinddir() is called. - If telldir() is called immediately after a call to seekdir(), POSIX requires the return value of telldir() to equal the value passed to seekdir(). The current seekdir code with SINGLEUSE enabled breaks this case as each call to telldir() allocates a new cookie. Instead, remove the SINGLEUSE code and change telldir() to look for an existing cookie for the directory's current location rather than always creating a new cookie. PR: 121656 Modified: stable/10/include/dirent.h stable/10/lib/libc/gen/directory.3 stable/10/lib/libc/gen/gen-private.h stable/10/lib/libc/gen/opendir.c stable/10/lib/libc/gen/readdir.c stable/10/lib/libc/gen/rewinddir.c stable/10/lib/libc/gen/telldir.c stable/10/lib/libc/gen/telldir.h Directory Properties: stable/10/ (props changed) Modified: stable/10/include/dirent.h ============================================================================== --- stable/10/include/dirent.h Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/include/dirent.h Thu Aug 14 20:20:21 2014 (r270002) @@ -63,6 +63,7 @@ typedef struct _dirdesc DIR; #define DTF_NODUP 0x0002 /* don't return duplicate names */ #define DTF_REWIND 0x0004 /* rewind after reading union stack */ #define __DTF_READALL 0x0008 /* everything has been read */ +#define __DTF_SKIPREAD 0x0010 /* assume internal buffer is populated */ #else /* !__BSD_VISIBLE */ Modified: stable/10/lib/libc/gen/directory.3 ============================================================================== --- stable/10/lib/libc/gen/directory.3 Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/directory.3 Thu Aug 14 20:20:21 2014 (r270002) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 18, 2013 +.Dd July 28, 2014 .Dt DIRECTORY 3 .Os .Sh NAME @@ -169,6 +169,10 @@ If the directory is closed and then reopened, prior values returned by .Fn telldir will no longer be valid. +Values returned by +.Fn telldir +are also invalidated by a call to +.Fn rewinddir . .Pp The .Fn seekdir @@ -182,13 +186,6 @@ The new position reverts to the one asso when the .Fn telldir operation was performed. -State associated with the token returned by -.Fn telldir is freed when it is passed to -.Fn seekdir . -If you wish return to the same location again, -then you must create a new token with another -.Fn telldir -call. .Pp The .Fn rewinddir Modified: stable/10/lib/libc/gen/gen-private.h ============================================================================== --- stable/10/lib/libc/gen/gen-private.h Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/gen-private.h Thu Aug 14 20:20:21 2014 (r270002) @@ -48,7 +48,6 @@ struct _dirdesc { char *dd_buf; /* data buffer */ int dd_len; /* size of data buffer */ long dd_seek; /* magic cookie returned by getdirentries */ - long dd_rewind; /* magic cookie for rewinding */ int dd_flags; /* flags for readdir */ struct pthread_mutex *dd_lock; /* lock */ struct _telldir *dd_td; /* telldir position recording */ Modified: stable/10/lib/libc/gen/opendir.c ============================================================================== --- stable/10/lib/libc/gen/opendir.c Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/opendir.c Thu Aug 14 20:20:21 2014 (r270002) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "gen-private.h" #include "telldir.h" -static DIR * __opendir_common(int, int); +static DIR * __opendir_common(int, int, bool); /* * Open a directory. @@ -67,18 +67,10 @@ opendir(const char *name) DIR * fdopendir(int fd) { - struct stat statb; - /* Check that fd is associated with a directory. */ - if (_fstat(fd, &statb) != 0) - return (NULL); - if (!S_ISDIR(statb.st_mode)) { - errno = ENOTDIR; - return (NULL); - } if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) return (NULL); - return (__opendir_common(fd, DTF_HIDEW|DTF_NODUP)); + return (__opendir_common(fd, DTF_HIDEW|DTF_NODUP, true)); } DIR * @@ -88,11 +80,13 @@ __opendir2(const char *name, int flags) DIR *dir; int saved_errno; + if ((flags & (__DTF_READALL | __DTF_SKIPREAD)) != 0) + return (NULL); if ((fd = _open(name, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) return (NULL); - dir = __opendir_common(fd, flags); + dir = __opendir_common(fd, flags, false); if (dir == NULL) { saved_errno = errno; _close(fd); @@ -110,22 +104,195 @@ opendir_compar(const void *p1, const voi } /* + * For a directory at the top of a unionfs stack, the entire directory's + * contents are read and cached locally until the next call to rewinddir(). + * For the fdopendir() case, the initial seek position must be preserved. + * For rewinddir(), the full directory should always be re-read from the + * beginning. + * + * If an error occurs, the existing buffer and state of 'dirp' is left + * unchanged. + */ +bool +_filldir(DIR *dirp, bool use_current_pos) +{ + struct dirent **dpv; + char *buf, *ddptr, *ddeptr; + off_t pos; + int fd2, incr, len, n, saved_errno, space; + + len = 0; + space = 0; + buf = NULL; + ddptr = NULL; + + /* + * Use the system page size if that is a multiple of DIRBLKSIZ. + * Hopefully this can be a big win someday by allowing page + * trades to user space to be done by _getdirentries(). + */ + incr = getpagesize(); + if ((incr % DIRBLKSIZ) != 0) + incr = DIRBLKSIZ; + + /* + * The strategy here is to read all the directory + * entries into a buffer, sort the buffer, and + * remove duplicate entries by setting the inode + * number to zero. + * + * We reopen the directory because _getdirentries() + * on a MNT_UNION mount modifies the open directory, + * making it refer to the lower directory after the + * upper directory's entries are exhausted. + * This would otherwise break software that uses + * the directory descriptor for fchdir or *at + * functions, such as fts.c. + */ + if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) + return (false); + + if (use_current_pos) { + pos = lseek(dirp->dd_fd, 0, SEEK_CUR); + if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } + + do { + /* + * Always make at least DIRBLKSIZ bytes + * available to _getdirentries + */ + if (space < DIRBLKSIZ) { + space += incr; + len += incr; + buf = reallocf(buf, len); + if (buf == NULL) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + ddptr = buf + (len - space); + } + + n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); + if (n > 0) { + ddptr += n; + space -= n; + } + if (n < 0) { + saved_errno = errno; + _close(fd2); + errno = saved_errno; + return (false); + } + } while (n > 0); + _close(fd2); + + ddeptr = ddptr; + + /* + * There is now a buffer full of (possibly) duplicate + * names. + */ + dirp->dd_buf = buf; + + /* + * Go round this loop twice... + * + * Scan through the buffer, counting entries. + * On the second pass, save pointers to each one. + * Then sort the pointers and remove duplicate names. + */ + for (dpv = 0;;) { + n = 0; + ddptr = buf; + while (ddptr < ddeptr) { + struct dirent *dp; + + dp = (struct dirent *) ddptr; + if ((long)dp & 03L) + break; + if ((dp->d_reclen <= 0) || + (dp->d_reclen > (ddeptr + 1 - ddptr))) + break; + ddptr += dp->d_reclen; + if (dp->d_fileno) { + if (dpv) + dpv[n] = dp; + n++; + } + } + + if (dpv) { + struct dirent *xp; + + /* + * This sort must be stable. + */ + mergesort(dpv, n, sizeof(*dpv), opendir_compar); + + dpv[n] = NULL; + xp = NULL; + + /* + * Scan through the buffer in sort order, + * zapping the inode number of any + * duplicate names. + */ + for (n = 0; dpv[n]; n++) { + struct dirent *dp = dpv[n]; + + if ((xp == NULL) || + strcmp(dp->d_name, xp->d_name)) { + xp = dp; + } else { + dp->d_fileno = 0; + } + if (dp->d_type == DT_WHT && + (dirp->dd_flags & DTF_HIDEW)) + dp->d_fileno = 0; + } + + free(dpv); + break; + } else { + dpv = malloc((n+1) * sizeof(struct dirent *)); + if (dpv == NULL) + break; + } + } + + dirp->dd_len = len; + dirp->dd_size = ddptr - dirp->dd_buf; + return (true); +} + + +/* * Common routine for opendir(3), __opendir2(3) and fdopendir(3). */ static DIR * -__opendir_common(int fd, int flags) +__opendir_common(int fd, int flags, bool use_current_pos) { DIR *dirp; int incr; int saved_errno; int unionstack; - int fd2; - - fd2 = -1; if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) return (NULL); + dirp->dd_buf = NULL; + dirp->dd_fd = fd; + dirp->dd_flags = flags; + dirp->dd_loc = 0; + dirp->dd_lock = NULL; dirp->dd_td = (struct _telldir *)((char *)dirp + sizeof(DIR)); LIST_INIT(&dirp->dd_td->td_locq); dirp->dd_td->td_loccnt = 0; @@ -154,163 +321,39 @@ __opendir_common(int fd, int flags) } if (unionstack) { - int len = 0; - int space = 0; - char *buf = 0; - char *ddptr = 0; - char *ddeptr; - int n; - struct dirent **dpv; - - /* - * The strategy here is to read all the directory - * entries into a buffer, sort the buffer, and - * remove duplicate entries by setting the inode - * number to zero. - * - * We reopen the directory because _getdirentries() - * on a MNT_UNION mount modifies the open directory, - * making it refer to the lower directory after the - * upper directory's entries are exhausted. - * This would otherwise break software that uses - * the directory descriptor for fchdir or *at - * functions, such as fts.c. - */ - if ((fd2 = _openat(fd, ".", O_RDONLY | O_CLOEXEC)) == -1) { - saved_errno = errno; - free(buf); - free(dirp); - errno = saved_errno; - return (NULL); - } - - do { - /* - * Always make at least DIRBLKSIZ bytes - * available to _getdirentries - */ - if (space < DIRBLKSIZ) { - space += incr; - len += incr; - buf = reallocf(buf, len); - if (buf == NULL) - goto fail; - ddptr = buf + (len - space); - } - - n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); - if (n > 0) { - ddptr += n; - space -= n; - } - } while (n > 0); - - ddeptr = ddptr; - flags |= __DTF_READALL; - - _close(fd2); - fd2 = -1; - - /* - * There is now a buffer full of (possibly) duplicate - * names. - */ - dirp->dd_buf = buf; - - /* - * Go round this loop twice... - * - * Scan through the buffer, counting entries. - * On the second pass, save pointers to each one. - * Then sort the pointers and remove duplicate names. - */ - for (dpv = 0;;) { - n = 0; - ddptr = buf; - while (ddptr < ddeptr) { - struct dirent *dp; - - dp = (struct dirent *) ddptr; - if ((long)dp & 03L) - break; - if ((dp->d_reclen <= 0) || - (dp->d_reclen > (ddeptr + 1 - ddptr))) - break; - ddptr += dp->d_reclen; - if (dp->d_fileno) { - if (dpv) - dpv[n] = dp; - n++; - } - } - - if (dpv) { - struct dirent *xp; - - /* - * This sort must be stable. - */ - mergesort(dpv, n, sizeof(*dpv), - opendir_compar); - - dpv[n] = NULL; - xp = NULL; - - /* - * Scan through the buffer in sort order, - * zapping the inode number of any - * duplicate names. - */ - for (n = 0; dpv[n]; n++) { - struct dirent *dp = dpv[n]; - - if ((xp == NULL) || - strcmp(dp->d_name, xp->d_name)) { - xp = dp; - } else { - dp->d_fileno = 0; - } - if (dp->d_type == DT_WHT && - (flags & DTF_HIDEW)) - dp->d_fileno = 0; - } - - free(dpv); - break; - } else { - dpv = malloc((n+1) * sizeof(struct dirent *)); - if (dpv == NULL) - break; - } - } - - dirp->dd_len = len; - dirp->dd_size = ddptr - dirp->dd_buf; + if (!_filldir(dirp, use_current_pos)) + goto fail; + dirp->dd_flags |= __DTF_READALL; } else { dirp->dd_len = incr; - dirp->dd_size = 0; dirp->dd_buf = malloc(dirp->dd_len); if (dirp->dd_buf == NULL) goto fail; - dirp->dd_seek = 0; + if (use_current_pos) { + /* + * Read the first batch of directory entries + * to prime dd_seek. This also checks if the + * fd passed to fdopendir() is a directory. + */ + dirp->dd_size = _getdirentries(dirp->dd_fd, + dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); + if (dirp->dd_size < 0) { + if (errno == EINVAL) + errno = ENOTDIR; + goto fail; + } + dirp->dd_flags |= __DTF_SKIPREAD; + } else { + dirp->dd_size = 0; + dirp->dd_seek = 0; + } } - dirp->dd_loc = 0; - dirp->dd_fd = fd; - dirp->dd_flags = flags; - dirp->dd_lock = NULL; - - /* - * Set up seek point for rewinddir. - */ - dirp->dd_rewind = telldir(dirp); - return (dirp); fail: saved_errno = errno; - if (fd2 != -1) - _close(fd2); + free(dirp->dd_buf); free(dirp); errno = saved_errno; return (NULL); Modified: stable/10/lib/libc/gen/readdir.c ============================================================================== --- stable/10/lib/libc/gen/readdir.c Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/readdir.c Thu Aug 14 20:20:21 2014 (r270002) @@ -61,12 +61,14 @@ _readdir_unlocked(dirp, skip) return (NULL); dirp->dd_loc = 0; } - if (dirp->dd_loc == 0 && !(dirp->dd_flags & __DTF_READALL)) { + if (dirp->dd_loc == 0 && + !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { dirp->dd_size = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); if (dirp->dd_size <= 0) return (NULL); } + dirp->dd_flags &= ~__DTF_SKIPREAD; dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); if ((long)dp & 03L) /* bogus pointer check */ return (NULL); Modified: stable/10/lib/libc/gen/rewinddir.c ============================================================================== --- stable/10/lib/libc/gen/rewinddir.c Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/rewinddir.c Thu Aug 14 20:20:21 2014 (r270002) @@ -33,9 +33,14 @@ static char sccsid[] = "@(#)rewinddir.c #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" #include "gen-private.h" #include "telldir.h" @@ -44,6 +49,16 @@ rewinddir(dirp) DIR *dirp; { - _seekdir(dirp, dirp->dd_rewind); - dirp->dd_rewind = telldir(dirp); + if (__isthreaded) + _pthread_mutex_lock(&dirp->dd_lock); + if (dirp->dd_flags & __DTF_READALL) + _filldir(dirp, false); + else if (dirp->dd_seek != 0) { + (void) lseek(dirp->dd_fd, 0, SEEK_SET); + dirp->dd_seek = 0; + } + dirp->dd_loc = 0; + _reclaim_telldir(dirp); + if (__isthreaded) + _pthread_mutex_unlock(&dirp->dd_lock); } Modified: stable/10/lib/libc/gen/telldir.c ============================================================================== --- stable/10/lib/libc/gen/telldir.c Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/telldir.c Thu Aug 14 20:20:21 2014 (r270002) @@ -47,13 +47,6 @@ __FBSDID("$FreeBSD$"); #include "telldir.h" /* - * The option SINGLEUSE may be defined to say that a telldir - * cookie may be used only once before it is freed. This option - * is used to avoid having memory usage grow without bound. - */ -#define SINGLEUSE - -/* * return a pointer into a directory */ long @@ -61,18 +54,31 @@ telldir(dirp) DIR *dirp; { struct ddloc *lp; + long idx; - if ((lp = (struct ddloc *)malloc(sizeof(struct ddloc))) == NULL) - return (-1); if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); - lp->loc_index = dirp->dd_td->td_loccnt++; - lp->loc_seek = dirp->dd_seek; - lp->loc_loc = dirp->dd_loc; - LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); + LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { + if (lp->loc_seek == dirp->dd_seek && + lp->loc_loc == dirp->dd_loc) + break; + } + if (lp == NULL) { + lp = malloc(sizeof(struct ddloc)); + if (lp == NULL) { + if (__isthreaded) + _pthread_mutex_unlock(&dirp->dd_lock); + return (-1); + } + lp->loc_index = dirp->dd_td->td_loccnt++; + lp->loc_seek = dirp->dd_seek; + lp->loc_loc = dirp->dd_loc; + LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); + } + idx = lp->loc_index; if (__isthreaded) _pthread_mutex_unlock(&dirp->dd_lock); - return (lp->loc_index); + return (idx); } /* @@ -94,7 +100,7 @@ _seekdir(dirp, loc) if (lp == NULL) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) - goto found; + return; (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); dirp->dd_seek = lp->loc_seek; dirp->dd_loc = 0; @@ -103,11 +109,6 @@ _seekdir(dirp, loc) if (dp == NULL) break; } -found: -#ifdef SINGLEUSE - LIST_REMOVE(lp, loc_lqe); - free((caddr_t)lp); -#endif } /* Modified: stable/10/lib/libc/gen/telldir.h ============================================================================== --- stable/10/lib/libc/gen/telldir.h Thu Aug 14 20:17:23 2014 (r270001) +++ stable/10/lib/libc/gen/telldir.h Thu Aug 14 20:20:21 2014 (r270002) @@ -36,6 +36,7 @@ #define _TELLDIR_H_ #include +#include /* * One of these structures is malloced to describe the current directory @@ -59,6 +60,7 @@ struct _telldir { long td_loccnt; /* index of entry for sequential readdir's */ }; +bool _filldir(DIR *, bool); struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 22:33:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04180FEE; Thu, 14 Aug 2014 22:33:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E22324BA0; Thu, 14 Aug 2014 22:33:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EMXv3V050768; Thu, 14 Aug 2014 22:33:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EMXurT050762; Thu, 14 Aug 2014 22:33:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201408142233.s7EMXurT050762@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 14 Aug 2014 22:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270004 - in head: etc/mtree sbin/devd sbin/devd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 22:33:58 -0000 Author: asomers Date: Thu Aug 14 22:33:56 2014 New Revision: 270004 URL: http://svnweb.freebsd.org/changeset/base/270004 Log: Convert devd's client socket to type SOCK_SEQPACKET. This change consists of two merges from projects/zfsd/head along with the addition of an ATF test case for the new functionality. sbin/devd/tests/Makefile sbin/devd/tests/client_test.c Add ATF test cases for reading events from both devd socket types. r266519: sbin/devd/devd.8 sbin/devd/devd.cc Create a new socket, of type SOCK_SEQPACKET, for communicating with clients. SOCK_SEQPACKET sockets preserve record boundaries, simplying code in the client. The old SOCK_STREAM socket is retained for backwards-compatibility with existing clients. r269993: sbin/devd/devd.8 Fix grammar bug. CR: https://reviews.freebsd.org/rS266519 MFC after: 5 days Sponsored by: Spectra Logic Added: head/sbin/devd/tests/ head/sbin/devd/tests/Makefile (contents, props changed) head/sbin/devd/tests/client_test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/devd/Makefile head/sbin/devd/devd.8 head/sbin/devd/devd.cc Directory Properties: head/ (props changed) head/sbin/ (props changed) Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Aug 14 21:43:20 2014 (r270003) +++ head/etc/mtree/BSD.tests.dist Thu Aug 14 22:33:56 2014 (r270004) @@ -105,6 +105,8 @@ sbin dhclient .. + devd + .. growfs .. mdconfig Modified: head/sbin/devd/Makefile ============================================================================== --- head/sbin/devd/Makefile Thu Aug 14 21:43:20 2014 (r270003) +++ head/sbin/devd/Makefile Thu Aug 14 22:33:56 2014 (r270004) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=devd SRCS= devd.cc token.l parse.y y.tab.h MAN= devd.8 devd.conf.5 @@ -16,4 +18,8 @@ CFLAGS+=-I. -I${.CURDIR} CLEANFILES= y.output +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/sbin/devd/devd.8 ============================================================================== --- head/sbin/devd/devd.8 Thu Aug 14 21:43:20 2014 (r270003) +++ head/sbin/devd/devd.8 Thu Aug 14 22:33:56 2014 (r270004) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2013 +.Dd August 14, 2014 .Dt DEVD 8 .Os .Sh NAME @@ -55,9 +55,7 @@ If option .Fl f is specified more than once, the last file specified is used. .It Fl l Ar num -Limit concurrent -.Pa /var/run/devd.pipe -connections to +Limit concurrent socket connections to .Ar num . The default connection limit is 10. .It Fl n @@ -130,22 +128,27 @@ wish to hook into the system without modifying the user's other config files. .Pp -All messages that +Since +.Xr devctl 4 +allows only one active reader, .Nm -receives are forwarded to the +multiplexes it, forwarding all events to any number of connected clients. +Clients connect by opening the SOCK_SEQPACKET .Ux domain socket at -.Pa /var/run/devd.pipe . +.Pa /var/run/devd.seqpacket.pipe . .Sh FILES -.Bl -tag -width ".Pa /var/run/devd.pipe" -compact +.Bl -tag -width ".Pa /var/run/devd.seqpacket.pipe" -compact .It Pa /etc/devd.conf The default .Nm configuration file. -.It Pa /var/run/devd.pipe +.It Pa /var/run/devd.seqpacket.pipe The socket used by .Nm to communicate with its clients. +.It Pa /var/run/devd.pipe +A deprecated socket retained for use with old clients. .El .Sh SEE ALSO .Xr devctl 4 , Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Aug 14 21:43:20 2014 (r270003) +++ head/sbin/devd/devd.cc Thu Aug 14 22:33:56 2014 (r270004) @@ -100,7 +100,8 @@ __FBSDID("$FreeBSD$"); #include "devd.h" /* C compatible definitions */ #include "devd.hh" /* C++ class definitions */ -#define PIPE "/var/run/devd.pipe" +#define STREAMPIPE "/var/run/devd.pipe" +#define SEQPACKETPIPE "/var/run/devd.seqpacket.pipe" #define CF "/etc/devd.conf" #define SYSCTL "hw.bus.devctl_queue" @@ -119,6 +120,11 @@ __FBSDID("$FreeBSD$"); using namespace std; +typedef struct client { + int fd; + int socktype; +} client_t; + extern FILE *yyin; extern int lineno; @@ -822,12 +828,12 @@ process_event(char *buffer) } int -create_socket(const char *name) +create_socket(const char *name, int socktype) { int fd, slen; struct sockaddr_un sun; - if ((fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) + if ((fd = socket(PF_LOCAL, socktype, 0)) < 0) err(1, "socket"); bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; @@ -846,12 +852,13 @@ create_socket(const char *name) unsigned int max_clients = 10; /* Default, can be overriden on cmdline. */ unsigned int num_clients; -list clients; + +list clients; void notify_clients(const char *data, int len) { - list::iterator i; + list::iterator i; /* * Deliver the data to all clients. Throw clients overboard at the @@ -861,11 +868,17 @@ notify_clients(const char *data, int len * kernel memory or tie up the limited number of available connections). */ for (i = clients.begin(); i != clients.end(); ) { - if (write(*i, data, len) != len) { + int flags; + if (i->socktype == SOCK_SEQPACKET) + flags = MSG_EOR; + else + flags = 0; + + if (send(i->fd, data, len, flags) != len) { --num_clients; - close(*i); + close(i->fd); i = clients.erase(i); - devdlog(LOG_WARNING, "notify_clients: write() failed; " + devdlog(LOG_WARNING, "notify_clients: send() failed; " "dropping unresponsive client\n"); } else ++i; @@ -877,7 +890,7 @@ check_clients(void) { int s; struct pollfd pfd; - list::iterator i; + list::iterator i; /* * Check all existing clients to see if any of them have disappeared. @@ -888,12 +901,12 @@ check_clients(void) */ pfd.events = 0; for (i = clients.begin(); i != clients.end(); ) { - pfd.fd = *i; + pfd.fd = i->fd; s = poll(&pfd, 1, 0); if ((s < 0 && s != EINTR ) || (s > 0 && (pfd.revents & POLLHUP))) { --num_clients; - close(*i); + close(i->fd); i = clients.erase(i); devdlog(LOG_NOTICE, "check_clients: " "dropping disconnected client\n"); @@ -903,9 +916,9 @@ check_clients(void) } void -new_client(int fd) +new_client(int fd, int socktype) { - int s; + client_t s; int sndbuf_size; /* @@ -914,13 +927,14 @@ new_client(int fd) * by sending large buffers full of data we'll never read. */ check_clients(); - s = accept(fd, NULL, NULL); - if (s != -1) { + s.socktype = socktype; + s.fd = accept(fd, NULL, NULL); + if (s.fd != -1) { sndbuf_size = CLIENT_BUFSIZE; - if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, + if (setsockopt(s.fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, sizeof(sndbuf_size))) err(1, "setsockopt"); - shutdown(s, SHUT_RD); + shutdown(s.fd, SHUT_RD); clients.push_back(s); ++num_clients; } else @@ -934,7 +948,7 @@ event_loop(void) int fd; char buffer[DEVCTL_MAXBUF]; int once = 0; - int server_fd, max_fd; + int stream_fd, seqpacket_fd, max_fd; int accepting; timeval tv; fd_set fds; @@ -942,9 +956,10 @@ event_loop(void) fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC); if (fd == -1) err(1, "Can't open devctl device %s", PATH_DEVCTL); - server_fd = create_socket(PIPE); + stream_fd = create_socket(STREAMPIPE, SOCK_STREAM); + seqpacket_fd = create_socket(SEQPACKETPIPE, SOCK_SEQPACKET); accepting = 1; - max_fd = max(fd, server_fd) + 1; + max_fd = max(fd, max(stream_fd, seqpacket_fd)) + 1; while (!romeo_must_die) { if (!once && !no_daemon && !daemonize_quick) { // Check to see if we have any events pending. @@ -965,24 +980,28 @@ event_loop(void) } /* * When we've already got the max number of clients, stop - * accepting new connections (don't put server_fd in the set), - * shrink the accept() queue to reject connections quickly, and - * poll the existing clients more often, so that we notice more - * quickly when any of them disappear to free up client slots. + * accepting new connections (don't put the listening sockets in + * the set), shrink the accept() queue to reject connections + * quickly, and poll the existing clients more often, so that we + * notice more quickly when any of them disappear to free up + * client slots. */ FD_ZERO(&fds); FD_SET(fd, &fds); if (num_clients < max_clients) { if (!accepting) { - listen(server_fd, max_clients); + listen(stream_fd, max_clients); + listen(seqpacket_fd, max_clients); accepting = 1; } - FD_SET(server_fd, &fds); + FD_SET(stream_fd, &fds); + FD_SET(seqpacket_fd, &fds); tv.tv_sec = 60; tv.tv_usec = 0; } else { if (accepting) { - listen(server_fd, 0); + listen(stream_fd, 0); + listen(seqpacket_fd, 0); accepting = 0; } tv.tv_sec = 2; @@ -1022,8 +1041,14 @@ event_loop(void) break; } } - if (FD_ISSET(server_fd, &fds)) - new_client(server_fd); + if (FD_ISSET(stream_fd, &fds)) + new_client(stream_fd, SOCK_STREAM); + /* + * Aside from the socket type, both sockets use the same + * protocol, so we can process clients the same way. + */ + if (FD_ISSET(seqpacket_fd, &fds)) + new_client(seqpacket_fd, SOCK_SEQPACKET); } close(fd); } Added: head/sbin/devd/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/devd/tests/Makefile Thu Aug 14 22:33:56 2014 (r270004) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/devd + +ATF_TESTS_C= client_test +TEST_METADATA.client_test= required_programs="devd" +TEST_METADATA.client_test+= required_user="root" +TEST_METADATA.client_test+= timeout=15 + +WARNS?= 5 + +.include Added: head/sbin/devd/tests/client_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/devd/tests/client_test.c Thu Aug 14 22:33:56 2014 (r270004) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2014 Spectra Logic Corporation. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#include +/* Helper functions*/ + +/* + * Create two devd events. The easiest way I know of, that requires no special + * hardware, is to create md(4) devices. + */ +static void +create_two_events(void) +{ + FILE *create_stdout; + FILE *destroy_stdout; + char mdname[80]; + char destroy_cmd[80]; + char *error; + + create_stdout = popen("mdconfig -a -s 64 -t null", "r"); + ATF_REQUIRE(create_stdout != NULL); + error = fgets(mdname, sizeof(mdname), create_stdout); + ATF_REQUIRE(error != NULL); + /* We only expect one line of output */ + ATF_REQUIRE_EQ(0, pclose(create_stdout)); + + snprintf(destroy_cmd, nitems(destroy_cmd), "mdconfig -d -u %s", mdname); + destroy_stdout = popen(destroy_cmd, "r"); + /* We expect no output */ + ATF_REQUIRE_EQ(0, pclose(destroy_stdout)); +} + +/* + * Test Cases + */ + +/* + * Open a client connection to devd, create some events, and test that they can + * be read _whole_ and _one_at_a_time_ from the socket + */ +ATF_TC_WITHOUT_HEAD(seqpacket); +ATF_TC_BODY(seqpacket, tc) +{ + int s; + int error; + struct sockaddr_un devd_addr; + bool got_create_event = false; + bool got_destroy_event = false; + const char create_pat[] = + "!system=DEVFS subsystem=CDEV type=CREATE cdev=md"; + const char destroy_pat[] = + "!system=DEVFS subsystem=CDEV type=DESTROY cdev=md"; + + memset(&devd_addr, 0, sizeof(devd_addr)); + devd_addr.sun_family = PF_LOCAL; + strlcpy(devd_addr.sun_path, "/var/run/devd.seqpacket.pipe", + sizeof(devd_addr.sun_path)); + + s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + ATF_REQUIRE(s >= 0); + error = connect(s, (struct sockaddr*)&devd_addr, SUN_LEN(&devd_addr)); + ATF_REQUIRE_EQ(0, error); + + create_two_events(); + + /* + * Loop until both events are detected on _different_ reads + * There may be extra events due to unrelated system activity + * If we never get both events, then the test will timeout. + */ + while (!(got_create_event && got_destroy_event)) { + int cmp; + ssize_t len; + char event[1024]; + + len = recv(s, event, sizeof(event), MSG_WAITALL); + ATF_REQUIRE(len != -1); + /* NULL terminate the result */ + event[len] = '\0'; + printf("%s", event); + cmp = strncmp(event, create_pat, sizeof(create_pat) - 1); + if (cmp == 0) + got_create_event = true; + + cmp = strncmp(event, destroy_pat, sizeof(destroy_pat) - 1); + if (cmp == 0) + got_destroy_event = true; + } +} + +/* + * Open a client connection to devd using the stream socket, create some + * events, and test that they can be read in any number of reads. + */ +ATF_TC_WITHOUT_HEAD(stream); +ATF_TC_BODY(stream, tc) +{ + int s; + int error; + struct sockaddr_un devd_addr; + bool got_create_event = false; + bool got_destroy_event = false; + const char create_pat[] = + "!system=DEVFS subsystem=CDEV type=CREATE cdev=md"; + const char destroy_pat[] = + "!system=DEVFS subsystem=CDEV type=DESTROY cdev=md"; + ssize_t len = 0; + + memset(&devd_addr, 0, sizeof(devd_addr)); + devd_addr.sun_family = PF_LOCAL; + strlcpy(devd_addr.sun_path, "/var/run/devd.pipe", + sizeof(devd_addr.sun_path)); + + s = socket(PF_LOCAL, SOCK_STREAM, 0); + ATF_REQUIRE(s >= 0); + error = connect(s, (struct sockaddr*)&devd_addr, SUN_LEN(&devd_addr)); + ATF_REQUIRE_EQ(0, error); + + create_two_events(); + + /* + * Loop until both events are detected on _different_ reads + * There may be extra events due to unrelated system activity + * If we never get both events, then the test will timeout. + */ + while (!(got_create_event && got_destroy_event)) { + char event[1024]; + ssize_t newlen; + char *create_pos, *destroy_pos; + + newlen = read(s, &event[len], sizeof(event) - len); + ATF_REQUIRE(newlen != -1); + len += newlen; + /* NULL terminate the result */ + event[newlen] = '\0'; + printf("%s", event); + + create_pos = strstr(event, create_pat); + if (create_pos != NULL); + got_create_event = true; + + destroy_pos = strstr(event, destroy_pat); + if (destroy_pos != NULL); + got_destroy_event = true; + + } +} + +/* + * Main. + */ + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, seqpacket); + ATF_TP_ADD_TC(tp, stream); + + return (atf_no_error()); +} + From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 22:47:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 558DE3B9; Thu, 14 Aug 2014 22:47:25 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 185B34C8C; Thu, 14 Aug 2014 22:47:24 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s7EMlIsP008197; Thu, 14 Aug 2014 17:47:18 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1nrys908br-1; Thu, 14 Aug 2014 17:47:17 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 20A2D460110; Thu, 14 Aug 2014 17:47:11 -0500 (CDT) Message-ID: <53ED3C6E.10204@rice.edu> Date: Thu, 14 Aug 2014 17:47:10 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: d@delphij.net, John-Mark Gurney , Xin LI Subject: Re: svn commit: r269963 - head/sys/kern References: <201408140513.s7E5DPRb069698@svn.freebsd.org> <20140814053518.GO83475@funkthat.com> <53EC560B.5000104@delphij.net> In-Reply-To: <53EC560B.5000104@delphij.net> X-Enigmail-Version: 1.6 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.248919945447816 urlsuspect_oldscore=0.248919945447816 suspectscore=13 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.248919945447816 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1408140260 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 22:47:25 -0000 On 08/14/2014 01:24, Xin Li wrote: > On 8/13/14 10:35 PM, John-Mark Gurney wrote: > > Xin LI wrote this message on Thu, Aug 14, 2014 at 05:13 +0000: > >> Author: delphij Date: Thu Aug 14 05:13:24 2014 New Revision: > >> 269963 URL: http://svnweb.freebsd.org/changeset/base/269963 > >> > >> Log: Re-instate UMA cached backend for 4K - 64K allocations. New > >> consumers like geli(4) uses malloc(9) to allocate temporary > >> buffers that gets free'ed shortly, causing frequent TLB shootdown > >> as observed in hwpmc supported flame graph. > > > Can we do even larger, like 128k for phys io sized blocks? > > Sure (Actually I'm running with 128k and 256k buckets enabled on my > own storage box; with r269964 we can easily add new buckets without > actually activating them by default). > > However, I'm relented to add them right now because the current > malloc(9) implementation would use the next bucket size, which is 2x > of the previous one, when the requested size is only a little bit > larger than the smaller chunk's size. In real world the larger bucket > could eat more memory than all smaller but greater than page-sized > bucket combined (the actual consumption is still small, though). > The current code already supports sizes that are not powers of 2. For example, with Index: kern/kern_malloc.c =================================================================== --- kern/kern_malloc.c (revision 269997) +++ kern/kern_malloc.c (working copy) @@ -152,8 +152,11 @@ struct { {2048, "2048", }, {4096, "4096", }, {8192, "8192", }, + {12228, "12228", }, {16384, "16384", }, + {24576, "24576", }, {32768, "32768", }, + {49152, "49152", }, {65536, "65536", }, {0, NULL}, }; I see ITEM SIZE LIMIT USED FREE REQ FAIL SLEEP UMA Kegs: 384, 0, 94, 6, 94, 0, 0 ... 16: 16, 0, 2501, 260, 36924, 0, 0 32: 32, 0, 2405, 470, 94881, 0, 0 64: 64, 0, 12480, 8042, 1365658, 0, 0 128: 128, 0, 12886, 26019, 211536, 0, 0 256: 256, 0, 5352, 2223, 463546, 0, 0 512: 512, 0, 2797, 7819, 46986, 0, 0 1024: 1024, 0, 70, 126, 89345, 0, 0 2048: 2048, 0, 2037, 1353, 168857, 0, 0 4096: 4096, 0, 289, 17, 108610, 0, 0 8192: 8192, 0, 26, 1, 323, 0, 0 12228: 12228, 0, 9, 0, 159, 0, 0 16384: 16384, 0, 4, 2, 97, 0, 0 24576: 24576, 0, 7, 2, 55, 0, 0 32768: 32768, 0, 1, 1, 34, 0, 0 49152: 49152, 0, 6, 1, 56, 0, 0 65536: 65536, 0, 8, 2, 784, 0, 0 after a few minutes of activity. > I think eventually the right way to go is to adopt more sophisticated > allocation strategy like the one used in jemalloc(3) and this > changeset is more-or-less temporary for now: I committed it mainly > because it eliminated a large portion of unwanted TLB shootdowns I > have observed with very reasonable overhead (a few megabytes of RAM). > > > geli can do allocations >128k, which could be broken into two > > parts, one in the <8k sized range and the other in 128k... > > Yes, this is another issue that I'd like to solve. > > From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 22:52:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C76BF5D7; Thu, 14 Aug 2014 22:52:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2DE54D3E; Thu, 14 Aug 2014 22:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7EMq5wK059576; Thu, 14 Aug 2014 22:52:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7EMq5GL059575; Thu, 14 Aug 2014 22:52:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201408142252.s7EMq5GL059575@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 14 Aug 2014 22:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270005 - head/usr.sbin/mountd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 22:52:05 -0000 Author: rmacklem Date: Thu Aug 14 22:52:05 2014 New Revision: 270005 URL: http://svnweb.freebsd.org/changeset/base/270005 Log: Try to clarify how file systems are exported for NFSv4. Suggested by: rcarter@pinyon.org MFC after: 1 week Modified: head/usr.sbin/mountd/exports.5 Modified: head/usr.sbin/mountd/exports.5 ============================================================================== --- head/usr.sbin/mountd/exports.5 Thu Aug 14 22:33:56 2014 (r270004) +++ head/usr.sbin/mountd/exports.5 Thu Aug 14 22:52:05 2014 (r270005) @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd December 23, 2012 +.Dd August 14, 2014 .Dt EXPORTS 5 .Os .Sh NAME @@ -91,10 +91,10 @@ option is used on Because NFSv4 does not use the mount protocol, the .Dq administrative controls -are not applied. -Thus, all the above export line(s) should be considered to have the +are not applied and all directories within this server +file system are mountable via NFSv4 even if the .Fl alldirs -flag, even if the line is specified without it. +flag has not been specified. The third form has the string ``V4:'' followed by a single absolute path name, to specify the NFSv4 tree root. This line does not export any file system, but simply marks where the root @@ -310,7 +310,8 @@ interface. For the third form which specifies the NFSv4 tree root, the directory path specifies the location within the server's file system tree which is the root of the NFSv4 tree. -All entries of this form must specify the same directory path. +There can only be one NFSv4 root directory per server. +As such, all entries of this form must specify the same directory path. For file systems other than ZFS, this location can be any directory and does not need to be within an exported file system. If it is not in an exported From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 23:17:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90556BDE; Thu, 14 Aug 2014 23:17:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 637664F4E; Thu, 14 Aug 2014 23:17:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7ENHYII069391; Thu, 14 Aug 2014 23:17:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7ENHYig069389; Thu, 14 Aug 2014 23:17:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408142317.s7ENHYig069389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 14 Aug 2014 23:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270006 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 23:17:34 -0000 Author: imp Date: Thu Aug 14 23:17:33 2014 New Revision: 270006 URL: http://svnweb.freebsd.org/changeset/base/270006 Log: Print the symbolic bit names for the status when we get a timeout. Modified: head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_mcireg.h Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Thu Aug 14 22:52:05 2014 (r270005) +++ head/sys/arm/at91/at91_mci.c Thu Aug 14 23:17:33 2014 (r270006) @@ -1210,8 +1210,8 @@ at91_mci_intr(void *arg) */ if (cmd->opcode != 8) { device_printf(sc->dev, - "IO error; status MCI_SR = 0x%x cmd opcode = %d%s\n", - sr, cmd->opcode, + "IO error; status MCI_SR = 0x%b cmd opcode = %d%s\n", + sr, MCI_SR_BITSTRING, cmd->opcode, (cmd->opcode != 12) ? "" : (sc->flags & CMD_MULTIREAD) ? " after read" : " after write"); at91_mci_reset(sc); Modified: head/sys/arm/at91/at91_mcireg.h ============================================================================== --- head/sys/arm/at91/at91_mcireg.h Thu Aug 14 22:52:05 2014 (r270005) +++ head/sys/arm/at91/at91_mcireg.h Thu Aug 14 23:17:33 2014 (r270006) @@ -118,6 +118,30 @@ #define MCI_SR_OVRE (0x1u << 30) /* (MCI) Overrun flag */ #define MCI_SR_UNRE (0x1u << 31) /* (MCI) Underrun flag */ +/* TXRDY,DTIP,ENDTX,TXBUFE,RTOE */ + +#define MCI_SR_BITSTRING \ + "\020" \ + "\001CMDRDY" \ + "\002RXRDY" \ + "\003TXRDY" \ + "\004BLKE" \ + "\005DTIP" \ + "\006NOTBUSY" \ + "\007ENDRX" \ + "\010ENDTX" \ + "\017RXBUFF" \ + "\020TXBUFE" \ + "\021RINDE" \ + "\022RDIRE" \ + "\023RCRCE" \ + "\024RENDE" \ + "\025RTOE" \ + "\026DCRCE" \ + "\027DTOE" \ + "\037OVRE" \ + "\040UNRE" + /* -------- MCI_IER : (MCI Offset: 0x44) MCI Interrupt Enable Register -------- */ /* -------- MCI_IDR : (MCI Offset: 0x48) MCI Interrupt Disable Register -------- */ /* -------- MCI_IMR : (MCI Offset: 0x4c) MCI Interrupt Mask Register -------- */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 14 23:38:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 232FE1C2; Thu, 14 Aug 2014 23:38:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E42B2140; Thu, 14 Aug 2014 23:38:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7ENc4Ag078343; Thu, 14 Aug 2014 23:38:04 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7ENc4kx078342; Thu, 14 Aug 2014 23:38:04 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201408142338.s7ENc4kx078342@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 14 Aug 2014 23:38: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: r270007 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 23:38:05 -0000 Author: mckusick Date: Thu Aug 14 23:38:04 2014 New Revision: 270007 URL: http://svnweb.freebsd.org/changeset/base/270007 Log: MFC of 269674: The journal is only prepared to handle full-size block numbers, so we have to adjust freeblk records to reflect the change to a full-size block. For example, suppose we have a block made up of fragments 8-15 and want to free its last two fragments. We are given a request that says: FREEBLK ino=5, blkno=14, lbn=0, frags=2, oldfrags=0 where frags are the number of frags to free and oldfrags are the number of fragments to keep. To block align it, we have to change it to have a valid full-size blkno, so it becomes: FREEBLK ino=5, blkno=8, lbn=0, frags=2, oldfrags=6 Submitted by: Mikihito Takehara Tested by: Mikihito Takehara Reviewed by: Jeff Roberson Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Thu Aug 14 23:17:33 2014 (r270006) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Thu Aug 14 23:38:04 2014 (r270007) @@ -931,6 +931,7 @@ static inline struct jsegdep *inoref_jse static struct jmvref *newjmvref(struct inode *, ino_t, off_t, off_t); static struct jfreeblk *newjfreeblk(struct freeblks *, ufs_lbn_t, ufs2_daddr_t, int); +static void adjust_newfreework(struct freeblks *, int); static struct jtrunc *newjtrunc(struct freeblks *, off_t, int); static void move_newblock_dep(struct jaddref *, struct inodedep *); static void cancel_jfreeblk(struct freeblks *, ufs2_daddr_t); @@ -4066,6 +4067,33 @@ newjfreeblk(freeblks, lbn, blkno, frags) } /* + * The journal is only prepared to handle full-size block numbers, so we + * have to adjust the record to reflect the change to a full-size block. + * For example, suppose we have a block made up of fragments 8-15 and + * want to free its last two fragments. We are given a request that says: + * FREEBLK ino=5, blkno=14, lbn=0, frags=2, oldfrags=0 + * where frags are the number of fragments to free and oldfrags are the + * number of fragments to keep. To block align it, we have to change it to + * have a valid full-size blkno, so it becomes: + * FREEBLK ino=5, blkno=8, lbn=0, frags=2, oldfrags=6 + */ +static void +adjust_newfreework(freeblks, frag_offset) + struct freeblks *freeblks; + int frag_offset; +{ + struct jfreeblk *jfreeblk; + + KASSERT((LIST_FIRST(&freeblks->fb_jblkdephd) != NULL && + LIST_FIRST(&freeblks->fb_jblkdephd)->jb_list.wk_type == D_JFREEBLK), + ("adjust_newfreework: Missing freeblks dependency")); + + jfreeblk = WK_JFREEBLK(LIST_FIRST(&freeblks->fb_jblkdephd)); + jfreeblk->jf_blkno -= frag_offset; + jfreeblk->jf_frags += frag_offset; +} + +/* * Allocate a new jtrunc to track a partial truncation. */ static struct jtrunc * @@ -6432,6 +6460,9 @@ softdep_journal_freeblocks(ip, cred, len blkno += numfrags(ip->i_fs, frags); newfreework(ump, freeblks, NULL, lastlbn, blkno, oldfrags, 0, needj); + if (needj) + adjust_newfreework(freeblks, + numfrags(ip->i_fs, frags)); } else if (blkno == 0) allocblock = 1; } From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 02:43:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C1D32B1; Fri, 15 Aug 2014 02:43:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56604242E; Fri, 15 Aug 2014 02:43:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7F2h6rg063324; Fri, 15 Aug 2014 02:43:06 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7F2h3P6063303; Fri, 15 Aug 2014 02:43:03 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201408150243.s7F2h3P6063303@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 15 Aug 2014 02:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270008 - in head/sys: net netinet netinet6 netipsec netpfil/pf sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 02:43:06 -0000 Author: kevlo Date: Fri Aug 15 02:43:02 2014 New Revision: 270008 URL: http://svnweb.freebsd.org/changeset/base/270008 Log: Change pr_output's prototype to avoid the need for explicit casts. This is a follow up to r269699. Phabric: D564 Reviewed by: jhb Modified: head/sys/net/if_gre.c head/sys/net/if_stf.c head/sys/net/rtsock.c head/sys/netinet/in_gif.c head/sys/netinet/ip_carp.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_var.h head/sys/netinet/raw_ip.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_mroute.c head/sys/netipsec/keysock.c head/sys/netipsec/keysock.h head/sys/netpfil/pf/if_pfsync.c head/sys/sys/protosw.h Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/net/if_gre.c Fri Aug 15 02:43:02 2014 (r270008) @@ -128,7 +128,7 @@ static const struct protosw in_gre_proto .pr_protocol = IPPROTO_GRE, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = gre_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctlinput = rip_ctlinput, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs @@ -139,7 +139,7 @@ static const struct protosw in_mobile_pr .pr_protocol = IPPROTO_MOBILE, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = gre_mobile_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctlinput = rip_ctlinput, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/net/if_stf.c Fri Aug 15 02:43:02 2014 (r270008) @@ -171,7 +171,7 @@ struct protosw in_stf_protosw = { .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = in_stf_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/net/rtsock.c Fri Aug 15 02:43:02 2014 (r270008) @@ -159,7 +159,7 @@ static int rt_xaddrs(caddr_t cp, caddr_t static int sysctl_dumpentry(struct radix_node *rn, void *vw); static int sysctl_iflist(int af, struct walkarg *w); static int sysctl_ifmalist(int af, struct walkarg *w); -static int route_output(struct mbuf *m, struct socket *so); +static int route_output(struct mbuf *m, struct socket *so, ...); static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out); static void rt_dispatch(struct mbuf *, sa_family_t); static struct sockaddr *rtsock_fix_netmask(struct sockaddr *dst, @@ -516,7 +516,7 @@ rtm_get_jailed(struct rt_addrinfo *info, /*ARGSUSED*/ static int -route_output(struct mbuf *m, struct socket *so) +route_output(struct mbuf *m, struct socket *so, ...) { struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet/in_gif.c Fri Aug 15 02:43:02 2014 (r270008) @@ -81,7 +81,7 @@ struct protosw in_gif_protosw = { .pr_protocol = 0/* IPPROTO_IPV[46] */, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = in_gif_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet/ip_carp.c Fri Aug 15 02:43:02 2014 (r270008) @@ -2054,7 +2054,7 @@ static struct protosw in_carp_protosw = .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; @@ -2068,7 +2068,7 @@ static struct protosw in6_carp_protosw = .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs }; Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet/ip_mroute.c Fri Aug 15 02:43:02 2014 (r270008) @@ -247,7 +247,7 @@ static const struct protosw in_pim_proto .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet/ip_var.h Fri Aug 15 02:43:02 2014 (r270008) @@ -235,7 +235,7 @@ void rip_init(void); void rip_destroy(void); #endif int rip_input(struct mbuf **, int *, int); -int rip_output(struct mbuf *, struct socket *, u_long); +int rip_output(struct mbuf *, struct socket *, ...); int ipip_input(struct mbuf **, int *, int); int rsvp_input(struct mbuf **, int *, int); int ip_rsvp_init(struct socket *); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet/raw_ip.c Fri Aug 15 02:43:02 2014 (r270008) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #endif /*IPSEC*/ +#include #include VNET_DEFINE(int, ip_defttl) = IPDEFTTL; @@ -426,14 +427,20 @@ rip_input(struct mbuf **mp, int *offp, i * have setup with control call. */ int -rip_output(struct mbuf *m, struct socket *so, u_long dst) +rip_output(struct mbuf *m, struct socket *so, ...) { struct ip *ip; int error; struct inpcb *inp = sotoinpcb(so); + va_list ap; + u_long dst; int flags = ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST; + va_start(ap, so); + dst = va_arg(ap, u_long); + va_end(ap); + /* * If the user handed us a complete IP packet, use it. Otherwise, * allocate an mbuf for a header and fill it in. Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet6/in6_gif.c Fri Aug 15 02:43:02 2014 (r270008) @@ -89,7 +89,7 @@ struct protosw in6_gif_protosw = { .pr_protocol = 0, /* IPPROTO_IPV[46] */ .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = in6_gif_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs }; Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet6/in6_proto.c Fri Aug 15 02:43:02 2014 (r270008) @@ -233,7 +233,7 @@ struct protosw inet6sw[] = { .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = rip6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, #ifndef INET /* Do not call initialization twice. */ @@ -247,7 +247,7 @@ struct protosw inet6sw[] = { .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_fasttimo = icmp6_fasttimo, @@ -312,7 +312,7 @@ struct protosw inet6sw[] = { .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_init = encap_init, .pr_usrreqs = &rip6_usrreqs @@ -324,7 +324,7 @@ struct protosw inet6sw[] = { .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_init = encap_init, .pr_usrreqs = &rip6_usrreqs @@ -335,7 +335,7 @@ struct protosw inet6sw[] = { .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs }, @@ -354,7 +354,7 @@ IP6PROTOSPACER, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = rip6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs }, Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netinet6/ip6_mroute.c Fri Aug 15 02:43:02 2014 (r270008) @@ -146,7 +146,7 @@ static const struct protosw in6_pim_prot .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, - .pr_output = (pr_output_t *)rip6_output, + .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs }; Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netipsec/keysock.c Fri Aug 15 02:43:02 2014 (r270008) @@ -88,7 +88,7 @@ VNET_PCPUSTAT_SYSUNINIT(pfkeystat); * key_output() */ int -key_output(struct mbuf *m, struct socket *so) +key_output(struct mbuf *m, struct socket *so, ...) { struct sadb_msg *msg; int len, error = 0; Modified: head/sys/netipsec/keysock.h ============================================================================== --- head/sys/netipsec/keysock.h Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netipsec/keysock.h Fri Aug 15 02:43:02 2014 (r270008) @@ -76,7 +76,7 @@ VNET_PCPUSTAT_DECLARE(struct pfkeystat, VNET_PCPUSTAT_ADD(struct pfkeystat, pfkeystat, name, (val)) #define PFKEYSTAT_INC(name) PFKEYSTAT_ADD(name, 1) -extern int key_output(struct mbuf *m, struct socket *so); +extern int key_output(struct mbuf *m, struct socket *so, ...); extern int key_usrreq __P((struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *)); Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/netpfil/pf/if_pfsync.c Fri Aug 15 02:43:02 2014 (r270008) @@ -2281,7 +2281,7 @@ static struct protosw in_pfsync_protosw .pr_protocol = IPPROTO_PFSYNC, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = pfsync_input, - .pr_output = (pr_output_t *)rip_output, + .pr_output = rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Thu Aug 14 23:38:04 2014 (r270007) +++ head/sys/sys/protosw.h Fri Aug 15 02:43:02 2014 (r270008) @@ -65,7 +65,7 @@ struct sockopt; */ /* USE THESE FOR YOUR PROTOTYPES ! */ typedef int pr_input_t (struct mbuf **, int*, int); -typedef int pr_output_t (struct mbuf *, struct socket *); +typedef int pr_output_t (struct mbuf *, struct socket *, ...); typedef void pr_ctlinput_t (int, struct sockaddr *, void *); typedef int pr_ctloutput_t (struct socket *, struct sockopt *); typedef void pr_init_t (void); From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 03:52:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A380CF4; Fri, 15 Aug 2014 03:52:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25A982D2D; Fri, 15 Aug 2014 03:52:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7F3qfDK001168; Fri, 15 Aug 2014 03:52:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7F3qfvi001167; Fri, 15 Aug 2014 03:52:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201408150352.s7F3qfvi001167@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 15 Aug 2014 03:52: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: r270009 - in stable: 10/sbin/ifconfig 9/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2014 03:52:41 -0000 Author: gjb Date: Fri Aug 15 03:52:40 2014 New Revision: 270009 URL: http://svnweb.freebsd.org/changeset/base/270009 Log: MFC r269888: Fix a typo in a comment: s/interprete/interpret/ Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/ifconfig/ifconfig.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/ifconfig/ifconfig.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.c Fri Aug 15 02:43:02 2014 (r270008) +++ stable/10/sbin/ifconfig/ifconfig.c Fri Aug 15 03:52:40 2014 (r270009) @@ -78,7 +78,7 @@ static const char rcsid[] = /* * Since "struct ifreq" is composed of various union members, callers - * should pay special attention to interprete the value. + * should pay special attention to interpret the value. * (.e.g. little/big endian difference in the structure.) */ struct ifreq ifr; From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 03:52:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C293CF5; Fri, 15 Aug 2014 03:52:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 779492D2E; Fri, 15 Aug 2014 03:52:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7F3qfmw001175; Fri, 15 Aug 2014 03:52:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7F3qfnl001174; Fri, 15 Aug 2014 03:52:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201408150352.s7F3qfnl001174@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 15 Aug 2014 03:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r270009 - in stable: 10/sbin/ifconfig 9/sbin/ifconfig X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 03:52:41 -0000 Author: gjb Date: Fri Aug 15 03:52:40 2014 New Revision: 270009 URL: http://svnweb.freebsd.org/changeset/base/270009 Log: MFC r269888: Fix a typo in a comment: s/interprete/interpret/ Sponsored by: The FreeBSD Foundation Modified: stable/9/sbin/ifconfig/ifconfig.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/ifconfig/ifconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.c Fri Aug 15 02:43:02 2014 (r270008) +++ stable/9/sbin/ifconfig/ifconfig.c Fri Aug 15 03:52:40 2014 (r270009) @@ -76,7 +76,7 @@ static const char rcsid[] = /* * Since "struct ifreq" is composed of various union members, callers - * should pay special attention to interprete the value. + * should pay special attention to interpret the value. * (.e.g. little/big endian difference in the structure.) */ struct ifreq ifr; From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 04:35:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5461130B; Fri, 15 Aug 2014 04:35:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40509213B; Fri, 15 Aug 2014 04:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7F4ZZxe019241; Fri, 15 Aug 2014 04:35:35 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7F4ZZCK019240; Fri, 15 Aug 2014 04:35:35 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408150435.s7F4ZZCK019240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 15 Aug 2014 04:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270010 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 04:35:35 -0000 Author: glebius Date: Fri Aug 15 04:35:34 2014 New Revision: 270010 URL: http://svnweb.freebsd.org/changeset/base/270010 Log: Fix synproxy with IPv6. pf_test6() was missing a check for M_SKIP_FIREWALL. PR: 127920 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Aug 15 03:52:40 2014 (r270009) +++ head/sys/netpfil/pf/pf.c Fri Aug 15 04:35:34 2014 (r270010) @@ -6066,6 +6066,9 @@ pf_test6(int dir, struct ifnet *ifp, str if (kif->pfik_flags & PFI_IFLAG_SKIP) return (PF_PASS); + if (m->m_flags & M_SKIP_FIREWALL) + return (PF_PASS); + PF_RULES_RLOCK(); /* We do IP header normalization and packet reassembly here */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 07:30:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC909957; Fri, 15 Aug 2014 07:30:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E0E2262; Fri, 15 Aug 2014 07:30:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7F7UElj097957; Fri, 15 Aug 2014 07:30:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7F7UEW6097956; Fri, 15 Aug 2014 07:30:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408150730.s7F7UEW6097956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 Aug 2014 07:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270011 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 07:30:14 -0000 Author: kib Date: Fri Aug 15 07:30:14 2014 New Revision: 270011 URL: http://svnweb.freebsd.org/changeset/base/270011 Log: Implement 'fast path' for the vm page fault handler. Or, it could be called a scalable path. When several preconditions hold, the vm object lock for the object containing the faulted page is taken in read mode, instead of write, which allows parallel faults processing in the region. Namely, the fast path is taken when the faulted page already exists and does not need copy on write, is already fully valid, and not busy. For technical reasons, fast path is avoided when the fault is the first write on the vnode object, or when the fault is for wiring or debugger read or write. On the fast path, pmap_enter(9) is passed the PMAP_ENTER_NOSLEEP flag, since object lock is kept. Pmap might fail to create the entry, in which case the fallback to slow path is performed. Reviewed by: alc Tested by: pho (previous version) Hardware provided and hosted by: The FreeBSD Foundation and Sentex Data Communications Sponsored by: The FreeBSD Foundation MFC after: 2 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Aug 15 04:35:34 2014 (r270010) +++ head/sys/vm/vm_fault.c Fri Aug 15 07:30:14 2014 (r270011) @@ -237,6 +237,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t int hardfault; struct faultstate fs; struct vnode *vp; + vm_page_t m; int locked, error; hardfault = 0; @@ -290,6 +291,55 @@ RetryFault:; goto RetryFault; } + if (wired) + fault_type = prot | (fault_type & VM_PROT_COPY); + + if (fs.vp == NULL /* avoid locked vnode leak */ && + (fault_flags & (VM_FAULT_CHANGE_WIRING | VM_FAULT_DIRTY)) == 0 && + /* avoid calling vm_object_set_writeable_dirty() */ + ((prot & VM_PROT_WRITE) == 0 || + fs.first_object->type != OBJT_VNODE || + (fs.first_object->flags & OBJ_MIGHTBEDIRTY) != 0)) { + VM_OBJECT_RLOCK(fs.first_object); + if ((prot & VM_PROT_WRITE) != 0 && + fs.first_object->type == OBJT_VNODE && + (fs.first_object->flags & OBJ_MIGHTBEDIRTY) == 0) + goto fast_failed; + m = vm_page_lookup(fs.first_object, fs.first_pindex); + if (m == NULL || vm_page_busied(m) || + m->valid != VM_PAGE_BITS_ALL) + goto fast_failed; + result = pmap_enter(fs.map->pmap, vaddr, m, prot, + fault_type | PMAP_ENTER_NOSLEEP | (wired ? PMAP_ENTER_WIRED : + 0), 0); + if (result != KERN_SUCCESS) + goto fast_failed; + if (m_hold != NULL) { + *m_hold = m; + vm_page_lock(m); + vm_page_hold(m); + vm_page_unlock(m); + } + if ((fault_type & VM_PROT_WRITE) != 0 && + (m->oflags & VPO_UNMANAGED) == 0) { + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } + VM_OBJECT_RUNLOCK(fs.first_object); + if (!wired) + vm_fault_prefault(&fs, vaddr, 0, 0); + vm_map_lookup_done(fs.map, fs.entry); + curthread->td_ru.ru_minflt++; + return (KERN_SUCCESS); +fast_failed: + if (!VM_OBJECT_TRYUPGRADE(fs.first_object)) { + VM_OBJECT_RUNLOCK(fs.first_object); + VM_OBJECT_WLOCK(fs.first_object); + } + } else { + VM_OBJECT_WLOCK(fs.first_object); + } + /* * Make a reference to this object to prevent its disposal while we * are messing with it. Once we have the reference, the map is free @@ -300,15 +350,11 @@ RetryFault:; * truncation operations) during I/O. This must be done after * obtaining the vnode lock in order to avoid possible deadlocks. */ - VM_OBJECT_WLOCK(fs.first_object); vm_object_reference_locked(fs.first_object); vm_object_pip_add(fs.first_object, 1); fs.lookup_still_valid = TRUE; - if (wired) - fault_type = prot | (fault_type & VM_PROT_COPY); - fs.first_m = NULL; /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 10:01:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37A0EC82; Fri, 15 Aug 2014 10:01:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2289C2525; Fri, 15 Aug 2014 10:01:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FA1YGn067432; Fri, 15 Aug 2014 10:01:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FA1Xpa067431; Fri, 15 Aug 2014 10:01:34 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408151001.s7FA1Xpa067431@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 15 Aug 2014 10:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270019 - head/sbin/devd/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 10:01:34 -0000 Author: bz Date: Fri Aug 15 10:01:33 2014 New Revision: 270019 URL: http://svnweb.freebsd.org/changeset/base/270019 Log: Remove bogus ; at the end of the if condition in order to unbreak gcc builds after r270004. MFC after: 4 days X-MFX with: r270004 Modified: head/sbin/devd/tests/client_test.c Modified: head/sbin/devd/tests/client_test.c ============================================================================== --- head/sbin/devd/tests/client_test.c Fri Aug 15 09:50:09 2014 (r270018) +++ head/sbin/devd/tests/client_test.c Fri Aug 15 10:01:33 2014 (r270019) @@ -168,11 +168,11 @@ ATF_TC_BODY(stream, tc) printf("%s", event); create_pos = strstr(event, create_pat); - if (create_pos != NULL); + if (create_pos != NULL) got_create_event = true; destroy_pos = strstr(event, destroy_pat); - if (destroy_pos != NULL); + if (destroy_pos != NULL) got_destroy_event = true; } From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 14:02:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F67D402; Fri, 15 Aug 2014 14:02:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB91221B; Fri, 15 Aug 2014 14:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FE2P7x086884; Fri, 15 Aug 2014 14:02:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FE2OHB086882; Fri, 15 Aug 2014 14:02:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408151402.s7FE2OHB086882@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 15 Aug 2014 14:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270022 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 14:02:25 -0000 Author: glebius Date: Fri Aug 15 14:02:24 2014 New Revision: 270022 URL: http://svnweb.freebsd.org/changeset/base/270022 Log: pf_map_addr() can fail and in this case we should drop the packet, otherwise bad consequences including a routing loop can occur. Move pf_set_rt_ifp() earlier in state creation sequence and inline it, cutting some extra code. PR: 183997 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf.h Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Aug 15 12:58:32 2014 (r270021) +++ head/sys/netpfil/pf/pf.c Fri Aug 15 14:02:24 2014 (r270022) @@ -266,8 +266,6 @@ static u_int16_t pf_get_mss(struct mbuf sa_family_t); static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, int, u_int16_t); -static void pf_set_rt_ifp(struct pf_state *, - struct pf_addr *); static int pf_check_proto_cksum(struct mbuf *, int, int, u_int8_t, sa_family_t); static void pf_print_state_parts(struct pf_state *, @@ -2957,31 +2955,6 @@ pf_calc_mss(struct pf_addr *addr, sa_fam return (mss); } -static void -pf_set_rt_ifp(struct pf_state *s, struct pf_addr *saddr) -{ - struct pf_rule *r = s->rule.ptr; - struct pf_src_node *sn = NULL; - - s->rt_kif = NULL; - if (!r->rt || r->rt == PF_FASTROUTE) - return; - switch (s->key[PF_SK_WIRE]->af) { -#ifdef INET - case AF_INET: - pf_map_addr(AF_INET, r, saddr, &s->rt_addr, NULL, &sn); - s->rt_kif = r->rpool.cur->kif; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - pf_map_addr(AF_INET6, r, saddr, &s->rt_addr, NULL, &sn); - s->rt_kif = r->rpool.cur->kif; - break; -#endif /* INET6 */ - } -} - static u_int32_t pf_tcp_iss(struct pf_pdesc *pd) { @@ -3544,6 +3517,19 @@ pf_create_state(struct pf_rule *r, struc s->timeout = PFTM_OTHER_FIRST_PACKET; } + if (r->rt && r->rt != PF_FASTROUTE) { + struct pf_src_node *sn = NULL; + + if (pf_map_addr(pd->af, r, pd->src, &s->rt_addr, NULL, &sn)) { + REASON_SET(&reason, PFRES_MAPFAILED); + pf_src_tree_remove_state(s); + STATE_DEC_COUNTERS(s); + uma_zfree(V_pf_state_z, s); + goto csfailed; + } + s->rt_kif = r->rpool.cur->kif; + } + s->creation = time_uptime; s->expire = time_uptime; @@ -3609,7 +3595,6 @@ pf_create_state(struct pf_rule *r, struc } else *sm = s; - pf_set_rt_ifp(s, pd->src); /* needs s->state_key set */ if (tag > 0) s->tag = tag; if (pd->proto == IPPROTO_TCP && (th->th_flags & (TH_SYN|TH_ACK)) == Modified: head/sys/netpfil/pf/pf.h ============================================================================== --- head/sys/netpfil/pf/pf.h Fri Aug 15 12:58:32 2014 (r270021) +++ head/sys/netpfil/pf/pf.h Fri Aug 15 14:02:24 2014 (r270022) @@ -124,7 +124,8 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE #define PFRES_MAXSTATES 12 /* State limit */ #define PFRES_SRCLIMIT 13 /* Source node/conn limit */ #define PFRES_SYNPROXY 14 /* SYN proxy */ -#define PFRES_MAX 15 /* total+1 */ +#define PFRES_MAPFAILED 15 /* pf_map_addr() failed */ +#define PFRES_MAX 16 /* total+1 */ #define PFRES_NAMES { \ "match", \ @@ -142,6 +143,7 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE "state-limit", \ "src-limit", \ "synproxy", \ + "map-failed", \ NULL \ } From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 14:11:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0355C67; Fri, 15 Aug 2014 14:11:02 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id B38D123FE; Fri, 15 Aug 2014 14:11:02 +0000 (UTC) Received: from bender.lan (97e07ab1.skybroadband.com [151.224.122.177]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id DBF665DEC1; Fri, 15 Aug 2014 14:10:55 +0000 (UTC) Date: Fri, 15 Aug 2014 15:10:47 +0100 From: Andrew Turner To: Warner Losh Subject: Re: svn commit: r269957 - in head/sys: arm/at91 conf Message-ID: <20140815151047.08a00232@bender.lan> In-Reply-To: <201408140421.s7E4LFdf046343@svn.freebsd.org> References: <201408140421.s7E4LFdf046343@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 14:11:02 -0000 On Thu, 14 Aug 2014 04:21:15 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Thu Aug 14 04:21:14 2014 > New Revision: 269957 > URL: http://svnweb.freebsd.org/changeset/base/269957 > > Log: > Add support for FDT and !FDT configs on Atmel, though FDT isn't > working yet. > Bump rev on arm Makefile since files.at91 uses new '!' operator. > > Modified: > head/sys/arm/at91/files.at91 > head/sys/conf/Makefile.arm > > Modified: head/sys/arm/at91/files.at91 > ============================================================================== > --- head/sys/arm/at91/files.at91 Thu Aug 14 04:20:13 > 2014 (r269956) +++ head/sys/arm/at91/files.at91 Thu Aug > 14 04:21:14 2014 (r269957) @@ -3,28 +3,34 @@ > arm/arm/cpufunc_asm_arm9.S standard > arm/at91/at91_machdep.c standard > arm/at91/at91_aic.c standard > arm/at91/at91.c standard > -arm/at91/at91_cfata.c optional at91_cfata > -arm/at91/at91_mci.c optional at91_mci > -dev/nand/nfc_at91.c optional nand > +arm/at91/at91_aic.c standard > arm/at91/at91_pio.c standard > arm/at91/at91_pmc.c standard > +arm/at91/at91_smc.c standard > +arm/at91/at91_cfata.c optional at91_cfata > +arm/at91/at91_common.c optional fdt > +arm/at91/at91_mci.c optional at91_mci > +arm/at91/at91_pinctrl.c optional fdt This file is missing from the repo breaking LINT. Andrew From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 14:16:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55036F74; Fri, 15 Aug 2014 14:16:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 289B124FD; Fri, 15 Aug 2014 14:16:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FEG91u091830; Fri, 15 Aug 2014 14:16:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FEG8Zu091828; Fri, 15 Aug 2014 14:16:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408151416.s7FEG8Zu091828@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 15 Aug 2014 14:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270023 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 14:16:09 -0000 Author: glebius Date: Fri Aug 15 14:16:08 2014 New Revision: 270023 URL: http://svnweb.freebsd.org/changeset/base/270023 Log: Do not lookup source node twice when pf_map_addr() is used. PR: 184003 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_lb.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Aug 15 14:02:24 2014 (r270022) +++ head/sys/netpfil/pf/pf.c Fri Aug 15 14:16:08 2014 (r270023) @@ -3518,8 +3518,6 @@ pf_create_state(struct pf_rule *r, struc } if (r->rt && r->rt != PF_FASTROUTE) { - struct pf_src_node *sn = NULL; - if (pf_map_addr(pd->af, r, pd->src, &s->rt_addr, NULL, &sn)) { REASON_SET(&reason, PFRES_MAPFAILED); pf_src_tree_remove_state(s); Modified: head/sys/netpfil/pf/pf_lb.c ============================================================================== --- head/sys/netpfil/pf/pf_lb.c Fri Aug 15 14:02:24 2014 (r270022) +++ head/sys/netpfil/pf/pf_lb.c Fri Aug 15 14:16:08 2014 (r270023) @@ -310,22 +310,30 @@ pf_map_addr(sa_family_t af, struct pf_ru struct pf_pool *rpool = &r->rpool; struct pf_addr *raddr = NULL, *rmask = NULL; + /* Try to find a src_node if none was given and this + is a sticky-address rule. */ if (*sn == NULL && r->rpool.opts & PF_POOL_STICKYADDR && - (r->rpool.opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) { + (r->rpool.opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) *sn = pf_find_src_node(saddr, r, af, 0); - if (*sn != NULL && !PF_AZERO(&(*sn)->raddr, af)) { - PF_ACPY(naddr, &(*sn)->raddr, af); - if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("pf_map_addr: src tracking maps "); - pf_print_host(saddr, 0, af); - printf(" to "); - pf_print_host(naddr, 0, af); - printf("\n"); - } - return (0); + + /* If a src_node was found or explicitly given and it has a non-zero + route address, use this address. A zeroed address is found if the + src node was created just a moment ago in pf_create_state and it + needs to be filled in with routing decision calculated here. */ + if (*sn != NULL && !PF_AZERO(&(*sn)->raddr, af)) { + PF_ACPY(naddr, &(*sn)->raddr, af); + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("pf_map_addr: src tracking maps "); + pf_print_host(saddr, 0, af); + printf(" to "); + pf_print_host(naddr, 0, af); + printf("\n"); } + return (0); } + /* Find the route using chosen algorithm. Store the found route + in src_node if it was given or found. */ if (rpool->cur->addr.type == PF_ADDR_NOROUTE) return (1); if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 15:36:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F17DD3BA for ; Fri, 15 Aug 2014 15:36:17 +0000 (UTC) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B58642FF2 for ; Fri, 15 Aug 2014 15:36:17 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id h3so2132651igd.8 for ; Fri, 15 Aug 2014 08:36:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=gM+Ey6va9YuA8Jg+KxJcC8V07prkL3LzrjDVrQxVWXs=; b=mSYMpBokeLnV64Nbs3SJzQ52mjdvwa4btUNWh6AZuNktPUHCbagj7YahJJA6C+1CnF FzPOi7bTBOODypo9aDHrLsHM+1+/eXiR/l+KXVybjAi9FGoiNwQHbcsRa90wA3wxPdj9 zyAIak5ZcnjbQM0lWKAjWpUjxi0iptNcSz5w73a569jctH9ia9hhTUe0L1dB4eXArBjE V7wc4af+ft4Sa/xfLV2he5W98UzGSjmryxyaEWFtVWCBxXaqM9q2slU+jebU9t3KSI3v biwT3RRANsgWU7Y0bnjjoqKohlK5OklGs9ex+k9FhBKQzRGj4jcrsFRp06pD5/a7TuxE keYg== X-Gm-Message-State: ALoCoQluThBGvOFF+cDOV8U2P+iYlyxj+HWFG0n/W1FEo0/CCOfDrjrrYjUbfAep2BYMeygMsqoS X-Received: by 10.43.70.205 with SMTP id yh13mr22007515icb.44.1408116971097; Fri, 15 Aug 2014 08:36:11 -0700 (PDT) Received: from bsdimp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id d10sm8977350igl.13.2014.08.15.08.36.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Aug 2014 08:36:10 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_964CE696-836F-4151-9E6B-13ABFC34EF46"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269957 - in head/sys: arm/at91 conf From: Warner Losh In-Reply-To: <20140815151047.08a00232@bender.lan> Date: Fri, 15 Aug 2014 09:36:08 -0600 Message-Id: <53897115-2A9D-4997-8ABD-18D5FDC0787E@bsdimp.com> References: <201408140421.s7E4LFdf046343@svn.freebsd.org> <20140815151047.08a00232@bender.lan> To: Andrew Turner X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2014 15:36:18 -0000 --Apple-Mail=_964CE696-836F-4151-9E6B-13ABFC34EF46 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 15, 2014, at 8:10 AM, Andrew Turner wrote: > On Thu, 14 Aug 2014 04:21:15 +0000 (UTC) > Warner Losh wrote: >=20 >> Author: imp >> Date: Thu Aug 14 04:21:14 2014 >> New Revision: 269957 >> URL: http://svnweb.freebsd.org/changeset/base/269957 >>=20 >> Log: >> Add support for FDT and !FDT configs on Atmel, though FDT isn't >> working yet. >> Bump rev on arm Makefile since files.at91 uses new '!' operator. >>=20 >> Modified: >> head/sys/arm/at91/files.at91 >> head/sys/conf/Makefile.arm >>=20 >> Modified: head/sys/arm/at91/files.at91 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/arm/at91/files.at91 Thu Aug 14 04:20:13 >> 2014 (r269956) +++ head/sys/arm/at91/files.at91 Thu Aug >> 14 04:21:14 2014 (r269957) @@ -3,28 +3,34 @@ >> arm/arm/cpufunc_asm_arm9.S standard >> arm/at91/at91_machdep.c standard >> arm/at91/at91_aic.c standard >> arm/at91/at91.c standard >> -arm/at91/at91_cfata.c optional at91_cfata >> -arm/at91/at91_mci.c optional at91_mci >> -dev/nand/nfc_at91.c optional nand >> +arm/at91/at91_aic.c standard >> arm/at91/at91_pio.c standard >> arm/at91/at91_pmc.c standard >> +arm/at91/at91_smc.c standard >> +arm/at91/at91_cfata.c optional at91_cfata >> +arm/at91/at91_common.c optional fdt >> +arm/at91/at91_mci.c optional at91_mci >> +arm/at91/at91_pinctrl.c optional fdt >=20 > This file is missing from the repo breaking LINT. I have it locally and wanted to work on it a bit more, but I=92ll go = ahead and push it in. I didn=92t think it would active w/o FDT, but = didn=92t think of the LINT case. Warner --Apple-Mail=_964CE696-836F-4151-9E6B-13ABFC34EF46 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 iQIcBAEBCgAGBQJT7ijoAAoJEGwc0Sh9sBEAVvMP/2GuCCdE2KRp+AZCUl9gHtVL mSxNKqrNBK91Jr64ux+lF0i5MuSssy0cOoluJaANkzzkGw7X5bFx9TwCnlIJLlXi ib7ZBN3qihztJelscZHHKHn72CGhwaSAWj4X50OZcwHZfJsrRBdN7jQMT59Ngp7C 2pgJ3boo3tcBzBWW9taVbwRXKej2XgQTrjd/gKvvrj35k2bxaerZZXbiMDO+M7yI IxmDhdgvKRRvyB8Ms2uaVvf+vpVtWJQiQxkpQWNU/ykfdkm3JKTJCI/GEJGHRgcp Lz//QKJyQK8h57+fRg1t48vXhGykxYPRkucci48pBAJuNY23G2sSW/aRLZImkyno nuGEnZzMKYbS6BrR0hPg4nxcFL93sz8kRAFL6S9jYDM6SE5llJ3cbd+NRgCdIdo4 +iNlbE8lRyuiuqECImgMNnVu5X1/PjO3C9GAgjv/Irml4+j2wmqhdtWIdx7e4mQR rovs0g80emmphUDgWoIrQKhmg7GtX64zQxDoO348TmXaVYfxVaGTKH5K6gSzv053 en+S4VYXXxptMUtamIF/Cy3d6PkrXLlee/GJHH/EspUW+9+SE/H1DV522p7NrdEW q6x7YhWoFfHjnXFNxGxqBb7cbHIs8VrYohXHnyUFlrRUGmpXoqcw0IvofaHSlRXU +uR0os1t6SeguCY5KKhX =dx5q -----END PGP SIGNATURE----- --Apple-Mail=_964CE696-836F-4151-9E6B-13ABFC34EF46-- From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 15:42:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E00736EA; Fri, 15 Aug 2014 15:42:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCD020D1; Fri, 15 Aug 2014 15:42:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FFgwaD033051; Fri, 15 Aug 2014 15:42:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FFgw4u033050; Fri, 15 Aug 2014 15:42:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201408151542.s7FFgw4u033050@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 15 Aug 2014 15:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270024 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 15:42:59 -0000 Author: markj Date: Fri Aug 15 15:42:58 2014 New Revision: 270024 URL: http://svnweb.freebsd.org/changeset/base/270024 Log: Correct the order of arguments passed to LIST_INSERT_AFTER(). Reviewed by: kib X-MFC-With: r269656 Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Aug 15 14:16:08 2014 (r270023) +++ head/sys/kern/kern_exit.c Fri Aug 15 15:42:58 2014 (r270024) @@ -1278,8 +1278,8 @@ proc_reparent(struct proc *child, struct LIST_INSERT_HEAD(&child->p_pptr->p_orphans, child, p_orphan); } else { - LIST_INSERT_AFTER(child, - LIST_FIRST(&child->p_pptr->p_orphans), p_orphan); + LIST_INSERT_AFTER(LIST_FIRST(&child->p_pptr->p_orphans), + child, p_orphan); } child->p_treeflag |= P_TREE_ORPHANED; } From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 16:08:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4868467C; Fri, 15 Aug 2014 16:08:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 332CC24A0; Fri, 15 Aug 2014 16:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FG8rG9043820; Fri, 15 Aug 2014 16:08:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FG8q61043817; Fri, 15 Aug 2014 16:08:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408151608.s7FG8q61043817@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 15 Aug 2014 16:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270025 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2014 16:08:53 -0000 Author: imp Date: Fri Aug 15 16:08:52 2014 New Revision: 270025 URL: http://svnweb.freebsd.org/changeset/base/270025 Log: Implement the FDT static pinctl/pinmux spec for Atmel. This will configure the mux and config registers for PIO devices based on what we find in the FDT. I developed it per the spec that had been committed to Linux in the January 2014 time frame and haven't updated. In short, bundles of pins are activated in specific ways for specific configurations, and we implement all of that. What's not included is a MI device infrastructure, any dynamic run-time changing of these pins, etc. Also not included are hooks into all the drivers to enable the latter (static at boot no driver changes are needed). These larger questions will need to be answered once we have more drivers like this for more platforms, or somebody has a heck of a lot of time to research a bunch of platforms, the Linux solution (which is good, but has its warts), etc. Added: head/sys/arm/at91/at91_pinctrl.c (contents, props changed) Modified: head/sys/arm/at91/at91_pio.c head/sys/arm/at91/at91_piovar.h Added: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_pinctrl.c Fri Aug 15 16:08:52 2014 (r270025) @@ -0,0 +1,524 @@ +/*- + * Copyright (c) 2014 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#define BUS_PASS_PINMUX (BUS_PASS_INTERRUPT + 1) + +struct pinctrl_range { + uint64_t bus; + uint64_t host; + uint64_t size; +}; + +struct pinctrl_softc { + device_t dev; + phandle_t node; + + struct pinctrl_range *ranges; + int nranges; + + pcell_t acells, scells; + int done_pinmux; +}; + +struct pinctrl_devinfo { + struct ofw_bus_devinfo obdinfo; + struct resource_list rl; +}; + +static int +at91_pinctrl_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-pinctrl")) + return (ENXIO); + device_set_desc(dev, "pincontrol bus"); + return (0); +} + +/* XXX Make this a subclass of simplebus */ + +static struct pinctrl_devinfo * +at91_pinctrl_setup_dinfo(device_t dev, phandle_t node) +{ + struct pinctrl_softc *sc; + struct pinctrl_devinfo *ndi; + uint32_t *reg, *intr, icells; + uint64_t phys, size; + phandle_t iparent; + int i, j, k; + int nintr; + int nreg; + + sc = device_get_softc(dev); + + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&ndi->obdinfo, node) != 0) { + free(ndi, M_DEVBUF); + return (NULL); + } + + resource_list_init(&ndi->rl); + nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); + if (nreg == -1) + nreg = 0; + if (nreg % (sc->acells + sc->scells) != 0) { +// if (bootverbose) + device_printf(dev, "Malformed reg property on <%s>\n", + ndi->obdinfo.obd_name); + nreg = 0; + } + + for (i = 0, k = 0; i < nreg; i += sc->acells + sc->scells, k++) { + phys = size = 0; + for (j = 0; j < sc->acells; j++) { + phys <<= 32; + phys |= reg[i + j]; + } + for (j = 0; j < sc->scells; j++) { + size <<= 32; + size |= reg[i + sc->acells + j]; + } + + resource_list_add(&ndi->rl, SYS_RES_MEMORY, k, + phys, phys + size - 1, size); + } + free(reg, M_OFWPROP); + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_xref_phandle(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells property, " + "assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } + for (i = 0, k = 0; i < nintr; i += icells, k++) { + intr[i] = ofw_bus_map_intr(dev, iparent, icells, + &intr[i]); + resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], + intr[i], 1); + } + free(intr, M_OFWPROP); + } + + return (ndi); +} + +static int +at91_pinctrl_fill_ranges(phandle_t node, struct pinctrl_softc *sc) +{ + int host_address_cells; + cell_t *base_ranges; + ssize_t nbase_ranges; + int err; + int i, j, k; + + err = OF_searchencprop(OF_parent(node), "#address-cells", + &host_address_cells, sizeof(host_address_cells)); + if (err <= 0) + return (-1); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges < 0) + return (-1); + sc->nranges = nbase_ranges / sizeof(cell_t) / + (sc->acells + host_address_cells + sc->scells); + if (sc->nranges == 0) + return (0); + + sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + M_DEVBUF, M_WAITOK); + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < sc->nranges; i++) { + sc->ranges[i].bus = 0; + for (k = 0; k < sc->acells; k++) { + sc->ranges[i].bus <<= 32; + sc->ranges[i].bus |= base_ranges[j++]; + } + sc->ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + sc->ranges[i].host <<= 32; + sc->ranges[i].host |= base_ranges[j++]; + } + sc->ranges[i].size = 0; + for (k = 0; k < sc->scells; k++) { + sc->ranges[i].size <<= 32; + sc->ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_DEVBUF); + return (sc->nranges); +} + +static int +at91_pinctrl_attach(device_t dev) +{ + struct pinctrl_softc *sc; + struct pinctrl_devinfo *di; + phandle_t node; + device_t cdev; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + sc->dev = dev; + sc->node = node; + + /* + * Some important numbers + */ + sc->acells = 2; + OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells)); + sc->scells = 1; + OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells)); + + if (at91_pinctrl_fill_ranges(node, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + if ((di = at91_pinctrl_setup_dinfo(dev, node)) == NULL) + continue; + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + di->obdinfo.obd_name); + resource_list_free(&di->rl); + ofw_bus_gen_destroy_devinfo(&di->obdinfo); + free(di, M_DEVBUF); + continue; + } + device_set_ivars(cdev, di); + } + + return (bus_generic_attach(dev)); +} + +static const struct ofw_bus_devinfo * +pinctrl_get_devinfo(device_t bus __unused, device_t child) +{ + struct pinctrl_devinfo *ndi; + + ndi = device_get_ivars(child); + return (&ndi->obdinfo); +} + +static struct resource * +pinctrl_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct pinctrl_softc *sc; + struct pinctrl_devinfo *di; + struct resource_list_entry *rle; + int j; + + sc = device_get_softc(bus); + + /* + * Request for the default allocation with a given rid: use resource + * list stored in the local device info. + */ + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + rle = resource_list_find(&di->rl, type, *rid); + if (rle == NULL) { +// if (bootverbose) + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); + return (NULL); + } + start = rle->start; + end = rle->end; + count = rle->count; + } + + if (type == SYS_RES_MEMORY) { + /* Remap through ranges property */ + for (j = 0; j < sc->nranges; j++) { + if (start >= sc->ranges[j].bus && end < + sc->ranges[j].bus + sc->ranges[j].size) { + start -= sc->ranges[j].bus; + start += sc->ranges[j].host; + end -= sc->ranges[j].bus; + end += sc->ranges[j].host; + break; + } + } + if (j == sc->nranges && sc->nranges != 0) { +// if (bootverbose) + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); + + return (NULL); + } + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +static int +pinctrl_print_res(struct pinctrl_devinfo *di) +{ + int rv; + + 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"); + return (rv); +} + +static void +pinctrl_probe_nomatch(device_t bus, device_t child) +{ + const char *name, *type, *compat; + +// if (!bootverbose) + return; + + name = ofw_bus_get_name(child); + type = ofw_bus_get_type(child); + compat = ofw_bus_get_compat(child); + + device_printf(bus, "<%s>", name != NULL ? name : "unknown"); + pinctrl_print_res(device_get_ivars(child)); + if (!ofw_bus_status_okay(child)) + printf(" disabled"); + if (type) + printf(" type %s", type); + if (compat) + printf(" compat %s", compat); + printf(" (no driver attached)\n"); +} + +static int +pinctrl_print_child(device_t bus, device_t child) +{ + int rv; + + rv = bus_print_child_header(bus, child); + rv += pinctrl_print_res(device_get_ivars(child)); + if (!ofw_bus_status_okay(child)) + rv += printf(" disabled"); + rv += bus_print_child_footer(bus, child); + return (rv); +} + +const char *periphs[] = {"gpio", "periph A", "periph B", "periph C", "periph D", "periph E" }; + +static void +pinctrl_walk_tree(device_t bus, phandle_t node) +{ + struct pinctrl_softc *sc; + char status[10]; + char name[32]; + phandle_t pinctrl[32], pins[32 * 4], scratch; + ssize_t len, npins; + int i, j; + + sc = device_get_softc(bus); + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + pinctrl_walk_tree(bus, node); + memset(status, 0, sizeof(status)); + memset(name, 0, sizeof(name)); + OF_getprop(node, "status", status, sizeof(status)); + OF_getprop(node, "name", name, sizeof(name)); + if (strcmp(status, "okay") != 0) { +// printf("pinctrl: omitting node %s since it isn't active\n", name); + continue; + } + len = OF_getencprop(node, "pinctrl-0", pinctrl, sizeof(pinctrl)); + if (len <= 0) { +// printf("pinctrl: no pinctrl-0 property for node %s, omitting\n", name); + continue; + } + len /= sizeof(phandle_t); + printf("pinctrl: Found active node %s\n", name); + for (i = 0; i < len; i++) { + scratch = OF_xref_phandle(pinctrl[i]); + npins = OF_getencprop(scratch, "atmel,pins", pins, sizeof(pins)); + if (npins <= 0) { + printf("We're doing it wrong %s\n", name); + continue; + } + memset(name, 0, sizeof(name)); + OF_getprop(scratch, "name", name, sizeof(name)); + npins /= (4 * 4); + printf("----> need to cope with %d more pins for %s\n", npins, name); + for (j = 0; j < npins; j++) { + uint32_t unit = pins[j * 4]; + uint32_t pin = pins[j * 4 + 1]; + uint32_t periph = pins[j * 4 + 2]; + uint32_t flags = pins[j * 4 + 3]; + uint32_t pio = (0xfffffff & sc->ranges[0].bus) + 0x200 * unit; + printf("P%c%d %s %#x\n", unit + 'A', pin, periphs[periph], + flags); + switch (periph) { + case 0: + at91_pio_use_gpio(pio, 1u << pin); + at91_pio_gpio_pullup(pio, 1u << pin, !!(flags & 1)); + at91_pio_gpio_high_z(pio, 1u << pin, !!(flags & 2)); + at91_pio_gpio_set_deglitch(pio, 1u << pin, !!(flags & 4)); + // at91_pio_gpio_pulldown(pio, 1u << pin, !!(flags & 8)); + // at91_pio_gpio_dis_schmidt(pio, 1u << pin, !!(flags & 16)); + break; + case 1: + at91_pio_use_periph_a(pio, 1u << pin, flags); + break; + case 2: + at91_pio_use_periph_b(pio, 1u << pin, flags); + break; + } + } + } + } +} + +static void +pinctrl_new_pass(device_t bus) +{ + struct pinctrl_softc *sc; + phandle_t node; + + sc = device_get_softc(bus); + + bus_generic_new_pass(bus); + + if (sc->done_pinmux || bus_current_pass < BUS_PASS_PINMUX) + return; + sc->done_pinmux++; + + node = OF_peer(0); + if (node == -1) + return; + pinctrl_walk_tree(bus, node); +} + +static device_method_t at91_pinctrl_methods[] = { + DEVMETHOD(device_probe, at91_pinctrl_probe), + DEVMETHOD(device_attach, at91_pinctrl_attach), + + DEVMETHOD(bus_print_child, pinctrl_print_child), + DEVMETHOD(bus_probe_nomatch, pinctrl_probe_nomatch), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, pinctrl_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), + DEVMETHOD(bus_new_pass, pinctrl_new_pass), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, pinctrl_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +static driver_t at91_pinctrl_driver = { + "at91_pinctrl", + at91_pinctrl_methods, + sizeof(struct pinctrl_softc), +}; + +static devclass_t at91_pinctrl_devclass; + +EARLY_DRIVER_MODULE(at91_pinctrl, simplebus, at91_pinctrl_driver, at91_pinctrl_devclass, + NULL, NULL, BUS_PASS_BUS); + +/* + * dummy driver to force pass BUS_PASS_PINMUX to happen. + */ +static int +at91_pingroup_probe(device_t dev) +{ + return ENXIO; +} + +static device_method_t at91_pingroup_methods[] = { + DEVMETHOD(device_probe, at91_pingroup_probe), + + DEVMETHOD_END +}; + + +static driver_t at91_pingroup_driver = { + "at91_pingroup", + at91_pingroup_methods, + 0, +}; + +static devclass_t at91_pingroup_devclass; + +EARLY_DRIVER_MODULE(at91_pingroup, at91_pinctrl, at91_pingroup_driver, at91_pingroup_devclass, + NULL, NULL, BUS_PASS_PINMUX); Modified: head/sys/arm/at91/at91_pio.c ============================================================================== --- head/sys/arm/at91/at91_pio.c Fri Aug 15 15:42:58 2014 (r270024) +++ head/sys/arm/at91/at91_pio.c Fri Aug 15 16:08:52 2014 (r270025) @@ -591,6 +591,17 @@ at91_pio_gpio_set_deglitch(uint32_t pio, } void +at91_pio_gpio_pullup(uint32_t pio, uint32_t data_mask, int do_pullup) +{ + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); + + if (do_pullup) + PIO[PIO_PUER / 4] = data_mask; + else + PIO[PIO_PUDR / 4] = data_mask; +} + +void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt) { @@ -611,12 +622,21 @@ at91_pio_gpio_clear_interrupt(uint32_t p return (PIO[PIO_ISR / 4]); } +static void +at91_pio_new_pass(device_t dev) +{ + + device_printf(dev, "Pass %d\n", bus_current_pass); +} + static device_method_t at91_pio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, at91_pio_probe), DEVMETHOD(device_attach, at91_pio_attach), DEVMETHOD(device_detach, at91_pio_detach), + DEVMETHOD(bus_new_pass, at91_pio_new_pass), + DEVMETHOD_END }; @@ -626,10 +646,5 @@ static driver_t at91_pio_driver = { sizeof(struct at91_pio_softc), }; -#ifdef FDT -DRIVER_MODULE(at91_pio, simplebus, at91_pio_driver, at91_pio_devclass, NULL, - NULL); -#else -DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, - NULL); -#endif +EARLY_DRIVER_MODULE(at91_pio, at91_pinctrl, at91_pio_driver, at91_pio_devclass, + NULL, NULL, BUS_PASS_INTERRUPT); Modified: head/sys/arm/at91/at91_piovar.h ============================================================================== --- head/sys/arm/at91/at91_piovar.h Fri Aug 15 15:42:58 2014 (r270024) +++ head/sys/arm/at91/at91_piovar.h Fri Aug 15 16:08:52 2014 (r270025) @@ -45,5 +45,6 @@ void at91_pio_gpio_set_deglitch(uint32_t void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt); uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio); +void at91_pio_gpio_pullup(uint32_t pio, uint32_t data_mask, int do_pullup); #endif /* ARM_AT91_AT91_PIOVAR_H */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 16:37:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADB402DF; Fri, 15 Aug 2014 16:37:07 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B55E27B7; Fri, 15 Aug 2014 16:37:07 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id F26EAAEAC; Fri, 15 Aug 2014 09:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1408120626; x=1408135026; bh=ifH5JvJzjrp1QVAKgITnKOhG0///M/DyQ+y4z6OWII4=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=1tbKE4h/9k1EW6WI8vseNyNky0oefpkjuIF6T+l2Yqn+59zCfJAxq/6UQx206idl7 fEHEGwEe3f5a10nD9Lv5nPhICsMijQhHWfXKGbULCUaiCYn1IEL6JXS78WHI2ojsHO ofirdBia2/RrA7t5qumrfbZl0DA+ag9+y/X967BM= Message-ID: <53EE3730.60006@delphij.net> Date: Fri, 15 Aug 2014 09:37:04 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Alan Cox , d@delphij.net, John-Mark Gurney , Xin LI Subject: Re: svn commit: r269963 - head/sys/kern References: <201408140513.s7E5DPRb069698@svn.freebsd.org> <20140814053518.GO83475@funkthat.com> <53EC560B.5000104@delphij.net> <53ED3C6E.10204@rice.edu> In-Reply-To: <53ED3C6E.10204@rice.edu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 16:37:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 08/14/14 15:47, Alan Cox wrote: > On 08/14/2014 01:24, Xin Li wrote: >> On 8/13/14 10:35 PM, John-Mark Gurney wrote: >>> Xin LI wrote this message on Thu, Aug 14, 2014 at 05:13 +0000: >>>> Author: delphij Date: Thu Aug 14 05:13:24 2014 New Revision: >>>> 269963 URL: http://svnweb.freebsd.org/changeset/base/269963 >>>> >>>> Log: Re-instate UMA cached backend for 4K - 64K allocations. >>>> New consumers like geli(4) uses malloc(9) to allocate >>>> temporary buffers that gets free'ed shortly, causing frequent >>>> TLB shootdown as observed in hwpmc supported flame graph. >> >>> Can we do even larger, like 128k for phys io sized blocks? >> >> Sure (Actually I'm running with 128k and 256k buckets enabled on >> my own storage box; with r269964 we can easily add new buckets >> without actually activating them by default). >> >> However, I'm relented to add them right now because the current >> malloc(9) implementation would use the next bucket size, which is >> 2x of the previous one, when the requested size is only a little >> bit larger than the smaller chunk's size. In real world the >> larger bucket could eat more memory than all smaller but greater >> than page-sized bucket combined (the actual consumption is still >> small, though). >> > > The current code already supports sizes that are not powers of 2. > For example, with > > Index: kern/kern_malloc.c > =================================================================== > > - --- kern/kern_malloc.c (revision 269997) > +++ kern/kern_malloc.c (working copy) @@ -152,8 +152,11 @@ struct > { {2048, "2048", }, {4096, "4096", }, {8192, "8192", }, + > {12228, "12228", }, {16384, "16384", }, + {24576, "24576", > }, {32768, "32768", }, + {49152, "49152", }, {65536, "65536", > }, {0, NULL}, }; Unrelated to the functionality, but this would break 'vmstat -m' which assumes power of two allocations... Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJT7jcwAAoJEJW2GBstM+nsGH8P/3ghcaRXNjy+w0bkkya0ixsX KpYvah9S2v7mfk8GtN+xSQaTRtVRqmcWCrRnDLgcmAtRQr0q73T2H5w7a8fVG3sN c3X3c4dyn5XDzrNGmrIe4hAfDNK1F0WPF5nkMpAHhh/EXV5cPynLP2hlZHT6wWa9 MO0ZVAqVjfe1ZIi71AmU69GLGqgTTykMWUo2BKfRZg1LoMektW5Ugj4KlUsvD+SF +FpU7wCSc19br3i27MTsUWU7RKyTyycSOrl/FpZtWMMtyB4RELxUa3QYQQsk2FuM YNWRcBtGaMisNqALMghmJT6l2dtmcPGS47AcyyQnR6w+VziWuYe6Lq/D3iz2EgCM QqFGxp/oDauSjBUfgB83CDfdjrp2x277szBIc9OmvgsyhVgAfDoZzdWuyW2azKi5 c7RN10sqwGhFCLYScgtM0Y2TS8wBGc/uJ7nQMdFUjZ7yNsW3xEU0vAHB0QKar5Tt nIXOiigpO3Ql71l0safPIBvkzWNDHviwuBgGnEgrel86T9tGStRmDCE5YtIaamJV R9Wlhaj7e++4+IC5AEUQvSE1yrg5v5GZVVZEsEBcy1MUlDo5+jqzoxU9lp1sDLAN z7S1PkjWmurFykKl8Vvgi5UHXv5e8u6wFEjf1VDoKw/cqvRWLS/9ifS3ou0EwrJl yBW1Vm9lx6QJohCfq+/q =NvIK -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 19:07:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87F768F7; Fri, 15 Aug 2014 19:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 727512C79; Fri, 15 Aug 2014 19:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FJ70pI031747; Fri, 15 Aug 2014 19:07:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FJ6xlE031737; Fri, 15 Aug 2014 19:06:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201408151906.s7FJ6xlE031737@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Aug 2014 19:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270026 - in stable/10/contrib/nvi: cl common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 19:07:00 -0000 Author: emaste Date: Fri Aug 15 19:06:59 2014 New Revision: 270026 URL: http://svnweb.freebsd.org/changeset/base/270026 Log: MFC r259088: Vendor import nvi-2.1.2-c80f493b038 a multikey mapping fix PR: bin/182463 Modified: stable/10/contrib/nvi/cl/cl_term.c stable/10/contrib/nvi/common/key.c stable/10/contrib/nvi/common/key.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/nvi/cl/cl_term.c ============================================================================== --- stable/10/contrib/nvi/cl/cl_term.c Fri Aug 15 16:08:52 2014 (r270025) +++ stable/10/contrib/nvi/cl/cl_term.c Fri Aug 15 19:06:59 2014 (r270026) @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: cl_term.c,v 10.33 2012/04/21 23:51:46 zy Exp $"; +static const char sccsid[] = "$Id: cl_term.c,v 10.34 2013/12/07 16:21:14 wjenkner Exp $"; #endif /* not lint */ #include @@ -187,14 +187,18 @@ cl_term_init(SCR *sp) int cl_term_end(GS *gp) { - SEQ *qp, *nqp; + SEQ *qp, *nqp, *pre_qp = NULL; /* Delete screen specific mappings. */ SLIST_FOREACH_SAFE(qp, gp->seqq, q, nqp) if (F_ISSET(qp, SEQ_SCREEN)) { - SLIST_REMOVE_HEAD(gp->seqq, q); + if (qp == SLIST_FIRST(gp->seqq)) + SLIST_REMOVE_HEAD(gp->seqq, q); + else + SLIST_REMOVE_AFTER(pre_qp, q); (void)seq_free(qp); - } + } else + pre_qp = qp; return (0); } Modified: stable/10/contrib/nvi/common/key.c ============================================================================== --- stable/10/contrib/nvi/common/key.c Fri Aug 15 16:08:52 2014 (r270025) +++ stable/10/contrib/nvi/common/key.c Fri Aug 15 19:06:59 2014 (r270026) @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: key.c,v 10.53 2013/03/11 01:20:53 yamt Exp $"; +static const char sccsid[] = "$Id: key.c,v 10.54 2013/11/13 12:15:27 zy Exp $"; #endif /* not lint */ #include @@ -272,7 +272,7 @@ v_key_name( * The code prints non-printable wide characters in 4 or 5 digits * Unicode escape sequences, so only supports plane 0 to 15. */ - if (ISPRINT(ach)) + if (CAN_PRINT(sp, ach)) goto done; nopr: if (iscntrl(ch) && (ch < 0x20 || ch == 0x7f)) { sp->cname[0] = '^'; Modified: stable/10/contrib/nvi/common/key.h ============================================================================== --- stable/10/contrib/nvi/common/key.h Fri Aug 15 16:08:52 2014 (r270025) +++ stable/10/contrib/nvi/common/key.h Fri Aug 15 19:06:59 2014 (r270026) @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: key.h,v 10.55 2012/10/07 01:31:17 zy Exp $ + * $Id: key.h,v 10.56 2013/11/13 12:15:27 zy Exp $ */ #include "multibyte.h" @@ -23,8 +23,9 @@ #define INPUT2INT5(sp,cw,n,nlen,w,wlen) \ sp->conv.input2int(sp, n, nlen, &(cw), &wlen, &w) #define CONST +#define INTISWIDE(c) (wctob(c) == EOF) #define CHAR_WIDTH(sp, ch) wcwidth(ch) -#define INTISWIDE(c) (wctob(c) == EOF) +#define CAN_PRINT(sp, ch) (CHAR_WIDTH(sp, ch) > 0) #else #define FILE2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) @@ -36,9 +37,10 @@ (n = w, nlen = wlen, 0) #define INPUT2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) -#define CONST const -#define INTISWIDE(c) 0 +#define CONST const +#define INTISWIDE(c) 0 #define CHAR_WIDTH(sp, ch) 1 +#define CAN_PRINT(sp, ch) isprint(ch) #endif #define FILE2INT(sp,n,nlen,w,wlen) \ FILE2INT5(sp,sp->cw,n,nlen,w,wlen) From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 21:22:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 982EFFF; Fri, 15 Aug 2014 21:22:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8380B2C9A; Fri, 15 Aug 2014 21:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FLMo1T010690; Fri, 15 Aug 2014 21:22:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FLMnuU010687; Fri, 15 Aug 2014 21:22:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201408152122.s7FLMnuU010687@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 15 Aug 2014 21:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270027 - in head: . sbin/atm/atmconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2014 21:22:50 -0000 Author: ngie Date: Fri Aug 15 21:22:49 2014 New Revision: 270027 URL: http://svnweb.freebsd.org/changeset/base/270027 Log: Fix atmconfig compilation when MK_ATM == yes and MK_BSNMP == no Makefile.inc1: Always compile gensnmptree with bootstrap-tools when MK_BSNMP != no instead of depending on a potentially stale tool installed on the build host sbin/atm/atmconfig/Makefile: - Always remove oid.h to avoid cluttering up the build/src tree. - Consolidate all of the RESCUE/MK_BSNMP != no logic under one conditional to improve readability - Remove unnecessary ${.OBJDIR} prefixing for oid.h and use ${.TARGET} instead of spelling out oid.h - Add a missing DPADD for ${LIBCRYPTO} when compiled MK_BSNMP == yes and MK_OPENSSL == yes and not compiling for /rescue/rescue sbin/atm/atmconfig/main.c: Change #ifndef RESCUE to #ifdef WITH_BSNMP in main.c to make it clear that we're compiling bsnmp support into atmconfig Approved by: jmmv (mentor) Phabric: D579 PR: 143830 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/sbin/atm/atmconfig/Makefile head/sbin/atm/atmconfig/main.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 15 19:06:59 2014 (r270026) +++ head/Makefile.inc1 Fri Aug 15 21:22:49 2014 (r270027) @@ -1239,7 +1239,7 @@ _lex= usr.bin/lex _awk= usr.bin/awk .endif -.if ${MK_BSNMP} != "no" && !exists(/usr/sbin/gensnmptree) +.if ${MK_BSNMP} != "no" _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif Modified: head/sbin/atm/atmconfig/Makefile ============================================================================== --- head/sbin/atm/atmconfig/Makefile Fri Aug 15 19:06:59 2014 (r270026) +++ head/sbin/atm/atmconfig/Makefile Fri Aug 15 21:22:49 2014 (r270027) @@ -8,29 +8,24 @@ .include PROG= atmconfig -.ifndef RESCUE -SRCS= ${.OBJDIR}/oid.h -.endif -SRCS+= main.c diag.c natm.c -.ifndef RESCUE -SRCS+= atmconfig_device.c -.endif +SRCS= main.c diag.c natm.c MAN= atmconfig.8 # CFLAGS+= -DPATH_HELP='".:/usr/share/doc/atm:/usr/local/share/doc/atm"' CFLAGS+= -I${.OBJDIR} -.ifndef RESCUE -DPADD= ${LIBBSNMP} -LDADD= -lbsnmp +.if !defined(RESCUE) && ${MK_BSNMP} != "no" +CFLAGS+= -DWITH_BSNMP +SRCS+= oid.h atmconfig_device.c +DPADD+= ${LIBBSNMP} +LDADD+= -lbsnmp . if ${MK_DYNAMICROOT} == "no" && ${MK_OPENSSL} != "no" +DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto . endif .endif -.ifndef RESCUE CLEANFILES+= oid.h -.endif # XXX - this is verboten .if ${MACHINE_CPUARCH} == "arm" @@ -43,8 +38,8 @@ FILESDIR= /usr/share/doc/atm SNMP_ATM_DEF= ${.CURDIR}/../../../contrib/ngatm/snmp_atm/atm_tree.def \ ${.CURDIR}/../../../usr.sbin/bsnmpd/modules/snmp_atm/atm_freebsd.def -${.OBJDIR}/oid.h: atm_oid.list ${SNMP_ATM_DEF} +oid.h: atm_oid.list ${SNMP_ATM_DEF} cat ${SNMP_ATM_DEF} | gensnmptree -e `tail -n +2 ${.CURDIR}/atm_oid.list` \ - > ${.OBJDIR}/oid.h + > ${.TARGET} .include Modified: head/sbin/atm/atmconfig/main.c ============================================================================== --- head/sbin/atm/atmconfig/main.c Fri Aug 15 19:06:59 2014 (r270026) +++ head/sbin/atm/atmconfig/main.c Fri Aug 15 21:22:49 2014 (r270027) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifndef RESCUE +#ifdef WITH_BSNMP #include #include #include @@ -444,7 +444,7 @@ help_func(int argc, char *argv[]) exit(1); } -#ifndef RESCUE +#ifdef WITH_BSNMP /* * Parse a server specification * @@ -527,16 +527,16 @@ main(int argc, char *argv[]) int opt, i; const struct cmdtab *match, *cc, *tab; -#ifndef RESCUE +#ifdef WITH_BSNMP snmp_client_init(&snmp_client); snmp_client.trans = SNMP_TRANS_LOC_STREAM; snmp_client_set_host(&snmp_client, PATH_ILMI_SOCK); #endif -#ifdef RESCUE -#define OPTSTR "htv" -#else +#ifdef WITH_BSNMP #define OPTSTR "htvs:" +#else +#define OPTSTR "htv" #endif while ((opt = getopt(argc, argv, OPTSTR)) != -1) @@ -545,7 +545,7 @@ main(int argc, char *argv[]) case 'h': help_func(0, argv); -#ifndef RESCUE +#ifdef WITH_BSNMP case 's': parse_server(optarg); break; @@ -570,7 +570,7 @@ main(int argc, char *argv[]) err(1, NULL); memcpy(main_tab, static_main_tab, sizeof(static_main_tab)); -#ifndef RESCUE +#ifdef WITH_BSNMP /* XXX while this is compiled in */ device_register(); #endif From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 21:35:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFB08802; Fri, 15 Aug 2014 21:35:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 811512DD4; Fri, 15 Aug 2014 21:35:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FLZWqF015867; Fri, 15 Aug 2014 21:35:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FLZWEv015865; Fri, 15 Aug 2014 21:35:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201408152135.s7FLZWEv015865@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 15 Aug 2014 21:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270028 - in head: etc/devd tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 21:35:32 -0000 Author: ngie Date: Fri Aug 15 21:35:31 2014 New Revision: 270028 URL: http://svnweb.freebsd.org/changeset/base/270028 Log: Make the USB and ZFS devd configuration files optional depending on the values of MK_USB/MK_ZFS Making zfs.conf optional resolves PR # 186971 PR: 186971 Phabric: D606 Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Modified: head/etc/devd/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/devd/Makefile ============================================================================== --- head/etc/devd/Makefile Fri Aug 15 21:22:49 2014 (r270027) +++ head/etc/devd/Makefile Fri Aug 15 21:35:31 2014 (r270028) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= uath.conf usb.conf zfs.conf +.include .if ${MACHINE} == "powerpc" FILES+= apple.conf @@ -10,6 +10,14 @@ FILES+= apple.conf FILES+= asus.conf .endif +.if ${MK_USB} != "no" +FILES+= uath.conf usb.conf +.endif + +.if ${MK_ZFS} != "no" +FILES+= zfs.conf +.endif + NO_OBJ= FILESDIR= /etc/devd FILESMODE= 644 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 15 21:22:49 2014 (r270027) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 15 21:35:31 2014 (r270028) @@ -444,6 +444,7 @@ OLD_FILES+=usr/share/man/man1/dtrace.1.g OLD_FILES+=boot/gptzfsboot OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader +OLD_FILES+=etc/devd/zfs.conf OLD_FILES+=etc/periodic/daily/404.status-zfs OLD_FILES+=etc/periodic/daily/800.scrub-zfs OLD_LIBS+=lib/libzfs.so.2 @@ -4677,9 +4678,10 @@ OLD_FILES+=usr/sbin/unbound-control OLD_FILES+=usr/sbin/unbound-control-setup .endif -#.if ${MK_USB} == no -# to be filled in -#.endif +.if ${MK_USB} == no +OLD_FILES+=etc/devd/uauth.conf +OLD_FILES+=etc/devd/usb.conf +.endif .if ${MK_UTMPX} == no OLD_FILES+=etc/periodic/monthly/200.accounting From owner-svn-src-all@FreeBSD.ORG Fri Aug 15 22:36:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F907FDE; Fri, 15 Aug 2014 22:36:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3E252681; Fri, 15 Aug 2014 22:36:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7FMagpe043436; Fri, 15 Aug 2014 22:36:42 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7FMagUJ043433; Fri, 15 Aug 2014 22:36:42 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201408152236.s7FMagUJ043433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 15 Aug 2014 22:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270029 - in head/bin/sh: . tests/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2014 22:36:43 -0000 Author: jilles Date: Fri Aug 15 22:36:41 2014 New Revision: 270029 URL: http://svnweb.freebsd.org/changeset/base/270029 Log: sh: Mask off shift distance (<< and >>) in arithmetic. In C, shift distances equal to or larger than the number of bits in the operand result in undefined behaviour. As part of eliminating undefined behaviour in arithmetic, mask off the distance like Java and JavaScript specify and C on x86 usually does. Assumption: conversion from unsigned to signed retains the two's complement bits. Assumption: uintmax_t has no padding bits. Added: head/bin/sh/tests/expansion/arith14.0 (contents, props changed) Modified: head/bin/sh/arith_yacc.c head/bin/sh/tests/expansion/Makefile Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Fri Aug 15 21:35:31 2014 (r270028) +++ head/bin/sh/arith_yacc.c Fri Aug 15 22:36:41 2014 (r270029) @@ -139,9 +139,10 @@ static arith_t do_binop(int op, arith_t case ARITH_SUB: return (uintmax_t)a - (uintmax_t)b; case ARITH_LSHIFT: - return (uintmax_t)a << b; + return (uintmax_t)a << + ((uintmax_t)b & (sizeof(uintmax_t) * CHAR_BIT - 1)); case ARITH_RSHIFT: - return a >> b; + return a >> ((uintmax_t)b & (sizeof(uintmax_t) * CHAR_BIT - 1)); case ARITH_LT: return a < b; case ARITH_LE: Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Fri Aug 15 21:35:31 2014 (r270028) +++ head/bin/sh/tests/expansion/Makefile Fri Aug 15 22:36:41 2014 (r270029) @@ -20,6 +20,7 @@ FILES+= arith10.0 FILES+= arith11.0 FILES+= arith12.0 FILES+= arith13.0 +FILES+= arith14.0 FILES+= assign1.0 FILES+= cmdsubst1.0 FILES+= cmdsubst2.0 Added: head/bin/sh/tests/expansion/arith14.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/arith14.0 Fri Aug 15 22:36:41 2014 (r270029) @@ -0,0 +1,40 @@ +# $FreeBSD$ +# Check that <> use the low bits of the shift count. + +if [ $((1<<16<<16)) = 0 ]; then + width=32 +elif [ $((1<<32<<32)) = 0 ]; then + width=64 +elif [ $((1<<64<<64)) = 0 ]; then + width=128 +elif [ $((1<<64>>64)) = 1 ]; then + # Integers are wider than 128 bits; assume arbitrary precision. + # Nothing to test here. + exit 0 +else + echo "Cannot determine integer width" + exit 2 +fi + +twowidth=$((width * 2)) +j=43 k=$((1 << (width - 2))) r=0 + +i=0 +while [ $i -lt $twowidth ]; do + if [ "$((j << i))" != "$((j << (i + width)))" ]; then + echo "Problem with $j << $i" + r=2 + fi + i=$((i + 1)) +done + +i=0 +while [ $i -lt $twowidth ]; do + if [ "$((k >> i))" != "$((k >> (i + width)))" ]; then + echo "Problem with $k >> $i" + r=2 + fi + i=$((i + 1)) +done + +exit $r From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 00:52:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 328F6266; Sat, 16 Aug 2014 00:52:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D01E22C9; Sat, 16 Aug 2014 00:52:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G0qDom009536; Sat, 16 Aug 2014 00:52:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G0qDhT009535; Sat, 16 Aug 2014 00:52:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408160052.s7G0qDhT009535@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 16 Aug 2014 00:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270030 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 00:52:14 -0000 Author: pfg Date: Sat Aug 16 00:52:13 2014 New Revision: 270030 URL: http://svnweb.freebsd.org/changeset/base/270030 Log: MFC r267875: 4251 libdtrace leaks open file handles Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485 (partial) Reference: https://www.illumos.org/issues/4251 Discussed with: Robert Mustacchi Obtained from: Illumos Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Fri Aug 15 22:36:41 2014 (r270029) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Sat Aug 16 00:52:13 2014 (r270030) @@ -2289,12 +2289,15 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons dt_dprintf("skipping library %s, already processed " "library with the same name: %s", dp->d_name, dld->dtld_library); + (void) fclose(fp); continue; } dtp->dt_filetag = fname; - if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) + if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) { + (void) fclose(fp); return (-1); /* preserve dt_errno */ + } rv = dt_compile(dtp, DT_CTX_DPROG, DTRACE_PROBESPEC_NAME, NULL, @@ -2302,8 +2305,10 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons if (rv != NULL && dtp->dt_errno && (dtp->dt_errno != EDT_COMPILER || - dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) + dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) { + (void) fclose(fp); return (-1); /* preserve dt_errno */ + } if (dtp->dt_errno) dt_dprintf("error parsing library %s: %s\n", From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 00:54:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2A343A4; Sat, 16 Aug 2014 00:54:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A320522D4; Sat, 16 Aug 2014 00:54:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G0suDA009902; Sat, 16 Aug 2014 00:54:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G0su2P009901; Sat, 16 Aug 2014 00:54:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408160054.s7G0su2P009901@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 16 Aug 2014 00:54: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: r270031 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 00:54:56 -0000 Author: pfg Date: Sat Aug 16 00:54:56 2014 New Revision: 270031 URL: http://svnweb.freebsd.org/changeset/base/270031 Log: MFC r269015: fparseln(3): Update from NetBSD sources. -fix a condition so that fparseln() doesn't report spurious empty lines eg after 2 comment lines, or on EOF after a single comment line -no escape character means no escaped characters modify the previous fix so that no pointless realloc()s are done in the case of multiple empty continuation lines, and comment the code to make the logics obvious. fparseln is now part of libc in NetBSD so this changes the previous revision numbering. Obtained from: NetBSD (CVS Rev. 1.6-1.7) Modified: stable/10/lib/libutil/fparseln.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/fparseln.c ============================================================================== --- stable/10/lib/libutil/fparseln.c Sat Aug 16 00:52:13 2014 (r270030) +++ stable/10/lib/libutil/fparseln.c Sat Aug 16 00:54:56 2014 (r270031) @@ -1,4 +1,4 @@ -/* $NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $ */ +/* $NetBSD: fparseln.c,v 1.7 2007/03/08 19:57:53 drochner Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -59,7 +59,7 @@ isescaped(const char *sp, const char *p, /* No escape character */ if (esc == '\0') - return 1; + return 0; /* Count the number of escape characters that precede ours */ for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++) @@ -135,13 +135,19 @@ fparseln(FILE *fp, size_t *size, size_t cp = &ptr[s - 1]; if (*cp == con && !isescaped(ptr, cp, esc)) { - s--; /* forget escape */ + s--; /* forget continuation char */ cnt = 1; } } - if (s == 0 && buf != NULL) - continue; + if (s == 0) { + /* + * nothing to add, skip realloc except in case + * we need a minimal buf to return an empty line + */ + if (cnt || buf != NULL) + continue; + } if ((cp = realloc(buf, len + s + 1)) == NULL) { free(buf); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 01:00:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F13E551; Sat, 16 Aug 2014 01:00:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA7A2405; Sat, 16 Aug 2014 01:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G10c5L012815; Sat, 16 Aug 2014 01:00:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G10cHo012814; Sat, 16 Aug 2014 01:00:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408160100.s7G10cHo012814@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 16 Aug 2014 01:00: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: r270032 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 01:00:38 -0000 Author: pfg Date: Sat Aug 16 01:00:37 2014 New Revision: 270032 URL: http://svnweb.freebsd.org/changeset/base/270032 Log: MFC r269695: Const-ify character string Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days Modified: stable/10/lib/libc/net/linkaddr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/linkaddr.c ============================================================================== --- stable/10/lib/libc/net/linkaddr.c Sat Aug 16 00:54:56 2014 (r270031) +++ stable/10/lib/libc/net/linkaddr.c Sat Aug 16 01:00:37 2014 (r270032) @@ -118,7 +118,7 @@ link_addr(addr, sdl) return; } -static char hexlist[] = "0123456789abcdef"; +static const char hexlist[] = "0123456789abcdef"; char * link_ntoa(sdl) From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 01:03:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C154173C; Sat, 16 Aug 2014 01:03:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC65B24A8; Sat, 16 Aug 2014 01:03:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G13pOs014384; Sat, 16 Aug 2014 01:03:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G13pWh014383; Sat, 16 Aug 2014 01:03:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408160103.s7G13pWh014383@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 16 Aug 2014 01:03: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: r270033 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 01:03:51 -0000 Author: pfg Date: Sat Aug 16 01:03:51 2014 New Revision: 270033 URL: http://svnweb.freebsd.org/changeset/base/270033 Log: MFC r269901: Minor style tweaks. Obtained from: OpenBSD (CVS rev. 1.7) Modified: stable/10/lib/libc/stdlib/strtonum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/strtonum.c ============================================================================== --- stable/10/lib/libc/stdlib/strtonum.c Sat Aug 16 01:00:37 2014 (r270032) +++ stable/10/lib/libc/stdlib/strtonum.c Sat Aug 16 01:03:51 2014 (r270033) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ + * $OpenBSD: strtonum.c,v 1.7 2013/04/17 18:40:58 tedu Exp $ */ #include @@ -24,17 +24,17 @@ __FBSDID("$FreeBSD$"); #include #include -#define INVALID 1 -#define TOOSMALL 2 -#define TOOLARGE 3 +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp) { long long ll = 0; - char *ep; int error = 0; + char *ep; struct errval { const char *errstr; int err; @@ -47,9 +47,9 @@ strtonum(const char *numstr, long long m ev[0].err = errno; errno = 0; - if (minval > maxval) + if (minval > maxval) { error = INVALID; - else { + } else { ll = strtoll(numstr, &ep, 10); if (errno == EINVAL || numstr == ep || *ep != '\0') error = INVALID; From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 01:06:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D64A3896; Sat, 16 Aug 2014 01:06:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C143824BE; Sat, 16 Aug 2014 01:06:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G16NPk014778; Sat, 16 Aug 2014 01:06:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G16NJ2014777; Sat, 16 Aug 2014 01:06:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408160106.s7G16NJ2014777@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 16 Aug 2014 01:06: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: r270034 - stable/10/sbin/newfs_msdos X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 01:06:24 -0000 Author: pfg Date: Sat Aug 16 01:06:23 2014 New Revision: 270034 URL: http://svnweb.freebsd.org/changeset/base/270034 Log: MFC r269953: Use "NO NAME" as the default unnamed label. Microsoft recommends avoiding the use of spaces in the string structures for FAT. Unfortunately they do just that by default in the case of unlabeled filesystems. Follow the default MS behavior to avoid confusion in common tools like file(1). This was actually the default behavior before r203868. Obtained from: NetBSD (CVS rev. 1.39) Modified: stable/10/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/10/sbin/newfs_msdos/newfs_msdos.c Sat Aug 16 01:03:51 2014 (r270033) +++ stable/10/sbin/newfs_msdos/newfs_msdos.c Sat Aug 16 01:06:23 2014 (r270034) @@ -689,7 +689,7 @@ main(int argc, char *argv[]) ((u_int)tm->tm_hour << 8 | (u_int)tm->tm_min)); mk4(bsx->exVolumeID, x); - mklabel(bsx->exVolumeLabel, opt_L ? opt_L : "NO_NAME"); + mklabel(bsx->exVolumeLabel, opt_L ? opt_L : "NO NAME"); sprintf(buf, "FAT%u", fat); setstr(bsx->exFileSysType, buf, sizeof(bsx->exFileSysType)); if (!opt_B) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 01:29:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 886BFB89; Sat, 16 Aug 2014 01:29:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58FE1264B; Sat, 16 Aug 2014 01:29:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G1Togn024014; Sat, 16 Aug 2014 01:29:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G1TojV024013; Sat, 16 Aug 2014 01:29:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201408160129.s7G1TojV024013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 16 Aug 2014 01:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270035 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 01:29:50 -0000 Author: pfg Date: Sat Aug 16 01:29:49 2014 New Revision: 270035 URL: http://svnweb.freebsd.org/changeset/base/270035 Log: MFC r268924: Update fflush(3) to return success on a read-only stream. This is done for compliance with SUSv3. The changes cause no secondary effects in the gnulib tests (we pass them). Obtained from: Apple Inc. (Libc 997.90.3 with changes) Reviewed by: bde Phabric: D440 Modified: stable/10/lib/libc/stdio/fflush.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/fflush.c ============================================================================== --- stable/10/lib/libc/stdio/fflush.c Sat Aug 16 01:06:23 2014 (r270034) +++ stable/10/lib/libc/stdio/fflush.c Sat Aug 16 01:29:49 2014 (r270035) @@ -60,7 +60,7 @@ fflush(FILE *fp) /* * There is disagreement about the correct behaviour of fflush() - * when passed a file which is not open for reading. According to + * when passed a file which is not open for writing. According to * the ISO C standard, the behaviour is undefined. * Under linux, such an fflush returns success and has no effect; * under Windows, such an fflush is documented as behaving instead @@ -68,11 +68,13 @@ fflush(FILE *fp) * Given that applications may be written with the expectation of * either of these two behaviours, the only safe (non-astonishing) * option is to return EBADF and ask that applications be fixed. + * SUSv3 now requires that fflush() returns success on a read-only + * stream. + * */ - if ((fp->_flags & (__SWR | __SRW)) == 0) { - errno = EBADF; - retval = EOF; - } else + if ((fp->_flags & (__SWR | __SRW)) == 0) + retval = 0; + else retval = __sflush(fp); FUNLOCKFILE(fp); return (retval); @@ -89,10 +91,9 @@ __fflush(FILE *fp) if (fp == NULL) return (_fwalk(sflush_locked)); - if ((fp->_flags & (__SWR | __SRW)) == 0) { - errno = EBADF; - retval = EOF; - } else + if ((fp->_flags & (__SWR | __SRW)) == 0) + retval = 0; + else retval = __sflush(fp); return (retval); } @@ -122,6 +123,12 @@ __sflush(FILE *fp) for (; n > 0; n -= t, p += t) { t = _swrite(fp, (char *)p, n); if (t <= 0) { + /* Reset _p and _w. */ + if (p > fp->_p) /* Some was written. */ + memmove(fp->_p, p, n); + fp->_p += n; + if ((fp->_flags & (__SLBF | __SNBF)) == 0) + fp->_w -= n; fp->_flags |= __SERR; return (EOF); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 03:05:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4F726CB; Sat, 16 Aug 2014 03:05:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFC5D2080; Sat, 16 Aug 2014 03:05:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G352TK068016; Sat, 16 Aug 2014 03:05:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G352lr068015; Sat, 16 Aug 2014 03:05:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201408160305.s7G352lr068015@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 Aug 2014 03:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270036 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 03:05:03 -0000 Author: adrian Date: Sat Aug 16 03:05:02 2014 New Revision: 270036 URL: http://svnweb.freebsd.org/changeset/base/270036 Log: Add if_ath_alq code into the non-module build. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 16 01:29:49 2014 (r270035) +++ head/sys/conf/files Sat Aug 16 03:05:02 2014 (r270036) @@ -707,6 +707,8 @@ dev/ath/if_ath_ahb.c optional ath_ahb \ # dev/ath/if_ath.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_alq.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_beacon.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_btcoex.c optional ath \ From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 08:31:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0111454; Sat, 16 Aug 2014 08:31:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91F1F2E8A; Sat, 16 Aug 2014 08:31:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G8VQ4r010996; Sat, 16 Aug 2014 08:31:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G8VPHs010992; Sat, 16 Aug 2014 08:31:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408160831.s7G8VPHs010992@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Aug 2014 08:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270038 - in head/sys: i386/i386 i386/xen sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 08:31:26 -0000 Author: kib Date: Sat Aug 16 08:31:25 2014 New Revision: 270038 URL: http://svnweb.freebsd.org/changeset/base/270038 Log: Complete r254667, do not destroy pmap lock if KVA allocation failed. Submitted by: Svatopluk Kraus MFC after: 1 week Modified: head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/sparc64/sparc64/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Aug 16 07:01:42 2014 (r270037) +++ head/sys/i386/i386/pmap.c Sat Aug 16 08:31:25 2014 (r270038) @@ -1755,10 +1755,8 @@ pmap_pinit(pmap_t pmap) */ if (pmap->pm_pdir == NULL) { pmap->pm_pdir = (pd_entry_t *)kva_alloc(NBPTD); - if (pmap->pm_pdir == NULL) { - PMAP_LOCK_DESTROY(pmap); + if (pmap->pm_pdir == NULL) return (0); - } #ifdef PAE pmap->pm_pdpt = uma_zalloc(pdptzone, M_WAITOK | M_ZERO); KASSERT(((vm_offset_t)pmap->pm_pdpt & Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sat Aug 16 07:01:42 2014 (r270037) +++ head/sys/i386/xen/pmap.c Sat Aug 16 08:31:25 2014 (r270038) @@ -1459,7 +1459,6 @@ pmap_pinit(pmap_t pmap) if (pmap->pm_pdir == NULL) { pmap->pm_pdir = (pd_entry_t *)kva_alloc(NBPTD); if (pmap->pm_pdir == NULL) { - PMAP_LOCK_DESTROY(pmap); #ifdef HAMFISTED_LOCKING mtx_unlock(&createdelete_lock); #endif Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Aug 16 07:01:42 2014 (r270037) +++ head/sys/sparc64/sparc64/pmap.c Sat Aug 16 08:31:25 2014 (r270038) @@ -1211,11 +1211,9 @@ pmap_pinit(pmap_t pm) */ if (pm->pm_tsb == NULL) { pm->pm_tsb = (struct tte *)kva_alloc(TSB_BSIZE); - if (pm->pm_tsb == NULL) { - PMAP_LOCK_DESTROY(pm); + if (pm->pm_tsb == NULL) return (0); } - } /* * Allocate an object for it. From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 08:37:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACB36693; Sat, 16 Aug 2014 08:37:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9801E2EB1; Sat, 16 Aug 2014 08:37:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G8bDYk013540; Sat, 16 Aug 2014 08:37:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G8bDmw013539; Sat, 16 Aug 2014 08:37:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408160837.s7G8bDmw013539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Aug 2014 08:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270039 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 08:37:13 -0000 Author: kib Date: Sat Aug 16 08:37:13 2014 New Revision: 270039 URL: http://svnweb.freebsd.org/changeset/base/270039 Log: MFC r269908: Style. Modified: stable/10/lib/libthr/thread/thr_stack.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_stack.c ============================================================================== --- stable/10/lib/libthr/thread/thr_stack.c Sat Aug 16 08:31:25 2014 (r270038) +++ stable/10/lib/libthr/thread/thr_stack.c Sat Aug 16 08:37:13 2014 (r270039) @@ -268,7 +268,7 @@ _thr_stack_alloc(struct pthread_attr *at /* Map the stack and guard page together, and split guard page from allocated space: */ - if ((stackaddr = mmap(stackaddr, stacksize+guardsize, + if ((stackaddr = mmap(stackaddr, stacksize + guardsize, _rtld_get_stack_prot(), MAP_STACK, -1, 0)) != MAP_FAILED && (guardsize == 0 || From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 08:38:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84B277CD; Sat, 16 Aug 2014 08:38:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 564582EB8; Sat, 16 Aug 2014 08:38:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7G8csXP013854; Sat, 16 Aug 2014 08:38:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7G8crTM013850; Sat, 16 Aug 2014 08:38:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201408160838.s7G8crTM013850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 Aug 2014 08:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270040 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 08:38:54 -0000 Author: kib Date: Sat Aug 16 08:38:53 2014 New Revision: 270040 URL: http://svnweb.freebsd.org/changeset/base/270040 Log: MFC r269909: Add a knob LIBPTHREAD_BIGSTACK_MAIN, which instructs libthr to leave the whole RLIMIT_STACK-sized region of the kernel-allocated stack as the stack of main thread. Modified: stable/10/lib/libthr/thread/thr_init.c stable/10/lib/libthr/thread/thr_stack.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_init.c ============================================================================== --- stable/10/lib/libthr/thread/thr_init.c Sat Aug 16 08:37:13 2014 (r270039) +++ stable/10/lib/libthr/thread/thr_init.c Sat Aug 16 08:38:53 2014 (r270040) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -441,6 +442,7 @@ init_main_thread(struct pthread *thread) static void init_private(void) { + struct rlimit rlim; size_t len; int mib[2]; char *env; @@ -471,6 +473,12 @@ init_private(void) len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) PANIC("Cannot get kern.usrstack from sysctl"); + env = getenv("LIBPTHREAD_BIGSTACK_MAIN"); + if (env != NULL) { + if (getrlimit(RLIMIT_STACK, &rlim) == -1) + PANIC("Cannot get stack rlimit"); + _thr_stack_initial = rlim.rlim_cur; + } len = sizeof(_thr_is_smp); sysctlbyname("kern.smp.cpus", &_thr_is_smp, &len, NULL, 0); _thr_is_smp = (_thr_is_smp > 1); Modified: stable/10/lib/libthr/thread/thr_stack.c ============================================================================== --- stable/10/lib/libthr/thread/thr_stack.c Sat Aug 16 08:37:13 2014 (r270039) +++ stable/10/lib/libthr/thread/thr_stack.c Sat Aug 16 08:38:53 2014 (r270040) @@ -246,7 +246,10 @@ _thr_stack_alloc(struct pthread_attr *at THREAD_LIST_UNLOCK(curthread); } else { - /* Allocate a stack from usrstack. */ + /* + * Allocate a stack from or below usrstack, depending + * on the LIBPTHREAD_BIGSTACK_MAIN env variable. + */ if (last_stack == NULL) last_stack = _usrstack - _thr_stack_initial - _thr_guard_default; From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 10:47:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C01E313; Sat, 16 Aug 2014 10:47:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6790B2B40; Sat, 16 Aug 2014 10:47:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GAlPlM071098; Sat, 16 Aug 2014 10:47:25 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GAlPlj071097; Sat, 16 Aug 2014 10:47:25 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201408161047.s7GAlPlj071097@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Sat, 16 Aug 2014 10:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270041 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 10:47:25 -0000 Author: royger Date: Sat Aug 16 10:47:24 2014 New Revision: 270041 URL: http://svnweb.freebsd.org/changeset/base/270041 Log: net: move interface removal notification up in if_detach_internal This is needed to prevent having interfaces with ifp->if_addr == NULL on bridge interfaces. Moving the notification event handlers up makes sure the interfaces are removed before doing any more cleanup. Sponsored by: Citrix Systems R&D Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D598 net/if.c - Move interface removal notification up in if_detach_internal. Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Aug 16 08:38:53 2014 (r270040) +++ head/sys/net/if.c Sat Aug 16 10:47:24 2014 (r270041) @@ -874,6 +874,12 @@ if_detach_internal(struct ifnet *ifp, in #endif if_purgemaddrs(ifp); + /* Announce that the interface is gone. */ + rt_ifannouncemsg(ifp, IFAN_DEPARTURE); + EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); + if (IS_DEFAULT_VNET(curvnet)) + devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); + if (!vmove) { /* * Prevent further calls into the device driver via ifnet. @@ -911,11 +917,6 @@ if_detach_internal(struct ifnet *ifp, in } } - /* Announce that the interface is gone. */ - rt_ifannouncemsg(ifp, IFAN_DEPARTURE); - EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); - if (IS_DEFAULT_VNET(curvnet)) - devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); if_delgroups(ifp); /* From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 12:59:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5455D2F; Sat, 16 Aug 2014 12:59:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FA028BF; Sat, 16 Aug 2014 12:59:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GCxmi5028778; Sat, 16 Aug 2014 12:59:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GCxmNT028776; Sat, 16 Aug 2014 12:59:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161259.s7GCxmNT028776@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 12:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270042 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 12:59:49 -0000 Author: bz Date: Sat Aug 16 12:59:47 2014 New Revision: 270042 URL: http://svnweb.freebsd.org/changeset/base/270042 Log: MFC r269669: Split up sys_ktimer_getoverrun() into a sys_ and a kern_ variant and export the kern_ version needed by an upcoming linuxolator change. Sponsored by: DARPA,AFRL Modified: stable/10/sys/kern/kern_time.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_time.c ============================================================================== --- stable/10/sys/kern/kern_time.c Sat Aug 16 10:47:24 2014 (r270041) +++ stable/10/sys/kern/kern_time.c Sat Aug 16 12:59:47 2014 (r270042) @@ -1361,13 +1361,20 @@ struct timer_getoverrun_args { int sys_ktimer_getoverrun(struct thread *td, struct ktimer_getoverrun_args *uap) { + + return (kern_ktimer_getoverrun(td, uap->timerid)); +} + +int +kern_ktimer_getoverrun(struct thread *td, int timer_id) +{ struct proc *p = td->td_proc; struct itimer *it; int error ; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || + (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Aug 16 10:47:24 2014 (r270041) +++ stable/10/sys/sys/syscallsubr.h Sat Aug 16 12:59:47 2014 (r270042) @@ -239,6 +239,7 @@ int kern_ktimer_settime(struct thread *t struct itimerspec *val, struct itimerspec *oval); int kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val); +int kern_ktimer_getoverrun(struct thread *td, int timer_id); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:06:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E73EF89; Sat, 16 Aug 2014 13:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 374702982; Sat, 16 Aug 2014 13:06:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GD6COb033056; Sat, 16 Aug 2014 13:06:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GD6BlG033054; Sat, 16 Aug 2014 13:06:11 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161306.s7GD6BlG033054@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:06: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: r270043 - stable/10/sbin/mount_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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 13:06:12 -0000 Author: bz Date: Sat Aug 16 13:06:11 2014 New Revision: 270043 URL: http://svnweb.freebsd.org/changeset/base/270043 Log: MFC r269583: Provide -o vers= support for mount_nfs. Our mount_nfs does use -o nfsv<2|3|4> or -2 or -3 to specify the version. OSX (these days), Solaris, and Linux use -o vers=<2,3,4>. With the upcoming autofs support we can make a lot of (entrerprisy) setups getting mount options from LDAP just work by providing -o vers= compatibility. Reviewed by: wblock, bjk (man page), rmacklem, emaste Sponsored by: DARPA,AFRL PR: 192379 Modified: stable/10/sbin/mount_nfs/mount_nfs.8 stable/10/sbin/mount_nfs/mount_nfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- stable/10/sbin/mount_nfs/mount_nfs.8 Sat Aug 16 12:59:47 2014 (r270042) +++ stable/10/sbin/mount_nfs/mount_nfs.8 Sat Aug 16 13:06:11 2014 (r270043) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd December 7, 2013 +.Dd August 5, 2014 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -371,6 +371,14 @@ tune the timeout interval.) .It Cm udp Use UDP transport. +.It Cm vers Ns = Ns Aq Ar vers_number +Use the specified version number for NFS requests. +See the +.Cm nfsv2 , +.Cm nfsv3 , +and +.Cm nfsv4 +options for details. .It Cm wcommitsize Ns = Ns Aq Ar value Set the maximum pending write commit size to the specified value. This determines the maximum amount of pending write data that the NFS @@ -466,6 +474,26 @@ Same as Same as .Fl o Cm retrans Ns = Ns Aq Ar value .El +.Pp +The following +.Fl o +named options are equivalent to other +.Fl o +named options and are supported for compatibility with other +operating systems (e.g., Linux, Solaris, and OSX) to ease usage of +.Xr autofs 5 +support. +.Bl -tag -width indent +.It Fl o Cm vers Ns = Ns 2 +Same as +.Fl o Cm nfsv2 +.It Fl o Cm vers Ns = Ns 3 +Same as +.Fl o Cm nfsv3 +.It Fl o Cm vers Ns = Ns 4 +Same as +.Fl o Cm nfsv4 +.El .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , Modified: stable/10/sbin/mount_nfs/mount_nfs.c ============================================================================== --- stable/10/sbin/mount_nfs/mount_nfs.c Sat Aug 16 12:59:47 2014 (r270042) +++ stable/10/sbin/mount_nfs/mount_nfs.c Sat Aug 16 13:06:11 2014 (r270043) @@ -310,6 +310,32 @@ main(int argc, char *argv[]) if (*p || num <= 0) errx(1, "illegal maxgroups value -- %s", val); //set_rpc_maxgrouplist(num); + } else if (strcmp(opt, "vers") == 0) { + num = strtol(val, &p, 10); + if (*p || num <= 0) + errx(1, "illegal vers value -- " + "%s", val); + switch (num) { + case 2: + mountmode = V2; + break; + case 3: + mountmode = V3; + build_iovec(&iov, &iovlen, + "nfsv3", NULL, 0); + break; + case 4: + mountmode = V4; + fstype = "nfs"; + nfsproto = IPPROTO_TCP; + if (portspec == NULL) + portspec = "2049"; + break; + default: + errx(1, "illegal nfs version " + "value -- %s", val); + } + pass_flag_to_nmount=0; } if (pass_flag_to_nmount) build_iovec(&iov, &iovlen, opt, val, From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:09:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5A97168; Sat, 16 Aug 2014 13:09:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B122729A1; Sat, 16 Aug 2014 13:09:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GD9eoR033511; Sat, 16 Aug 2014 13:09:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GD9ejb033510; Sat, 16 Aug 2014 13:09:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161309.s7GD9ejb033510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270044 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:09:40 -0000 Author: bz Date: Sat Aug 16 13:09:40 2014 New Revision: 270044 URL: http://svnweb.freebsd.org/changeset/base/270044 Log: MFC r259884: Correct warnings comparing unsigned variables < 0 constantly reported while building kernels. All instances removed are indeed unsigned so the expressions could not be true. Modified: stable/10/sys/netinet6/in6_mcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6_mcast.c ============================================================================== --- stable/10/sys/netinet6/in6_mcast.c Sat Aug 16 13:06:11 2014 (r270043) +++ stable/10/sys/netinet6/in6_mcast.c Sat Aug 16 13:09:40 2014 (r270044) @@ -1849,8 +1849,7 @@ in6p_join_group(struct inpcb *inp, struc if (mreq.ipv6mr_interface == 0) { ifp = in6p_lookup_mcast_ifp(inp, &gsa->sin6); } else { - if (mreq.ipv6mr_interface < 0 || - V_if_index < mreq.ipv6mr_interface) + if (V_if_index < mreq.ipv6mr_interface) return (EADDRNOTAVAIL); ifp = ifnet_byindex(mreq.ipv6mr_interface); } @@ -2194,7 +2193,7 @@ in6p_leave_group(struct inpcb *inp, stru * XXX SCOPE6 lock potentially taken here. */ if (ifindex != 0) { - if (ifindex < 0 || V_if_index < ifindex) + if (V_if_index < ifindex) return (EADDRNOTAVAIL); ifp = ifnet_byindex(ifindex); if (ifp == NULL) @@ -2349,7 +2348,7 @@ in6p_set_multicast_if(struct inpcb *inp, error = sooptcopyin(sopt, &ifindex, sizeof(u_int), sizeof(u_int)); if (error) return (error); - if (ifindex < 0 || V_if_index < ifindex) + if (V_if_index < ifindex) return (EINVAL); ifp = ifnet_byindex(ifindex); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:12:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3188C2F3; Sat, 16 Aug 2014 13:12:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA552A3A; Sat, 16 Aug 2014 13:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDBxDh037047; Sat, 16 Aug 2014 13:11:59 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDBxkg037046; Sat, 16 Aug 2014 13:11:59 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161311.s7GDBxkg037046@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270045 - stable/10/sys/security/mac X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:12:00 -0000 Author: bz Date: Sat Aug 16 13:11:59 2014 New Revision: 270045 URL: http://svnweb.freebsd.org/changeset/base/270045 Log: MFC r259885: As constantly reported during kernel compilation, m_buflen is unsigned so can never be < 0. Remove the expression, which can never be true. Modified: stable/10/sys/security/mac/mac_framework.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/security/mac/mac_framework.c ============================================================================== --- stable/10/sys/security/mac/mac_framework.c Sat Aug 16 13:09:40 2014 (r270044) +++ stable/10/sys/security/mac/mac_framework.c Sat Aug 16 13:11:59 2014 (r270045) @@ -587,8 +587,7 @@ int mac_check_structmac_consistent(struct mac *mac) { - if (mac->m_buflen < 0 || - mac->m_buflen > MAC_MAX_LABEL_BUF_LEN) + if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN) return (EINVAL); return (0); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:13:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4854842E; Sat, 16 Aug 2014 13:13:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33B502A42; Sat, 16 Aug 2014 13:13:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDDIUO037279; Sat, 16 Aug 2014 13:13:18 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDDIk6037278; Sat, 16 Aug 2014 13:13:18 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201408161313.s7GDDIk6037278@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sat, 16 Aug 2014 13:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270046 - head/sys/dev/virtio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 13:13:18 -0000 Author: luigi Date: Sat Aug 16 13:13:17 2014 New Revision: 270046 URL: http://svnweb.freebsd.org/changeset/base/270046 Log: print additional debugging info in virtqueue_dump() (not fundamental, but useful to debug performance issues on vtnet) MFC after: 3 days Modified: head/sys/dev/virtio/virtqueue.c Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Sat Aug 16 13:11:59 2014 (r270045) +++ head/sys/dev/virtio/virtqueue.c Sat Aug 16 13:13:17 2014 (r270046) @@ -605,11 +605,13 @@ virtqueue_dump(struct virtqueue *vq) printf("VQ: %s - size=%d; free=%d; used=%d; queued=%d; " "desc_head_idx=%d; avail.idx=%d; used_cons_idx=%d; " - "used.idx=%d; avail.flags=0x%x; used.flags=0x%x\n", + "used.idx=%d; used_event_idx=%d; avail.flags=0x%x; used.flags=0x%x\n", vq->vq_name, vq->vq_nentries, vq->vq_free_cnt, virtqueue_nused(vq), vq->vq_queued_cnt, vq->vq_desc_head_idx, vq->vq_ring.avail->idx, vq->vq_used_cons_idx, - vq->vq_ring.used->idx, vq->vq_ring.avail->flags, + vq->vq_ring.used->idx, + vring_used_event(&vq->vq_ring), + vq->vq_ring.avail->flags, vq->vq_ring.used->flags); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:18:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 963645EB; Sat, 16 Aug 2014 13:18:14 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CAA042A7A; Sat, 16 Aug 2014 13:18:13 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5E25D25D3815; Sat, 16 Aug 2014 13:18:10 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 45E36C27A08; Sat, 16 Aug 2014 13:18:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id wH-MLDfwvxV9; Sat, 16 Aug 2014 13:17:58 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C965FC249B9; Sat, 16 Aug 2014 13:17:54 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r265946 - in stable/10: lib/libc/net sys/netinet sys/netinet6 sys/sys From: "Bjoern A. Zeeb" In-Reply-To: <201405130605.s4D65rsn092973@svn.freebsd.org> Date: Sat, 16 Aug 2014 13:17:48 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <13DBB4CD-1A87-4AD9-B1D9-8A709C143C20@FreeBSD.org> References: <201405130605.s4D65rsn092973@svn.freebsd.org> To: Kevin Lo X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:18:14 -0000 On 13 May 2014, at 06:05 , Kevin Lo wrote: > Author: kevlo > Date: Tue May 13 06:05:53 2014 > New Revision: 265946 > URL: http://svnweb.freebsd.org/changeset/base/265946 >=20 > Log: > MFC r264212,r264213,r264248,r265776,r265811,r265909: Just for the records; this commit also merged unrelated r259887: Add more (IPv6) related Internet Protocols: - Host Identity Protocol (RFC5201) - Shim6 Protocol (RFC5533) - 2x experimentation and testing (RFC3692, RFC4727) This does not indicate interest to implement/support these protocols, but they are part of the "IPv6 Extension Header Types" [1] based on = RFC7045 and might thus be needed by filtering and next header parsing implementations. References: [1] http://www.iana.org/assignments/ipv6-parameters Obtained from: http://www.iana.org/assignments/protocol-numbers >=20 > - Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 = stacks. > Tested with vlc and a test suite [1]. > [1] = http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz >=20 > Reviewed by: jhb, glebius, adrian >=20 > - Fix a logic bug which prevented the sending of UDP packet with 0 = checksum. >=20 > - Disable TX checksum offload for UDP-Lite completely. It wasn't used = for > partial checksum coverage, but even for full checksum coverage it = doesn't > work. >=20 > Added: > stable/10/sys/netinet/udplite.h > - copied unchanged from r264212, head/sys/netinet/udplite.h > Modified: > stable/10/lib/libc/net/getaddrinfo.c > stable/10/sys/netinet/in.c > stable/10/sys/netinet/in.h > stable/10/sys/netinet/in_pcb.c > stable/10/sys/netinet/in_proto.c > stable/10/sys/netinet/udp_usrreq.c > stable/10/sys/netinet/udp_var.h > stable/10/sys/netinet6/in6_ifattach.c > stable/10/sys/netinet6/in6_proto.c > stable/10/sys/netinet6/udp6_usrreq.c > stable/10/sys/netinet6/udp6_var.h > stable/10/sys/sys/param.h > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/lib/libc/net/getaddrinfo.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 > --- stable/10/lib/libc/net/getaddrinfo.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/lib/libc/net/getaddrinfo.c Tue May 13 06:05:53 2014 = (r265946) > @@ -170,12 +170,14 @@ static const struct explore explore[] =3D=20 > { PF_INET6, SOCK_STREAM, IPPROTO_TCP, 0x07 }, > { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, > { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, > + { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, > { PF_INET6, SOCK_RAW, ANY, 0x05 }, > #endif > { PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0x07 }, > { PF_INET, SOCK_STREAM, IPPROTO_TCP, 0x07 }, > { PF_INET, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, > { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, > + { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, > { PF_INET, SOCK_RAW, ANY, 0x05 }, > { -1, 0, 0, 0 }, > }; > @@ -1477,6 +1479,9 @@ get_port(struct addrinfo *ai, const char > case IPPROTO_SCTP: > proto =3D "sctp"; > break; > + case IPPROTO_UDPLITE: > + proto =3D "udplite"; > + break; > default: > proto =3D NULL; > break; >=20 > Modified: stable/10/sys/netinet/in.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 > --- stable/10/sys/netinet/in.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet/in.c Tue May 13 06:05:53 2014 = (r265946) > @@ -1167,6 +1167,7 @@ in_ifdetach(struct ifnet *ifp) >=20 > in_pcbpurgeif0(&V_ripcbinfo, ifp); > in_pcbpurgeif0(&V_udbinfo, ifp); > + in_pcbpurgeif0(&V_ulitecbinfo, ifp); > in_purgemaddrs(ifp); > } >=20 >=20 > Modified: stable/10/sys/netinet/in.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/10/sys/netinet/in.h Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet/in.h Tue May 13 06:05:53 2014 = (r265946) > @@ -237,12 +237,17 @@ __END_DECLS > #define IPPROTO_IPCOMP 108 /* payload = compression (IPComp) */ > #define IPPROTO_SCTP 132 /* SCTP */ > #define IPPROTO_MH 135 /* IPv6 Mobility = Header */ > +#define IPPROTO_UDPLITE 136 /* UDP-Lite */ > +#define IPPROTO_HIP 139 /* IP6 Host = Identity Protocol */ > +#define IPPROTO_SHIM6 140 /* IP6 Shim6 = Protocol */ > /* 101-254: Partly Unassigned */ > #define IPPROTO_PIM 103 /* Protocol = Independent Mcast */ > #define IPPROTO_CARP 112 /* CARP */ > #define IPPROTO_PGM 113 /* PGM */ > #define IPPROTO_MPLS 137 /* MPLS-in-IP */ > #define IPPROTO_PFSYNC 240 /* PFSYNC */ > +#define IPPROTO_RESERVED_253 253 /* Reserved */ > +#define IPPROTO_RESERVED_254 254 /* Reserved */ > /* 255: Reserved */ > /* BSD Private, local use, namespace incursion, no longer used */ > #define IPPROTO_OLD_DIVERT 254 /* OLD divert = pseudo-proto */ >=20 > Modified: stable/10/sys/netinet/in_pcb.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 > --- stable/10/sys/netinet/in_pcb.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet/in_pcb.c Tue May 13 06:05:53 2014 = (r265946) > @@ -386,13 +386,14 @@ in_pcb_lport(struct inpcb *inp, struct i > lastport =3D &pcbinfo->ipi_lastport; > } > /* > - * For UDP, use random port allocation as long as the user > + * For UDP(-Lite), use random port allocation as long as the = user > * allows it. For TCP (and as of yet unknown) connections, > * use random port allocation only if the user allows it AND > * ipport_tick() allows it. > */ > if (V_ipport_randomized && > - (!V_ipport_stoprandom || pcbinfo =3D=3D &V_udbinfo)) > + (!V_ipport_stoprandom || pcbinfo =3D=3D &V_udbinfo || > + pcbinfo =3D=3D &V_ulitecbinfo)) > dorandom =3D 1; > else > dorandom =3D 0; > @@ -402,8 +403,8 @@ in_pcb_lport(struct inpcb *inp, struct i > */ > if (first =3D=3D last) > dorandom =3D 0; > - /* Make sure to not include UDP packets in the count. */ > - if (pcbinfo !=3D &V_udbinfo) > + /* Make sure to not include UDP(-Lite) packets in the count. */ > + if (pcbinfo !=3D &V_udbinfo || pcbinfo !=3D &V_ulitecbinfo) > V_ipport_tcpallocs++; > /* > * Instead of having two loops further down counting up or down >=20 > Modified: stable/10/sys/netinet/in_proto.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 > --- stable/10/sys/netinet/in_proto.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet/in_proto.c Tue May 13 06:05:53 2014 = (r265946) > @@ -184,6 +184,20 @@ struct protosw inetsw[] =3D { > }, > #endif /* SCTP */ > { > + .pr_type =3D SOCK_DGRAM, > + .pr_domain =3D &inetdomain, > + .pr_protocol =3D IPPROTO_UDPLITE, > + .pr_flags =3D PR_ATOMIC|PR_ADDR, > + .pr_input =3D udp_input, > + .pr_ctlinput =3D udplite_ctlinput, > + .pr_ctloutput =3D udp_ctloutput, > + .pr_init =3D udplite_init, > +#ifdef VIMAGE > + .pr_destroy =3D udplite_destroy, > +#endif > + .pr_usrreqs =3D &udp_usrreqs > +}, > +{ > .pr_type =3D SOCK_RAW, > .pr_domain =3D &inetdomain, > .pr_protocol =3D IPPROTO_RAW, >=20 > Modified: stable/10/sys/netinet/udp_usrreq.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 > --- stable/10/sys/netinet/udp_usrreq.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet/udp_usrreq.c Tue May 13 06:05:53 2014 = (r265946) > @@ -3,6 +3,7 @@ > * The Regents of the University of California. > * Copyright (c) 2008 Robert N. M. Watson > * Copyright (c) 2010-2011 Juniper Networks, Inc. > + * Copyright (c) 2014 Kevin Lo > * All rights reserved. > * > * Portions of this software were developed by Robert N. M. Watson = under > @@ -87,6 +88,7 @@ __FBSDID("$FreeBSD$"); > #endif > #include > #include > +#include >=20 > #ifdef IPSEC > #include > @@ -98,8 +100,9 @@ __FBSDID("$FreeBSD$"); > #include >=20 > /* > - * UDP protocol implementation. > + * UDP and UDP-Lite protocols implementation. > * Per RFC 768, August, 1980. > + * Per RFC 3828, July, 2004. > */ >=20 > /* > @@ -139,6 +142,8 @@ SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVS >=20 > VNET_DEFINE(struct inpcbhead, udb); /* from udp_var.h */ > VNET_DEFINE(struct inpcbinfo, udbinfo); > +VNET_DEFINE(struct inpcbhead, ulitecb); > +VNET_DEFINE(struct inpcbinfo, ulitecbinfo); > static VNET_DEFINE(uma_zone_t, udpcb_zone); > #define V_udpcb_zone VNET(udpcb_zone) >=20 > @@ -187,6 +192,16 @@ udp_inpcb_init(void *mem, int size, int=20 > return (0); > } >=20 > +static int > +udplite_inpcb_init(void *mem, int size, int flags) > +{ > + struct inpcb *inp; > + > + inp =3D mem; > + INP_LOCK_INIT(inp, "inp", "udpliteinp"); > + return (0); > +} > + > void > udp_init(void) > { > @@ -202,6 +217,15 @@ udp_init(void) > EVENTHANDLER_PRI_ANY); > } >=20 > +void > +udplite_init(void) > +{ > + > + in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, = UDBHASHSIZE, > + UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, NULL, > + UMA_ZONE_NOFREE, IPI_HASHFIELDS_2TUPLE); > +} > + > /* > * Kernel module interface for updating udpstat. The argument is an = index > * into udpstat treated as an array of u_long. While this encodes the > @@ -243,6 +267,13 @@ udp_destroy(void) > in_pcbinfo_destroy(&V_udbinfo); > uma_zdestroy(V_udpcb_zone); > } > + > +void > +udplite_destroy(void) > +{ > + > + in_pcbinfo_destroy(&V_ulitecbinfo); > +} > #endif >=20 > #ifdef INET > @@ -346,9 +377,12 @@ udp_input(struct mbuf *m, int off) > struct ifnet *ifp; > struct inpcb *inp; > uint16_t len, ip_len; > + struct inpcbinfo *pcbinfo; > struct ip save_ip; > struct sockaddr_in udp_in; > struct m_tag *fwd_tag; > + int cscov_partial; > + uint8_t pr; >=20 > ifp =3D m->m_pkthdr.rcvif; > UDPSTAT_INC(udps_ipackets); > @@ -368,13 +402,15 @@ udp_input(struct mbuf *m, int off) > */ > ip =3D mtod(m, struct ip *); > if (m->m_len < iphlen + sizeof(struct udphdr)) { > - if ((m =3D m_pullup(m, iphlen + sizeof(struct udphdr))) = =3D=3D 0) { > + if ((m =3D m_pullup(m, iphlen + sizeof(struct udphdr))) = =3D=3D NULL) { > UDPSTAT_INC(udps_hdrops); > return; > } > ip =3D mtod(m, struct ip *); > } > uh =3D (struct udphdr *)((caddr_t)ip + iphlen); > + pr =3D ip->ip_p; > + cscov_partial =3D (pr =3D=3D IPPROTO_UDPLITE) ? 1 : 0; >=20 > /* > * Destination port of 0 is illegal, based on RFC768. > @@ -398,12 +434,18 @@ udp_input(struct mbuf *m, int off) > */ > len =3D ntohs((u_short)uh->uh_ulen); > ip_len =3D ntohs(ip->ip_len) - iphlen; > + if (pr =3D=3D IPPROTO_UDPLITE && len =3D=3D 0) { > + /* Zero means checksum over the complete packet. */ > + len =3D ip_len; > + cscov_partial =3D 0; > + } > if (ip_len !=3D len) { > if (len > ip_len || len < sizeof(struct udphdr)) { > UDPSTAT_INC(udps_badlen); > goto badunlocked; > } > - m_adj(m, len - ip_len); > + if (pr =3D=3D IPPROTO_UDP) > + m_adj(m, len - ip_len); > } >=20 > /* > @@ -421,20 +463,22 @@ udp_input(struct mbuf *m, int off) > if (uh->uh_sum) { > u_short uh_sum; >=20 > - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { > + if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID) && > + !cscov_partial) { > if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) > uh_sum =3D m->m_pkthdr.csum_data; > else > uh_sum =3D in_pseudo(ip->ip_src.s_addr, > ip->ip_dst.s_addr, = htonl((u_short)len + > - m->m_pkthdr.csum_data + = IPPROTO_UDP)); > + m->m_pkthdr.csum_data + pr)); > uh_sum ^=3D 0xffff; > } else { > char b[9]; >=20 > bcopy(((struct ipovly *)ip)->ih_x1, b, 9); > bzero(((struct ipovly *)ip)->ih_x1, 9); > - ((struct ipovly *)ip)->ih_len =3D uh->uh_ulen; > + ((struct ipovly *)ip)->ih_len =3D (pr =3D=3D = IPPROTO_UDP) ? > + uh->uh_ulen : htons(ip_len); > uh_sum =3D in_cksum(m, len + sizeof (struct = ip)); > bcopy(b, ((struct ipovly *)ip)->ih_x1, 9); > } > @@ -446,14 +490,17 @@ udp_input(struct mbuf *m, int off) > } else > UDPSTAT_INC(udps_nosum); >=20 > + pcbinfo =3D get_inpcbinfo(pr); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > in_broadcast(ip->ip_dst, ifp)) { > struct inpcb *last; > + struct inpcbhead *pcblist; > struct ip_moptions *imo; >=20 > - INP_INFO_RLOCK(&V_udbinfo); > + INP_INFO_RLOCK(pcbinfo); > + pcblist =3D get_pcblist(pr); > last =3D NULL; > - LIST_FOREACH(inp, &V_udb, inp_list) { > + LIST_FOREACH(inp, pcblist, inp_list) { > if (inp->inp_lport !=3D uh->uh_dport) > continue; > #ifdef INET6 > @@ -539,12 +586,12 @@ udp_input(struct mbuf *m, int off) > UDPSTAT_INC(udps_noportbcast); > if (inp) > INP_RUNLOCK(inp); > - INP_INFO_RUNLOCK(&V_udbinfo); > + INP_INFO_RUNLOCK(pcbinfo); > goto badunlocked; > } > udp_append(last, ip, m, iphlen, &udp_in); > INP_RUNLOCK(last); > - INP_INFO_RUNLOCK(&V_udbinfo); > + INP_INFO_RUNLOCK(pcbinfo); > return; > } >=20 > @@ -565,7 +612,7 @@ udp_input(struct mbuf *m, int off) > * Transparently forwarded. Pretend to be the = destination. > * Already got one like this? > */ > - inp =3D in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, = uh->uh_sport, > + inp =3D in_pcblookup_mbuf(pcbinfo, ip->ip_src, = uh->uh_sport, > ip->ip_dst, uh->uh_dport, INPLOOKUP_RLOCKPCB, ifp, = m); > if (!inp) { > /* > @@ -573,7 +620,7 @@ udp_input(struct mbuf *m, int off) > * Because we've rewritten the destination = address, > * any hardware-generated hash is ignored. > */ > - inp =3D in_pcblookup(&V_udbinfo, ip->ip_src, > + inp =3D in_pcblookup(pcbinfo, ip->ip_src, > uh->uh_sport, next_hop->sin_addr, > next_hop->sin_port ? = htons(next_hop->sin_port) : > uh->uh_dport, INPLOOKUP_WILDCARD | > @@ -583,7 +630,7 @@ udp_input(struct mbuf *m, int off) > m_tag_delete(m, fwd_tag); > m->m_flags &=3D ~M_IP_NEXTHOP; > } else > - inp =3D in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, = uh->uh_sport, > + inp =3D in_pcblookup_mbuf(pcbinfo, ip->ip_src, = uh->uh_sport, > ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | > INPLOOKUP_RLOCKPCB, ifp, m); > if (inp =3D=3D NULL) { > @@ -619,6 +666,16 @@ udp_input(struct mbuf *m, int off) > m_freem(m); > return; > } > + if (cscov_partial) { > + struct udpcb *up; > + > + up =3D intoudpcb(inp); > + if (up->u_rxcslen > len) { > + INP_RUNLOCK(inp); > + m_freem(m); > + return; > + } > + } >=20 > UDP_PROBE(receive, NULL, inp, ip, inp, uh); > udp_append(inp, ip, m, iphlen, &udp_in); > @@ -653,8 +710,9 @@ udp_notify(struct inpcb *inp, int errno) > } >=20 > #ifdef INET > -void > -udp_ctlinput(int cmd, struct sockaddr *sa, void *vip) > +static void > +udp_common_ctlinput(int cmd, struct sockaddr *sa, void *vip, > + struct inpcbinfo *pcbinfo) > { > struct ip *ip =3D vip; > struct udphdr *uh; > @@ -683,7 +741,7 @@ udp_ctlinput(int cmd, struct sockaddr *s > return; > if (ip !=3D NULL) { > uh =3D (struct udphdr *)((caddr_t)ip + (ip->ip_hl << = 2)); > - inp =3D in_pcblookup(&V_udbinfo, faddr, uh->uh_dport, > + inp =3D in_pcblookup(pcbinfo, faddr, uh->uh_dport, > ip->ip_src, uh->uh_sport, INPLOOKUP_RLOCKPCB, NULL); > if (inp !=3D NULL) { > INP_RLOCK_ASSERT(inp); > @@ -693,9 +751,22 @@ udp_ctlinput(int cmd, struct sockaddr *s > INP_RUNLOCK(inp); > } > } else > - in_pcbnotifyall(&V_udbinfo, faddr, inetctlerrmap[cmd], > + in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd], > udp_notify); > } > +void > +udp_ctlinput(int cmd, struct sockaddr *sa, void *vip) > +{ > + > + return (udp_common_ctlinput(cmd, sa, vip, &V_udbinfo)); > +} > + > +void > +udplite_ctlinput(int cmd, struct sockaddr *sa, void *vip) > +{ > + > + return (udp_common_ctlinput(cmd, sa, vip, &V_ulitecbinfo)); > +} > #endif /* INET */ >=20 > static int > @@ -851,16 +922,16 @@ SYSCTL_PROC(_net_inet_udp, OID_AUTO, get > int > udp_ctloutput(struct socket *so, struct sockopt *sopt) > { > - int error =3D 0, optval; > struct inpcb *inp; > -#ifdef IPSEC_NAT_T > struct udpcb *up; > -#endif > + int isudplite, error, optval; >=20 > + error =3D 0; > + isudplite =3D (so->so_proto->pr_protocol =3D=3D IPPROTO_UDPLITE) = ? 1 : 0; > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("%s: inp =3D=3D NULL", __func__)); > INP_WLOCK(inp); > - if (sopt->sopt_level !=3D IPPROTO_UDP) { > + if (sopt->sopt_level !=3D so->so_proto->pr_protocol) { > #ifdef INET6 > if (INP_CHECK_SOCKAF(so, AF_INET6)) { > INP_WUNLOCK(inp); > @@ -918,6 +989,34 @@ udp_ctloutput(struct socket *so, struct=20 > } > INP_WUNLOCK(inp); > break; > + case UDPLITE_SEND_CSCOV: > + case UDPLITE_RECV_CSCOV: > + if (!isudplite) { > + INP_WUNLOCK(inp); > + error =3D ENOPROTOOPT; > + break; > + } > + INP_WUNLOCK(inp); > + error =3D sooptcopyin(sopt, &optval, = sizeof(optval), > + sizeof(optval)); > + if (error !=3D 0) > + break; > + inp =3D sotoinpcb(so); > + KASSERT(inp !=3D NULL, ("%s: inp =3D=3D NULL", = __func__)); > + INP_WLOCK(inp); > + up =3D intoudpcb(inp); > + KASSERT(up !=3D NULL, ("%s: up =3D=3D NULL", = __func__)); > + if (optval !=3D 0 && optval < 8) { > + INP_WUNLOCK(inp); > + error =3D EINVAL; > + break; > + } > + if (sopt->sopt_name =3D=3D UDPLITE_SEND_CSCOV) > + up->u_txcslen =3D optval; > + else > + up->u_rxcslen =3D optval; > + INP_WUNLOCK(inp); > + break; > default: > INP_WUNLOCK(inp); > error =3D ENOPROTOOPT; > @@ -935,6 +1034,22 @@ udp_ctloutput(struct socket *so, struct=20 > error =3D sooptcopyout(sopt, &optval, sizeof = optval); > break; > #endif > + case UDPLITE_SEND_CSCOV: > + case UDPLITE_RECV_CSCOV: > + if (!isudplite) { > + INP_WUNLOCK(inp); > + error =3D ENOPROTOOPT; > + break; > + } > + up =3D intoudpcb(inp); > + KASSERT(up !=3D NULL, ("%s: up =3D=3D NULL", = __func__)); > + if (sopt->sopt_name =3D=3D UDPLITE_SEND_CSCOV) > + optval =3D up->u_txcslen; > + else > + optval =3D up->u_rxcslen; > + INP_WUNLOCK(inp); > + error =3D sooptcopyout(sopt, &optval, = sizeof(optval)); > + break; > default: > INP_WUNLOCK(inp); > error =3D ENOPROTOOPT; > @@ -957,12 +1072,16 @@ udp_output(struct inpcb *inp, struct mbu > int len =3D m->m_pkthdr.len; > struct in_addr faddr, laddr; > struct cmsghdr *cm; > + struct inpcbinfo *pcbinfo; > struct sockaddr_in *sin, src; > + int cscov_partial =3D 0; > int error =3D 0; > int ipflags; > u_short fport, lport; > int unlock_udbinfo; > u_char tos; > + uint8_t pr; > + uint16_t cscov =3D 0; >=20 > /* > * udp_output() may need to temporarily bind or connect the = current > @@ -1057,12 +1176,14 @@ udp_output(struct inpcb *inp, struct mbu > * > * XXXRW: Check that hash locking update here is correct. > */ > + pr =3D inp->inp_socket->so_proto->pr_protocol; > + pcbinfo =3D get_inpcbinfo(pr); > sin =3D (struct sockaddr_in *)addr; > if (sin !=3D NULL && > (inp->inp_laddr.s_addr =3D=3D INADDR_ANY && inp->inp_lport = =3D=3D 0)) { > INP_RUNLOCK(inp); > INP_WLOCK(inp); > - INP_HASH_WLOCK(&V_udbinfo); > + INP_HASH_WLOCK(pcbinfo); > unlock_udbinfo =3D UH_WLOCKED; > } else if ((sin !=3D NULL && ( > (sin->sin_addr.s_addr =3D=3D INADDR_ANY) || > @@ -1070,7 +1191,7 @@ udp_output(struct inpcb *inp, struct mbu > (inp->inp_laddr.s_addr =3D=3D INADDR_ANY) || > (inp->inp_lport =3D=3D 0))) || > (src.sin_family =3D=3D AF_INET)) { > - INP_HASH_RLOCK(&V_udbinfo); > + INP_HASH_RLOCK(pcbinfo); > unlock_udbinfo =3D UH_RLOCKED; > } else > unlock_udbinfo =3D UH_UNLOCKED; > @@ -1083,7 +1204,7 @@ udp_output(struct inpcb *inp, struct mbu > laddr =3D inp->inp_laddr; > lport =3D inp->inp_lport; > if (src.sin_family =3D=3D AF_INET) { > - INP_HASH_LOCK_ASSERT(&V_udbinfo); > + INP_HASH_LOCK_ASSERT(pcbinfo); > if ((lport =3D=3D 0) || > (laddr.s_addr =3D=3D INADDR_ANY && > src.sin_addr.s_addr =3D=3D INADDR_ANY)) { > @@ -1134,7 +1255,7 @@ udp_output(struct inpcb *inp, struct mbu > inp->inp_lport =3D=3D 0 || > sin->sin_addr.s_addr =3D=3D INADDR_ANY || > sin->sin_addr.s_addr =3D=3D INADDR_BROADCAST) { > - INP_HASH_LOCK_ASSERT(&V_udbinfo); > + INP_HASH_LOCK_ASSERT(pcbinfo); > error =3D in_pcbconnect_setup(inp, addr, = &laddr.s_addr, > &lport, &faddr.s_addr, &fport, NULL, > td->td_ucred); > @@ -1149,7 +1270,7 @@ udp_output(struct inpcb *inp, struct mbu > if (inp->inp_laddr.s_addr =3D=3D INADDR_ANY && > inp->inp_lport =3D=3D 0) { > INP_WLOCK_ASSERT(inp); > - INP_HASH_WLOCK_ASSERT(&V_udbinfo); > + INP_HASH_WLOCK_ASSERT(pcbinfo); > /* > * Remember addr if jailed, to prevent > * rebinding. > @@ -1198,13 +1319,30 @@ udp_output(struct inpcb *inp, struct mbu > */ > ui =3D mtod(m, struct udpiphdr *); > bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */ > - ui->ui_v =3D IPVERSION << 4; > - ui->ui_pr =3D IPPROTO_UDP; > + ui->ui_pr =3D pr; > ui->ui_src =3D laddr; > ui->ui_dst =3D faddr; > ui->ui_sport =3D lport; > ui->ui_dport =3D fport; > ui->ui_ulen =3D htons((u_short)len + sizeof(struct udphdr)); > + if (pr =3D=3D IPPROTO_UDPLITE) { > + struct udpcb *up; > + uint16_t plen; > + > + up =3D intoudpcb(inp); > + cscov =3D up->u_txcslen; > + plen =3D (u_short)len + sizeof(struct udphdr); > + if (cscov >=3D plen) > + cscov =3D 0; > + ui->ui_len =3D htons(plen); > + ui->ui_ulen =3D htons(cscov); > + /* > + * For UDP-Lite, checksum coverage length of zero means > + * the entire UDPLite packet is covered by the checksum. > + */ > + cscov_partial =3D (cscov =3D=3D 0) ? 0 : 1; > + } else > + ui->ui_v =3D IPVERSION << 4; >=20 > /* > * Set the Don't Fragment bit in the IP header. > @@ -1231,24 +1369,34 @@ udp_output(struct inpcb *inp, struct mbu > /* > * Set up checksum and output datagram. > */ > - if (V_udp_cksum) { > + ui->ui_sum =3D 0; > + if (pr =3D=3D IPPROTO_UDPLITE) { > + if (inp->inp_flags & INP_ONESBCAST) > + faddr.s_addr =3D INADDR_BROADCAST; > + if (cscov_partial) { > + if ((ui->ui_sum =3D in_cksum(m, sizeof(struct = ip) + cscov)) =3D=3D 0) > + ui->ui_sum =3D 0xffff; > + } else { > + if ((ui->ui_sum =3D in_cksum(m, sizeof(struct = udpiphdr) + len)) =3D=3D 0) > + ui->ui_sum =3D 0xffff; > + } > + } else if (V_udp_cksum) { > if (inp->inp_flags & INP_ONESBCAST) > faddr.s_addr =3D INADDR_BROADCAST; > ui->ui_sum =3D in_pseudo(ui->ui_src.s_addr, = faddr.s_addr, > - htons((u_short)len + sizeof(struct udphdr) + = IPPROTO_UDP)); > + htons((u_short)len + sizeof(struct udphdr) + pr)); > m->m_pkthdr.csum_flags =3D CSUM_UDP; > m->m_pkthdr.csum_data =3D offsetof(struct udphdr, = uh_sum); > - } else > - ui->ui_sum =3D 0; > + } > ((struct ip *)ui)->ip_len =3D htons(sizeof(struct udpiphdr) + = len); > ((struct ip *)ui)->ip_ttl =3D inp->inp_ip_ttl; /* XXX */ > ((struct ip *)ui)->ip_tos =3D tos; /* XXX */ > UDPSTAT_INC(udps_opackets); >=20 > if (unlock_udbinfo =3D=3D UH_WLOCKED) > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > else if (unlock_udbinfo =3D=3D UH_RLOCKED) > - INP_HASH_RUNLOCK(&V_udbinfo); > + INP_HASH_RUNLOCK(pcbinfo); > UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); > error =3D ip_output(m, inp->inp_options, NULL, ipflags, > inp->inp_moptions, inp); > @@ -1260,10 +1408,10 @@ udp_output(struct inpcb *inp, struct mbu >=20 > release: > if (unlock_udbinfo =3D=3D UH_WLOCKED) { > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > INP_WUNLOCK(inp); > } else if (unlock_udbinfo =3D=3D UH_RLOCKED) { > - INP_HASH_RUNLOCK(&V_udbinfo); > + INP_HASH_RUNLOCK(pcbinfo); > INP_RUNLOCK(inp); > } else > INP_RUNLOCK(inp); > @@ -1410,15 +1558,17 @@ static void > udp_abort(struct socket *so) > { > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("udp_abort: inp =3D=3D NULL")); > INP_WLOCK(inp); > if (inp->inp_faddr.s_addr !=3D INADDR_ANY) { > - INP_HASH_WLOCK(&V_udbinfo); > + INP_HASH_WLOCK(pcbinfo); > in_pcbdisconnect(inp); > inp->inp_laddr.s_addr =3D INADDR_ANY; > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > soisdisconnected(so); > } > INP_WUNLOCK(inp); > @@ -1428,17 +1578,19 @@ static int > udp_attach(struct socket *so, int proto, struct thread *td) > { > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; > int error; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp =3D=3D NULL, ("udp_attach: inp !=3D NULL")); > error =3D soreserve(so, udp_sendspace, udp_recvspace); > if (error) > return (error); > - INP_INFO_WLOCK(&V_udbinfo); > - error =3D in_pcballoc(so, &V_udbinfo); > + INP_INFO_WLOCK(pcbinfo); > + error =3D in_pcballoc(so, pcbinfo); > if (error) { > - INP_INFO_WUNLOCK(&V_udbinfo); > + INP_INFO_WUNLOCK(pcbinfo); > return (error); > } >=20 > @@ -1450,12 +1602,12 @@ udp_attach(struct socket *so, int proto, > if (error) { > in_pcbdetach(inp); > in_pcbfree(inp); > - INP_INFO_WUNLOCK(&V_udbinfo); > + INP_INFO_WUNLOCK(pcbinfo); > return (error); > } >=20 > INP_WUNLOCK(inp); > - INP_INFO_WUNLOCK(&V_udbinfo); > + INP_INFO_WUNLOCK(pcbinfo); > return (0); > } > #endif /* INET */ > @@ -1486,14 +1638,16 @@ static int > udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) > { > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; > int error; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("udp_bind: inp =3D=3D NULL")); > INP_WLOCK(inp); > - INP_HASH_WLOCK(&V_udbinfo); > + INP_HASH_WLOCK(pcbinfo); > error =3D in_pcbbind(inp, nam, td->td_ucred); > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > INP_WUNLOCK(inp); > return (error); > } > @@ -1502,15 +1656,17 @@ static void > udp_close(struct socket *so) > { > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("udp_close: inp =3D=3D NULL")); > INP_WLOCK(inp); > if (inp->inp_faddr.s_addr !=3D INADDR_ANY) { > - INP_HASH_WLOCK(&V_udbinfo); > + INP_HASH_WLOCK(pcbinfo); > in_pcbdisconnect(inp); > inp->inp_laddr.s_addr =3D INADDR_ANY; > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > soisdisconnected(so); > } > INP_WUNLOCK(inp); > @@ -1520,9 +1676,11 @@ static int > udp_connect(struct socket *so, struct sockaddr *nam, struct thread = *td) > { > struct inpcb *inp; > - int error; > + struct inpcbinfo *pcbinfo; > struct sockaddr_in *sin; > + int error; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("udp_connect: inp =3D=3D NULL")); > INP_WLOCK(inp); > @@ -1536,9 +1694,9 @@ udp_connect(struct socket *so, struct so > INP_WUNLOCK(inp); > return (error); > } > - INP_HASH_WLOCK(&V_udbinfo); > + INP_HASH_WLOCK(pcbinfo); > error =3D in_pcbconnect(inp, nam, td->td_ucred); > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > if (error =3D=3D 0) > soisconnected(so); > INP_WUNLOCK(inp); > @@ -1549,20 +1707,22 @@ static void > udp_detach(struct socket *so) > { > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; > struct udpcb *up; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("udp_detach: inp =3D=3D NULL")); > KASSERT(inp->inp_faddr.s_addr =3D=3D INADDR_ANY, > ("udp_detach: not disconnected")); > - INP_INFO_WLOCK(&V_udbinfo); > + INP_INFO_WLOCK(pcbinfo); > INP_WLOCK(inp); > up =3D intoudpcb(inp); > KASSERT(up !=3D NULL, ("%s: up =3D=3D NULL", __func__)); > inp->inp_ppcb =3D NULL; > in_pcbdetach(inp); > in_pcbfree(inp); > - INP_INFO_WUNLOCK(&V_udbinfo); > + INP_INFO_WUNLOCK(pcbinfo); > udp_discardcb(up); > } >=20 > @@ -1570,7 +1730,9 @@ static int > udp_disconnect(struct socket *so) > { > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; >=20 > + pcbinfo =3D get_inpcbinfo(so->so_proto->pr_protocol); > inp =3D sotoinpcb(so); > KASSERT(inp !=3D NULL, ("udp_disconnect: inp =3D=3D NULL")); > INP_WLOCK(inp); > @@ -1578,10 +1740,10 @@ udp_disconnect(struct socket *so) > INP_WUNLOCK(inp); > return (ENOTCONN); > } > - INP_HASH_WLOCK(&V_udbinfo); > + INP_HASH_WLOCK(pcbinfo); > in_pcbdisconnect(inp); > inp->inp_laddr.s_addr =3D INADDR_ANY; > - INP_HASH_WUNLOCK(&V_udbinfo); > + INP_HASH_WUNLOCK(pcbinfo); > SOCK_LOCK(so); > so->so_state &=3D ~SS_ISCONNECTED; /* XXX */ > SOCK_UNLOCK(so); >=20 > Modified: stable/10/sys/netinet/udp_var.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/10/sys/netinet/udp_var.h Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet/udp_var.h Tue May 13 06:05:53 2014 = (r265946) > @@ -63,6 +63,8 @@ typedef void(*udp_tun_func_t)(struct mbu > struct udpcb { > udp_tun_func_t u_tun_func; /* UDP kernel tunneling = callback. */ > u_int u_flags; /* Generic UDP flags. */ > + uint16_t u_rxcslen; /* Coverage for incoming = datagrams. */ > + uint16_t u_txcslen; /* Coverage for outgoing = datagrams. */ > }; >=20 > #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) > @@ -130,8 +132,12 @@ SYSCTL_DECL(_net_inet_udp); > extern struct pr_usrreqs udp_usrreqs; > VNET_DECLARE(struct inpcbhead, udb); > VNET_DECLARE(struct inpcbinfo, udbinfo); > +VNET_DECLARE(struct inpcbhead, ulitecb); > +VNET_DECLARE(struct inpcbinfo, ulitecbinfo); > #define V_udb VNET(udb) > #define V_udbinfo VNET(udbinfo) > +#define V_ulitecb VNET(ulitecb) > +#define V_ulitecbinfo VNET(ulitecbinfo) >=20 > extern u_long udp_sendspace; > extern u_long udp_recvspace; > @@ -141,20 +147,37 @@ VNET_DECLARE(int, udp_blackhole); > #define V_udp_blackhole VNET(udp_blackhole) > extern int udp_log_in_vain; >=20 > -int udp_newudpcb(struct inpcb *); > -void udp_discardcb(struct udpcb *); > - > -void udp_ctlinput(int, struct sockaddr *, void *); > -int udp_ctloutput(struct socket *, struct sockopt *); > -void udp_init(void); > +static __inline struct inpcbinfo * > +get_inpcbinfo(uint8_t protocol) > +{ > + return (protocol =3D=3D IPPROTO_UDP) ? &V_udbinfo : = &V_ulitecbinfo; > +} > + > +static __inline struct inpcbhead * > +get_pcblist(uint8_t protocol) > +{ > + return (protocol =3D=3D IPPROTO_UDP) ? &V_udb : &V_ulitecb; > +} > + > +int udp_newudpcb(struct inpcb *); > +void udp_discardcb(struct udpcb *); > + > +void udp_ctlinput(int, struct sockaddr *, void *); > +void udplite_ctlinput(int, struct sockaddr *, void *); > +int udp_ctloutput(struct socket *, struct sockopt *); > +void udp_init(void); > +void udplite_init(void); > #ifdef VIMAGE > -void udp_destroy(void); > +void udp_destroy(void); > +void udplite_destroy(void); > #endif > -void udp_input(struct mbuf *, int); > +void udp_input(struct mbuf *, int); > +void udplite_input(struct mbuf *, int); > struct inpcb *udp_notify(struct inpcb *inp, int errno); > -int udp_shutdown(struct socket *so); > +int udp_shutdown(struct socket *so); >=20 > -int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); > -#endif > +int udp_set_kernel_tunneling(struct socket *so, = udp_tun_func_t f); >=20 > -#endif > +#endif /* _KERNEL */ > + > +#endif /* _NETINET_UDP_VAR_H_ */ >=20 > Copied: stable/10/sys/netinet/udplite.h (from r264212, = head/sys/netinet/udplite.h) > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/10/sys/netinet/udplite.h Tue May 13 06:05:53 2014 = (r265946, copy of r264212, head/sys/netinet/udplite.h) > @@ -0,0 +1,38 @@ > +/*- > + * Copyright (c) 2014, Kevin Lo > + * 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. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _NETINET_UDPLITE_H_ > +#define _NETINET_UDPLITE_H_ > + > +/*=20 > + * User-settable options (used with setsockopt). > + */ > +#define UDPLITE_SEND_CSCOV 2 /* Sender checksum = coverage. */ > +#define UDPLITE_RECV_CSCOV 4 /* Receiver checksum = coverage. */ > + > +#endif /* !_NETINET_UDPLITE_H_ */ >=20 > Modified: stable/10/sys/netinet6/in6_ifattach.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 > --- stable/10/sys/netinet6/in6_ifattach.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet6/in6_ifattach.c Tue May 13 06:05:53 2014 = (r265946) > @@ -856,6 +856,7 @@ in6_ifdetach(struct ifnet *ifp) > } >=20 > in6_pcbpurgeif0(&V_udbinfo, ifp); > + in6_pcbpurgeif0(&V_ulitecbinfo, ifp); > in6_pcbpurgeif0(&V_ripcbinfo, ifp); > /* leave from all multicast groups joined */ > in6_purgemaddrs(ifp); >=20 > Modified: stable/10/sys/netinet6/in6_proto.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 > --- stable/10/sys/netinet6/in6_proto.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet6/in6_proto.c Tue May 13 06:05:53 2014 = (r265946) > @@ -207,13 +207,26 @@ struct ip6protosw inet6sw[] =3D { > .pr_protocol =3D IPPROTO_SCTP, > .pr_flags =3D PR_WANTRCVD, > .pr_input =3D sctp6_input, > - .pr_ctlinput =3D sctp6_ctlinput, > + .pr_ctlinput =3D sctp6_ctlinput, > .pr_ctloutput =3D sctp_ctloutput, > .pr_drain =3D sctp_drain, > .pr_usrreqs =3D &sctp6_usrreqs > }, > #endif /* SCTP */ > { > + .pr_type =3D SOCK_DGRAM, > + .pr_domain =3D &inet6domain, > + .pr_protocol =3D IPPROTO_UDPLITE, > + .pr_flags =3D PR_ATOMIC|PR_ADDR, > + .pr_input =3D udp6_input, > + .pr_ctlinput =3D udplite6_ctlinput, > + .pr_ctloutput =3D udp_ctloutput, > +#ifndef INET /* Do not call initialization twice. */ > + .pr_init =3D udplite_init, > +#endif > + .pr_usrreqs =3D &udp6_usrreqs, > +}, > +{ > .pr_type =3D SOCK_RAW, > .pr_domain =3D &inet6domain, > .pr_protocol =3D IPPROTO_RAW, >=20 > Modified: stable/10/sys/netinet6/udp6_usrreq.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 > --- stable/10/sys/netinet6/udp6_usrreq.c Tue May 13 05:26:43 2014 = (r265945) > +++ stable/10/sys/netinet6/udp6_usrreq.c Tue May 13 06:05:53 2014 = (r265946) > @@ -1,6 +1,7 @@ > /*- > * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. > * Copyright (c) 2010-2011 Juniper Networks, Inc. > + * Copyright (c) 2014 Kevin Lo > * All rights reserved. > * > * Portions of this software were developed by Robert N. M. Watson = under > @@ -109,6 +110,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include >=20 > #include > #include > @@ -181,12 +183,15 @@ udp6_input(struct mbuf **mp, int *offp,=20 > struct ip6_hdr *ip6; > struct udphdr *uh; > struct inpcb *inp; > + struct inpcbinfo *pcbinfo; > struct udpcb *up; > int off =3D *offp; > + int cscov_partial; > int plen, ulen; > struct sockaddr_in6 fromsa; > struct m_tag *fwd_tag; > uint16_t uh_sum; > + uint8_t nxt; >=20 > ifp =3D m->m_pkthdr.rcvif; > ip6 =3D mtod(m, struct ip6_hdr *); > @@ -218,6 +223,13 @@ udp6_input(struct mbuf **mp, int *offp,=20 > plen =3D ntohs(ip6->ip6_plen) - off + sizeof(*ip6); > ulen =3D ntohs((u_short)uh->uh_ulen); >=20 > + nxt =3D ip6->ip6_nxt; > + cscov_partial =3D (nxt =3D=3D IPPROTO_UDPLITE) ? 1 : 0; > + if (nxt =3D=3D IPPROTO_UDPLITE && ulen =3D=3D 0) { > + /* Zero means checksum over the complete packet. */ > + ulen =3D plen; > + cscov_partial =3D 0; > + } >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:20:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E569373E; Sat, 16 Aug 2014 13:20:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D001D2B16; Sat, 16 Aug 2014 13:20:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDKjhD038836; Sat, 16 Aug 2014 13:20:45 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDKjYJ038831; Sat, 16 Aug 2014 13:20:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161320.s7GDKjYJ038831@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:20: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: r270047 - 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.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 13:20:46 -0000 Author: bz Date: Sat Aug 16 13:20:44 2014 New Revision: 270047 URL: http://svnweb.freebsd.org/changeset/base/270047 Log: MFC r259916: Use feature_present(3) to determine whether to open an INET or an INET6 socket when needed to allow pfctl to work on noinet and noinet6 kernels (and try to provide a fallback using AF_LINK as best effort). Adjust the Makefile to also respect relevant src.conf(5) options for compile time decisions on INET and INET6 support. Reviewed by: glebius (no objections) Modified: stable/10/sbin/pfctl/Makefile stable/10/sbin/pfctl/pfctl_altq.c stable/10/sbin/pfctl/pfctl_parser.c stable/10/sbin/pfctl/pfctl_parser.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/pfctl/Makefile ============================================================================== --- stable/10/sbin/pfctl/Makefile Sat Aug 16 13:13:17 2014 (r270046) +++ stable/10/sbin/pfctl/Makefile Sat Aug 16 13:20:44 2014 (r270047) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # pf_ruleset.c is shared between kernel and pfctl .PATH: ${.CURDIR}/../../sys/netpfil/pf @@ -16,6 +18,14 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wno CFLAGS+= -Wstrict-prototypes CFLAGS+= -DENABLE_ALTQ -I${.CURDIR} +# Need to use "WITH_" prefix to not conflict with the l/y INET/INET6 keywords +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DWITH_INET6 +.endif +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+= -DWITH_INET +.endif + YFLAGS= LDADD+= -lm -lmd Modified: stable/10/sbin/pfctl/pfctl_altq.c ============================================================================== --- stable/10/sbin/pfctl/pfctl_altq.c Sat Aug 16 13:13:17 2014 (r270046) +++ stable/10/sbin/pfctl/pfctl_altq.c Sat Aug 16 13:20:44 2014 (r270047) @@ -1122,7 +1122,7 @@ getifspeed(char *ifname) struct ifreq ifr; struct if_data ifrdat; - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) err(1, "socket"); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= @@ -1143,7 +1143,7 @@ getifmtu(char *ifname) int s; struct ifreq ifr; - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) err(1, "socket"); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= Modified: stable/10/sbin/pfctl/pfctl_parser.c ============================================================================== --- stable/10/sbin/pfctl/pfctl_parser.c Sat Aug 16 13:13:17 2014 (r270046) +++ stable/10/sbin/pfctl/pfctl_parser.c Sat Aug 16 13:20:44 2014 (r270047) @@ -1231,6 +1231,26 @@ ifa_load(void) freeifaddrs(ifap); } +int +get_socket_domain(void) +{ + int sdom; + + sdom = AF_UNSPEC; +#ifdef WITH_INET6 + if (sdom == AF_UNSPEC && feature_present("inet6")) + sdom = AF_INET6; +#endif +#ifdef WITH_INET + if (sdom == AF_UNSPEC && feature_present("inet")) + sdom = AF_INET; +#endif + if (sdom == AF_UNSPEC) + sdom = AF_LINK; + + return (sdom); +} + struct node_host * ifa_exists(const char *ifa_name) { @@ -1242,7 +1262,7 @@ ifa_exists(const char *ifa_name) ifa_load(); /* check wether this is a group */ - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) == -1) err(1, "socket"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name)); @@ -1273,7 +1293,7 @@ ifa_grouplookup(const char *ifa_name, in int s, len; struct node_host *n, *h = NULL; - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) + if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) == -1) err(1, "socket"); bzero(&ifgr, sizeof(ifgr)); strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name)); Modified: stable/10/sbin/pfctl/pfctl_parser.h ============================================================================== --- stable/10/sbin/pfctl/pfctl_parser.h Sat Aug 16 13:13:17 2014 (r270046) +++ stable/10/sbin/pfctl/pfctl_parser.h Sat Aug 16 13:20:44 2014 (r270047) @@ -294,6 +294,7 @@ void set_ipmask(struct node_host *, u int check_netmask(struct node_host *, sa_family_t); int unmask(struct pf_addr *, sa_family_t); void ifa_load(void); +int get_socket_domain(void); struct node_host *ifa_exists(const char *); struct node_host *ifa_lookup(const char *, int); struct node_host *host(const char *); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:23:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F82A96F; Sat, 16 Aug 2014 13:23:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A5702B37; Sat, 16 Aug 2014 13:23:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDNOH7041931; Sat, 16 Aug 2014 13:23:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDNOo5041930; Sat, 16 Aug 2014 13:23:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161323.s7GDNOo5041930@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:23: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: r270048 - stable/10/sys/dev/ie X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:23:24 -0000 Author: bz Date: Sat Aug 16 13:23:23 2014 New Revision: 270048 URL: http://svnweb.freebsd.org/changeset/base/270048 Log: MFC r259886: Bite the bullet and start removing the first compile time warnings by removing unsued file local functions and then unused callees. A lot more warnings to resolve but someone had to break the ice. X-Comment: I am not the new maintainer; chime in, it's ours. Modified: stable/10/sys/dev/ie/if_ie.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ie/if_ie.c ============================================================================== --- stable/10/sys/dev/ie/if_ie.c Sat Aug 16 13:20:44 2014 (r270047) +++ stable/10/sys/dev/ie/if_ie.c Sat Aug 16 13:23:23 2014 (r270048) @@ -172,17 +172,12 @@ static void iestart_locked (struct ifne static __inline void ee16_interrupt_enable (struct ie_softc *); -static void ee16_eeprom_outbits (struct ie_softc *, int, int); -static void ee16_eeprom_clock (struct ie_softc *, int); -static u_short ee16_read_eeprom (struct ie_softc *, int); -static int ee16_eeprom_inbits (struct ie_softc *); static __inline void ie_ack (struct ie_softc *, u_int); static void iereset (struct ie_softc *); static void ie_readframe (struct ie_softc *, int); static void ie_drop_packet_buffer (struct ie_softc *); -static void find_ie_mem_size (struct ie_softc *); static int command_and_wait (struct ie_softc *, int, void volatile *, int); static void run_tdr (struct ie_softc *, @@ -1090,26 +1085,6 @@ check_ie_present(struct ie_softc *sc) return (1); } -/* - * Divine the memory size of ie board UNIT. - * Better hope there's nothing important hiding just below the ie card... - */ -static void -find_ie_mem_size(struct ie_softc *sc) -{ - unsigned size; - - sc->iosize = 0; - - for (size = 65536; size >= 8192; size -= 8192) { - if (check_ie_present(sc)) { - return; - } - } - - return; -} - void el_reset_586(struct ie_softc *sc) { @@ -1152,82 +1127,6 @@ ee16_chan_attn(struct ie_softc *sc) outb(PORT(sc) + IEE16_ATTN, 0); } -u_short -ee16_read_eeprom(struct ie_softc *sc, int location) -{ - int ectrl, edata; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= IEE16_ECTRL_MASK; - ectrl |= IEE16_ECTRL_EECS; - outb(sc->port + IEE16_ECTRL, ectrl); - - ee16_eeprom_outbits(sc, IEE16_EEPROM_READ, IEE16_EEPROM_OPSIZE1); - ee16_eeprom_outbits(sc, location, IEE16_EEPROM_ADDR_SIZE); - edata = ee16_eeprom_inbits(sc); - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EEDI | IEE16_ECTRL_EECS); - outb(sc->port + IEE16_ECTRL, ectrl); - ee16_eeprom_clock(sc, 1); - ee16_eeprom_clock(sc, 0); - return edata; -} - -static void -ee16_eeprom_outbits(struct ie_softc *sc, int edata, int count) -{ - int ectrl, i; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~IEE16_RESET_ASIC; - for (i = count - 1; i >= 0; i--) { - ectrl &= ~IEE16_ECTRL_EEDI; - if (edata & (1 << i)) { - ectrl |= IEE16_ECTRL_EEDI; - } - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(1); /* eeprom data must be setup for 0.4 uSec */ - ee16_eeprom_clock(sc, 1); - ee16_eeprom_clock(sc, 0); - } - ectrl &= ~IEE16_ECTRL_EEDI; - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(1); /* eeprom data must be held for 0.4 uSec */ -} - -static int -ee16_eeprom_inbits(struct ie_softc *sc) -{ - int ectrl, edata, i; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~IEE16_RESET_ASIC; - for (edata = 0, i = 0; i < 16; i++) { - edata = edata << 1; - ee16_eeprom_clock(sc, 1); - ectrl = inb(sc->port + IEE16_ECTRL); - if (ectrl & IEE16_ECTRL_EEDO) { - edata |= 1; - } - ee16_eeprom_clock(sc, 0); - } - return (edata); -} - -static void -ee16_eeprom_clock(struct ie_softc *sc, int state) -{ - int ectrl; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EESK); - if (state) { - ectrl |= IEE16_ECTRL_EESK; - } - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(9); /* EESK must be stable for 8.38 uSec */ -} - static __inline void ee16_interrupt_enable(struct ie_softc *sc) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:25:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D5C3AB3; Sat, 16 Aug 2014 13:25:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66B452B45; Sat, 16 Aug 2014 13:25:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDPom6042304; Sat, 16 Aug 2014 13:25:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDPoAK042303; Sat, 16 Aug 2014 13:25:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161325.s7GDPoAK042303@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270049 - stable/10/usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:25:50 -0000 Author: bz Date: Sat Aug 16 13:25:49 2014 New Revision: 270049 URL: http://svnweb.freebsd.org/changeset/base/270049 Log: MFC r261525: Print the MD5 signature information introduced in r221023 (head) in the TCP statistics output. Modified: stable/10/usr.bin/netstat/inet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/netstat/inet.c ============================================================================== --- stable/10/usr.bin/netstat/inet.c Sat Aug 16 13:23:23 2014 (r270048) +++ stable/10/usr.bin/netstat/inet.c Sat Aug 16 13:25:49 2014 (r270049) @@ -723,6 +723,17 @@ tcp_stats(u_long off, const char *name, p(tcps_ecn_ect1, "\t%ju packet%s with ECN ECT(1) bit set\n"); p(tcps_ecn_shs, "\t%ju successful ECN handshake%s\n"); p(tcps_ecn_rcwnd, "\t%ju time%s ECN reduced the congestion window\n"); + + p(tcps_sig_rcvgoodsig, + "\t%ju packet%s with valid tcp-md5 signature received\n"); + p(tcps_sig_rcvbadsig, + "\t%ju packet%s with invalid tcp-md5 signature received\n"); + p(tcps_sig_err_buildsig, + "\t%ju packet%s with tcp-md5 signature mismatch\n"); + p(tcps_sig_err_sigopt, + "\t%ju packet%s with unexpected tcp-md5 signature received\n"); + p(tcps_sig_err_nosigopt, + "\t%ju packet%s without expected tcp-md5 signature received\n"); #undef p #undef p1a #undef p2 From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:47:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F683D16; Sat, 16 Aug 2014 13:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61F982D45; Sat, 16 Aug 2014 13:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDl55f051219; Sat, 16 Aug 2014 13:47:05 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDl5co051217; Sat, 16 Aug 2014 13:47:05 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161347.s7GDl5co051217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13: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: r270050 - stable/10/sbin/route X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:47:05 -0000 Author: bz Date: Sat Aug 16 13:47:04 2014 New Revision: 270050 URL: http://svnweb.freebsd.org/changeset/base/270050 Log: MFC r264539: When switching variables to flags in r243185 a few cases were missed. After r263152 (in head) this leaves unused variables if route(8) is compiled without INET support. Switch the remaining variable accesses to flags and remove now obsolete variables. Reviewed by: glebius Modified: stable/10/sbin/route/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/route/route.c ============================================================================== --- stable/10/sbin/route/route.c Sat Aug 16 13:25:49 2014 (r270049) +++ stable/10/sbin/route/route.c Sat Aug 16 13:47:04 2014 (r270050) @@ -81,7 +81,7 @@ static struct keytab { static struct sockaddr_storage so[RTAX_MAX]; static int pid, rtm_addrs; static int s; -static int forcehost, forcenet, nflag, af, qflag, tflag; +static int nflag, af, qflag, tflag; static int verbose, aflen; static int locking, lockrest, debugonly; static struct rt_metrics rt_metrics; @@ -1235,7 +1235,7 @@ getaddr(int idx, char *str, struct hoste */ switch (idx) { case RTAX_DST: - forcenet++; + nrflags |= F_FORCENET; getaddr(RTAX_NETMASK, str, 0, nrflags); break; } @@ -1275,7 +1275,7 @@ getaddr(int idx, char *str, struct hoste if (!atalk_aton(str, &sat->sat_addr)) errx(EX_NOHOST, "bad address: %s", str); rtm_addrs |= RTA_NETMASK; - return(forcehost || sat->sat_addr.s_node != 0); + return(nrflags & F_FORCEHOST || sat->sat_addr.s_node != 0); } case AF_LINK: link_addr(str, (struct sockaddr_dl *)(void *)sa); @@ -1308,10 +1308,10 @@ getaddr(int idx, char *str, struct hoste } *q = '/'; } - if ((idx != RTAX_DST || forcenet == 0) && + if ((idx != RTAX_DST || (nrflags & F_FORCENET) == 0) && inet_aton(str, &sin->sin_addr)) { val = sin->sin_addr.s_addr; - if (idx != RTAX_DST || forcehost || + if (idx != RTAX_DST || nrflags & F_FORCEHOST || inet_lnaof(sin->sin_addr) != INADDR_ANY) return (1); else { @@ -1319,7 +1319,7 @@ getaddr(int idx, char *str, struct hoste goto netdone; } } - if (idx == RTAX_DST && forcehost == 0 && + if (idx == RTAX_DST && (nrflags & F_FORCEHOST) == 0 && ((val = inet_network(str)) != INADDR_NONE || ((np = getnetbyname(str)) != NULL && (val = np->n_net) != 0))) { netdone: From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:50:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BEDDE5C; Sat, 16 Aug 2014 13:50:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDA62D59; Sat, 16 Aug 2014 13:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDoFaP051715; Sat, 16 Aug 2014 13:50:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDoFj3051712; Sat, 16 Aug 2014 13:50:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161350.s7GDoFj3051712@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:50: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: r270051 - in stable/10/sys: dev/cxgbe/tom netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:50:16 -0000 Author: bz Date: Sat Aug 16 13:50:15 2014 New Revision: 270051 URL: http://svnweb.freebsd.org/changeset/base/270051 Log: MFC r266596: Move the tcp_fields_to_host() and tcp_fields_to_net() (inline) functions to the tcp_var.h header file in order to avoid further duplication with upcoming commits. Reviewed by: np Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c stable/10/sys/netinet/tcp_input.c stable/10/sys/netinet/tcp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_listen.c Sat Aug 16 13:47:04 2014 (r270050) +++ stable/10/sys/dev/cxgbe/tom/t4_listen.c Sat Aug 16 13:50:15 2014 (r270051) @@ -1052,17 +1052,6 @@ calc_opt2p(struct adapter *sc, struct po return htobe32(opt2); } -/* XXX: duplication. */ -static inline void -tcp_fields_to_host(struct tcphdr *th) -{ - - th->th_seq = ntohl(th->th_seq); - th->th_ack = ntohl(th->th_ack); - th->th_win = ntohs(th->th_win); - th->th_urp = ntohs(th->th_urp); -} - static void pass_accept_req_to_protohdrs(const struct mbuf *m, struct in_conninfo *inc, struct tcphdr *th) Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Sat Aug 16 13:47:04 2014 (r270050) +++ stable/10/sys/netinet/tcp_input.c Sat Aug 16 13:50:15 2014 (r270051) @@ -455,27 +455,7 @@ cc_post_recovery(struct tcpcb *tp, struc tp->t_bytes_acked = 0; } -static inline void -tcp_fields_to_host(struct tcphdr *th) -{ - - th->th_seq = ntohl(th->th_seq); - th->th_ack = ntohl(th->th_ack); - th->th_win = ntohs(th->th_win); - th->th_urp = ntohs(th->th_urp); -} - #ifdef TCP_SIGNATURE -static inline void -tcp_fields_to_net(struct tcphdr *th) -{ - - th->th_seq = htonl(th->th_seq); - th->th_ack = htonl(th->th_ack); - th->th_win = htons(th->th_win); - th->th_urp = htons(th->th_urp); -} - static inline int tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen, struct tcpopt *to, struct tcphdr *th, u_int tcpbflag) Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Sat Aug 16 13:47:04 2014 (r270050) +++ stable/10/sys/netinet/tcp_var.h Sat Aug 16 13:50:15 2014 (r270051) @@ -736,6 +736,27 @@ u_long tcp_seq_subtract(u_long, u_long void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); +static inline void +tcp_fields_to_host(struct tcphdr *th) +{ + + th->th_seq = ntohl(th->th_seq); + th->th_ack = ntohl(th->th_ack); + th->th_win = ntohs(th->th_win); + th->th_urp = ntohs(th->th_urp); +} + +#ifdef TCP_SIGNATURE +static inline void +tcp_fields_to_net(struct tcphdr *th) +{ + + th->th_seq = htonl(th->th_seq); + th->th_ack = htonl(th->th_ack); + th->th_win = htons(th->th_win); + th->th_urp = htons(th->th_urp); +} +#endif #endif /* _KERNEL */ #endif /* _NETINET_TCP_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:53:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99539FAE; Sat, 16 Aug 2014 13:53:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84AC92E1C; Sat, 16 Aug 2014 13:53:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDr51p055211; Sat, 16 Aug 2014 13:53:05 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDr5RC055210; Sat, 16 Aug 2014 13:53:05 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161353.s7GDr5RC055210@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270052 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:53:05 -0000 Author: bz Date: Sat Aug 16 13:53:05 2014 New Revision: 270052 URL: http://svnweb.freebsd.org/changeset/base/270052 Log: MFC r266597: Remove the prototypes for things that are no longer file local but were moved to the header file. Was suppoed to be MFCed with: r266596 Pointy hat to: bz Modified: stable/10/sys/netinet/tcp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Sat Aug 16 13:50:15 2014 (r270051) +++ stable/10/sys/netinet/tcp_input.c Sat Aug 16 13:53:05 2014 (r270052) @@ -229,9 +229,7 @@ static void tcp_pulloutofband(struct so 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 tcp_fields_to_host(struct tcphdr *); #ifdef TCP_SIGNATURE -static void inline tcp_fields_to_net(struct tcphdr *); static int inline tcp_signature_verify_input(struct mbuf *, int, int, int, struct tcpopt *, struct tcphdr *, u_int); #endif From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:55:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAB4D341; Sat, 16 Aug 2014 13:55:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD212E3A; Sat, 16 Aug 2014 13:55:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDtiRE055858; Sat, 16 Aug 2014 13:55:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDtiBk055857; Sat, 16 Aug 2014 13:55:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161355.s7GDtiBk055857@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:55: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: r270053 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 13:55:44 -0000 Author: bz Date: Sat Aug 16 13:55:44 2014 New Revision: 270053 URL: http://svnweb.freebsd.org/changeset/base/270053 Log: MFC r266606: Only do a ports check if this is a NAT-T SA. Otherwise other lookups providing ports may get unexpected results. Modified: stable/10/sys/netipsec/key.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/key.c ============================================================================== --- stable/10/sys/netipsec/key.c Sat Aug 16 13:53:05 2014 (r270052) +++ stable/10/sys/netipsec/key.c Sat Aug 16 13:55:44 2014 (r270053) @@ -1085,7 +1085,9 @@ key_allocsa( struct secasvar *sav; u_int stateidx, arraysize, state; const u_int *saorder_state_valid; - int chkport; +#ifdef IPSEC_NAT_T + int natt_chkport; +#endif IPSEC_ASSERT(dst != NULL, ("null dst address")); @@ -1093,11 +1095,9 @@ key_allocsa( printf("DP %s from %s:%u\n", __func__, where, tag)); #ifdef IPSEC_NAT_T - chkport = (dst->sa.sa_family == AF_INET && + natt_chkport = (dst->sa.sa_family == AF_INET && dst->sa.sa_len == sizeof(struct sockaddr_in) && dst->sin.sin_port != 0); -#else - chkport = 0; #endif /* @@ -1115,6 +1115,8 @@ key_allocsa( arraysize = _ARRAYLEN(saorder_state_valid_prefer_new); } LIST_FOREACH(sah, &V_sahtree, chain) { + int checkport; + /* search valid state */ for (stateidx = 0; stateidx < arraysize; stateidx++) { state = saorder_state_valid[stateidx]; @@ -1129,13 +1131,25 @@ key_allocsa( continue; if (spi != sav->spi) continue; + checkport = 0; +#ifdef IPSEC_NAT_T + /* + * Really only check ports when this is a NAT-T + * SA. Otherwise other lookups providing ports + * might suffer. + */ + if (sav->natt_type && natt_chkport) + checkport = 1; +#endif #if 0 /* don't check src */ /* check src address */ - if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, chkport) != 0) + if (key_sockaddrcmp(&src->sa, + &sav->sah->saidx.src.sa, checkport) != 0) continue; #endif /* check dst address */ - if (key_sockaddrcmp(&dst->sa, &sav->sah->saidx.dst.sa, chkport) != 0) + if (key_sockaddrcmp(&dst->sa, + &sav->sah->saidx.dst.sa, checkport) != 0) continue; sa_addref(sav); goto done; From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 13:58:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 712FC4BB; Sat, 16 Aug 2014 13:58:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C8462E53; Sat, 16 Aug 2014 13:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GDwk3s056258; Sat, 16 Aug 2014 13:58:46 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GDwkM9056256; Sat, 16 Aug 2014 13:58:46 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161358.s7GDwkM9056256@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 13:58: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: r270054 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 13:58:46 -0000 Author: bz Date: Sat Aug 16 13:58:45 2014 New Revision: 270054 URL: http://svnweb.freebsd.org/changeset/base/270054 Log: MFC r266618: Make tcp_twrespond() file local private; this removes it from the public KPI; it is not used anywhere else and seems it never was. Modified: stable/10/sys/netinet/tcp_timewait.c stable/10/sys/netinet/tcp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_timewait.c ============================================================================== --- stable/10/sys/netinet/tcp_timewait.c Sat Aug 16 13:55:44 2014 (r270053) +++ stable/10/sys/netinet/tcp_timewait.c Sat Aug 16 13:58:45 2014 (r270054) @@ -105,6 +105,7 @@ static VNET_DEFINE(TAILQ_HEAD(, tcptw), static void tcp_tw_2msl_reset(struct tcptw *, int); static void tcp_tw_2msl_stop(struct tcptw *); +static int tcp_twrespond(struct tcptw *, int); static int tcptw_auto_size(void) @@ -501,7 +502,7 @@ tcp_twclose(struct tcptw *tw, int reuse) uma_zfree(V_tcptw_zone, tw); } -int +static int tcp_twrespond(struct tcptw *tw, int flags) { struct inpcb *inp = tw->tw_inpcb; Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Sat Aug 16 13:55:44 2014 (r270053) +++ stable/10/sys/netinet/tcp_var.h Sat Aug 16 13:58:45 2014 (r270054) @@ -695,7 +695,6 @@ void tcp_tw_destroy(void); void tcp_tw_zone_change(void); int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, struct mbuf *, int); -int tcp_twrespond(struct tcptw *, int); void tcp_setpersist(struct tcpcb *); #ifdef TCP_SIGNATURE int tcp_signature_compute(struct mbuf *, int, int, int, u_char *, u_int); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:03:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE835618; Sat, 16 Aug 2014 14:03:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9B842FD5; Sat, 16 Aug 2014 14:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GE30mK060091; Sat, 16 Aug 2014 14:03:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GE30ft060090; Sat, 16 Aug 2014 14:03:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161403.s7GE30ft060090@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:03: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: r270055 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:03:01 -0000 Author: bz Date: Sat Aug 16 14:03:00 2014 New Revision: 270055 URL: http://svnweb.freebsd.org/changeset/base/270055 Log: MFC r266619: syncache_lookup() is a file local function. Make it static and take it out of the public KPI; seems it was never used elsewhere. Modified: stable/10/sys/netinet/tcp_syncache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_syncache.c ============================================================================== --- stable/10/sys/netinet/tcp_syncache.c Sat Aug 16 13:58:45 2014 (r270054) +++ stable/10/sys/netinet/tcp_syncache.c Sat Aug 16 14:03:00 2014 (r270055) @@ -121,7 +121,6 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -struct syncache *syncache_lookup(struct in_conninfo *, struct syncache_head **); static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); @@ -492,7 +491,7 @@ syncache_timer(void *xsch) * Find an entry in the syncache. * Returns always with locked syncache_head plus a matching entry or NULL. */ -struct syncache * +static struct syncache * syncache_lookup(struct in_conninfo *inc, struct syncache_head **schp) { struct syncache *sc; From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:05:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8C7379B; Sat, 16 Aug 2014 14:05:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09D92FF2; Sat, 16 Aug 2014 14:05:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GE5VQc060471; Sat, 16 Aug 2014 14:05:31 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GE5VLh060470; Sat, 16 Aug 2014 14:05:31 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161405.s7GE5VLh060470@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:05: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: r270056 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:05:32 -0000 Author: bz Date: Sat Aug 16 14:05:31 2014 New Revision: 270056 URL: http://svnweb.freebsd.org/changeset/base/270056 Log: MFC r266620: Remove the prototpye for the static inline function tcp_signature_verify_input(). The function is defined before first use already. Modified: stable/10/sys/netinet/tcp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Sat Aug 16 14:03:00 2014 (r270055) +++ stable/10/sys/netinet/tcp_input.c Sat Aug 16 14:05:31 2014 (r270056) @@ -229,10 +229,6 @@ static void tcp_pulloutofband(struct so struct tcphdr *, struct mbuf *, int); static void tcp_xmit_timer(struct tcpcb *, int); static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -#ifdef TCP_SIGNATURE -static int inline tcp_signature_verify_input(struct mbuf *, int, int, - int, struct tcpopt *, struct tcphdr *, u_int); -#endif static void inline cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type); static void inline cc_conn_init(struct tcpcb *tp); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:09:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBE469C4; Sat, 16 Aug 2014 14:09:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73802023; Sat, 16 Aug 2014 14:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GE9QQ8060979; Sat, 16 Aug 2014 14:09:26 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GE9QJ0060978; Sat, 16 Aug 2014 14:09:26 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161409.s7GE9QJ0060978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270057 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:09:26 -0000 Author: bz Date: Sat Aug 16 14:09:26 2014 New Revision: 270057 URL: http://svnweb.freebsd.org/changeset/base/270057 Log: MFC r266907: While PAWS is disabled, there are no consumers for the tcp options argument to tcp_twcheck(); thus mark it __unused. Modified: stable/10/sys/netinet/tcp_timewait.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_timewait.c ============================================================================== --- stable/10/sys/netinet/tcp_timewait.c Sat Aug 16 14:05:31 2014 (r270056) +++ stable/10/sys/netinet/tcp_timewait.c Sat Aug 16 14:09:26 2014 (r270057) @@ -350,7 +350,7 @@ tcp_twrecycleable(struct tcptw *tw) * looking for a pcb in the listen state. Returns 0 otherwise. */ int -tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, +tcp_twcheck(struct inpcb *inp, struct tcpopt *to __unused, struct tcphdr *th, struct mbuf *m, int tlen) { struct tcptw *tw; From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:14:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BE22B3F; Sat, 16 Aug 2014 14:14:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4EE20BF; Sat, 16 Aug 2014 14:14:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GEEUZh064829; Sat, 16 Aug 2014 14:14:30 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GEEUSb064828; Sat, 16 Aug 2014 14:14:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161414.s7GEEUSb064828@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:14: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: r270058 - stable/10/sys/mips/beri X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:14:30 -0000 Author: bz Date: Sat Aug 16 14:14:29 2014 New Revision: 270058 URL: http://svnweb.freebsd.org/changeset/base/270058 Log: MFC r264605: Based on xlp_machdep.c and completed the list of options based on boot/mips/beri/loader/metadata.c allow FDT configuration to set command line options. This leads to an interesting quesiton of future interactions with loader. However for configurations without loader this allows bootverbose or boot single user to be set by compiling a new kernel, which is good enough for testing and debugging. Reviewed by: rwatson Sponsored by: DARPA/AFRL Modified: stable/10/sys/mips/beri/beri_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/mips/beri/beri_machdep.c ============================================================================== --- stable/10/sys/mips/beri/beri_machdep.c Sat Aug 16 14:09:26 2014 (r270057) +++ stable/10/sys/mips/beri/beri_machdep.c Sat Aug 16 14:14:29 2014 (r270058) @@ -131,6 +131,46 @@ platform_reset(void) __asm__ __volatile("wait"); } +#ifdef FDT +/* Parse cmd line args as env - copied from xlp_machdep. */ +/* XXX-BZ this should really be centrally provided for all (boot) code. */ +static void +_parse_bootargs(char *cmdline) +{ + char *n, *v; + + while ((v = strsep(&cmdline, " \n")) != NULL) { + if (*v == '\0') + continue; + if (*v == '-') { + while (*v != '\0') { + v++; + switch (*v) { + case 'a': boothowto |= RB_ASKNAME; break; + /* Someone should simulate that ;-) */ + case 'C': boothowto |= RB_CDROM; break; + case 'd': boothowto |= RB_KDB; break; + case 'D': boothowto |= RB_MULTIPLE; break; + case 'm': boothowto |= RB_MUTE; break; + case 'g': boothowto |= RB_GDB; break; + case 'h': boothowto |= RB_SERIAL; break; + case 'p': boothowto |= RB_PAUSE; break; + case 'r': boothowto |= RB_DFLTROOT; break; + case 's': boothowto |= RB_SINGLE; break; + case 'v': boothowto |= RB_VERBOSE; break; + } + } + } else { + n = strsep(&v, "="); + if (v == NULL) + setenv(n, "1"); + else + setenv(n, v); + } + } +} +#endif + void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) @@ -142,7 +182,9 @@ platform_start(__register_t a0, __regist char **envp = (char **)a2; unsigned int memsize = a3; #ifdef FDT + char buf[2048]; /* early stack supposedly big enough */ vm_offset_t dtbp; + phandle_t chosen; void *kmdp; #endif int i; @@ -180,6 +222,13 @@ platform_start(__register_t a0, __regist while (1); if (OF_init((void *)dtbp) != 0) while (1); + + /* + * Get bootargs from FDT if specified. + */ + chosen = OF_finddevice("/chosen"); + if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) + _parse_bootargs(buf); #endif /* From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:17:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C76AC8D; Sat, 16 Aug 2014 14:17:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77B4820D9; Sat, 16 Aug 2014 14:17:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GEHAwA065320; Sat, 16 Aug 2014 14:17:10 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GEHAfM065319; Sat, 16 Aug 2014 14:17:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161417.s7GEHAfM065319@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:17: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: r270059 - stable/10/sys/dev/altera/atse X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:17:10 -0000 Author: bz Date: Sat Aug 16 14:17:09 2014 New Revision: 270059 URL: http://svnweb.freebsd.org/changeset/base/270059 Log: MFC r264542: Use ETHER_ALIGN as argument to m_adj() to offset the beginning of packet rather than the magic number 2. While here fix a typo in a comment. No functional changes. Sponsored by: DARPA/AFRL Modified: stable/10/sys/dev/altera/atse/if_atse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/altera/atse/if_atse.c ============================================================================== --- stable/10/sys/dev/altera/atse/if_atse.c Sat Aug 16 14:14:29 2014 (r270058) +++ stable/10/sys/dev/altera/atse/if_atse.c Sat Aug 16 14:17:09 2014 (r270059) @@ -1179,7 +1179,7 @@ outer: return (rx_npkts); m->m_len = m->m_pkthdr.len = MCLBYTES; /* Make sure upper layers will be aligned. */ - m_adj(m, 2); + m_adj(m, ETHER_ALIGN); sc->atse_rx_m = m; } @@ -1815,7 +1815,7 @@ atse_detach(device_t dev) return (0); } -/* Shared between nexus anf fdt implementation. */ +/* Shared between nexus and fdt implementation. */ void atse_detach_resources(device_t dev) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:21:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31D39DD6; Sat, 16 Aug 2014 14:21:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02C892162; Sat, 16 Aug 2014 14:21:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GEL3sB066307; Sat, 16 Aug 2014 14:21:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GEL3UE066305; Sat, 16 Aug 2014 14:21:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161421.s7GEL3UE066305@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:21: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: r270060 - in stable/10/sys: boot/fdt/dts/mips mips/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:21:04 -0000 Author: bz Date: Sat Aug 16 14:21:03 2014 New Revision: 270060 URL: http://svnweb.freebsd.org/changeset/base/270060 Log: MFC r263632: For BERI on NetFPGA assume HZ=100 by default. Remove the uart support in favour of a "jtag-uart" interface imitation providing a much simpler interface, directly exported to the host, allowing the toolchain to be shared with BERI on Altera. [1] Submitted by: Jong Hun HAN (jong.han cl.cam.ac.uk) [1] Sponsored by: DARPA/AFRL Modified: stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts Sat Aug 16 14:17:09 2014 (r270059) +++ stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts Sat Aug 16 14:21:03 2014 (r270060) @@ -113,6 +113,14 @@ soft-interrupt-sources = <64>; }; + serial0: serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f000000 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic>; + }; + +/* serial0: serial@7f002100 { compatible = "ns16550"; reg = <0x7f002100 0x20>; @@ -121,6 +129,7 @@ interrupts = <8>; interrupt-parent = <&beripic>; }; +*/ }; aliases { Modified: stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT Sat Aug 16 14:17:09 2014 (r270059) +++ stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT Sat Aug 16 14:21:03 2014 (r270060) @@ -10,11 +10,14 @@ include "BERI_TEMPLATE" ident BERI_NETFPGA_MDROOT +options HZ=100 + options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=beri-netfpga.dts -device uart +#device uart +device altera_jtag_uart # # This kernel configuration uses an embedded memory root file system. From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:30:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EC3AF9B; Sat, 16 Aug 2014 14:30:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA6062221; Sat, 16 Aug 2014 14:30:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GEUmBQ072820; Sat, 16 Aug 2014 14:30:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GEUlN4072809; Sat, 16 Aug 2014 14:30:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201408161430.s7GEUlN4072809@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 16 Aug 2014 14:30: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: r270061 - in stable/10: share/man/man4 sys/boot/fdt/dts/mips sys/dev/netfpga10g sys/dev/netfpga10g/nf10bmac sys/mips/beri sys/mips/conf sys/modules sys/modules/netfpga10g X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 14:30:49 -0000 Author: bz Date: Sat Aug 16 14:30:46 2014 New Revision: 270061 URL: http://svnweb.freebsd.org/changeset/base/270061 Log: MFC r264601,264646,265766,267918,267919,267920: Merge if_nf10bmac(4), a driver to support an NetFPGA-10G Embedded CPU Ethernet Core. The current version operates on a simple PIO based interface connected to a NetFPGA-10G port. To avoid confusion: this driver operates on a CPU running on the FPGA, e.g. BERI/mips, and is not suited for the PCI host interface. Adjust the register layout to allow for 64bit registers in the future for nf10bmac(4). Also, add support for and enable RX interrupts. Allow switching between 32bit and 64bit bus width data access at compile time by setting NF10BMAC_64BIT and using a REGWTYPE #define to set correct variable and return value widths. Adjust comments to indicate the 32 or 64bit register widths. Relnotes: yes Sponsored by: DARPA/AFRL Added: stable/10/share/man/man4/netfpga10g_nf10bmac.4 - copied unchanged from r264601, head/share/man/man4/netfpga10g_nf10bmac.4 stable/10/sys/dev/netfpga10g/ - copied from r264601, head/sys/dev/netfpga10g/ stable/10/sys/modules/netfpga10g/ - copied from r264601, head/sys/modules/netfpga10g/ Modified: stable/10/share/man/man4/Makefile stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h stable/10/sys/mips/beri/files.beri stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT stable/10/sys/modules/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Sat Aug 16 14:21:03 2014 (r270060) +++ stable/10/share/man/man4/Makefile Sat Aug 16 14:30:46 2014 (r270061) @@ -282,6 +282,7 @@ MAN= aac.4 \ ncv.4 \ ${_ndis.4} \ net80211.4 \ + netfpga10g_nf10bmac.4 \ netgraph.4 \ netintro.4 \ netmap.4 \ @@ -678,6 +679,7 @@ MLINKS+=mwl.4 if_mwl.4 MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 MLINKS+=${_ndis.4} ${_if_ndis.4} +MLINKS+=netfpga10g_nf10bmac.4 if_nf10bmac.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} Copied: stable/10/share/man/man4/netfpga10g_nf10bmac.4 (from r264601, head/share/man/man4/netfpga10g_nf10bmac.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/netfpga10g_nf10bmac.4 Sat Aug 16 14:30:46 2014 (r270061, copy of r264601, head/share/man/man4/netfpga10g_nf10bmac.4) @@ -0,0 +1,70 @@ +.\"- +.\" Copyright (c) 2014 Bjoern A. Zeeb +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 +.\" ("MRC2"), as part of the DARPA MRC research programme. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 17, 2014 +.Dt NETFPGA10G_NF10BMAC 4 +.Os +.Sh NAME +.Nm netfpga10g_nf10bmac +.Nd driver for the NetFPGA-10G Embedded CPU Ethernet Core +.Sh SYNOPSIS +.Cd "device netfpga10g_nf10bmac" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the NetFPGA-10G Embedded CPU Ethernet +Core. +.Sh HARDWARE +The current version of the +.Nm +driver works with one PIO mode interface of the +NetFPGA-10G Embedded CPU Ethernet Core version 1.00a. +.Sh SEE ALSO +.Xr netintro 4 , +.Xr ifconfig 8 +.Rs +.%T NetFPGA-10G Wiki +.%U https://github.com/NetFPGA/NetFPGA-public/wiki +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +This software and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-11-C-0249 +.Pq Do MRC2 Dc , +as part of the DARPA MRC research programme. +The device driver was written by +.An Bjoern A. Zeeb . Modified: stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts Sat Aug 16 14:21:03 2014 (r270060) +++ stable/10/sys/boot/fdt/dts/mips/beri-netfpga.dts Sat Aug 16 14:30:46 2014 (r270061) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2012-2013 Robert N. M. Watson * Copyright (c) 2013 SRI International - * Copyright (c) 2013 Bjoern A. Zeeb + * Copyright (c) 2013-2014 Bjoern A. Zeeb * All rights reserved. * * This software was developed by SRI International and the University of @@ -130,6 +130,18 @@ interrupt-parent = <&beripic>; }; */ + + ethernet@7f005000 { + compatible = "netfpag10g,nf10bmac"; + // LOOP, TX, RX, INTR + reg = <0x7f005000 0x20 + 0x7f005020 0x30 + 0x7f005050 0x30 + 0x7f005100 0x10>; + // RX + interrupts = <1>; + interrupt-parent = <&beripic>; + }; }; aliases { Modified: stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Thu Apr 17 12:33:26 2014 (r264601) +++ stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Sat Aug 16 14:30:46 2014 (r270061) @@ -92,13 +92,15 @@ static poll_handler_t nf10bmac_poll; #define NF10BMAC_LOCK_ASSERT(_sc) \ mtx_assert(&(_sc)->nf10bmac_mtx, MA_OWNED) -#define NF10BMAC_TX_LEN 0x08 -#define NF10BMAC_TX_META 0x04 +#define NF10BMAC_CTRL0 0x00 #define NF10BMAC_TX_DATA 0x00 -#define NF10BMAC_RX_LEN 0x08 -#define NF10BMAC_RX_META 0x04 +#define NF10BMAC_TX_META 0x08 +#define NF10BMAC_TX_LEN 0x10 #define NF10BMAC_RX_DATA 0x00 -#define NF10BMAC_CTRL0 0x00 +#define NF10BMAC_RX_META 0x08 +#define NF10BMAC_RX_LEN 0x10 +#define NF10BMAC_INTR_CLEAR_DIS 0x00 +#define NF10BMAC_INTR_CTRL 0x08 #define NF10BMAC_TUSER_MAC0 (1 << 0) #define NF10BMAC_TUSER_CPU0 (1 << 1) @@ -109,63 +111,101 @@ static poll_handler_t nf10bmac_poll; #define NF10BMAC_TUSER_MAC3 (1 << 6) #define NF10BMAC_TUSER_CPU3 (1 << 7) +#define NF10BMAC_DATA_LEN_MASK 0x0000ffff #define NF10BMAC_DATA_DPORT_MASK 0xff000000 #define NF10BMAC_DATA_DPORT_SHIFT 24 #define NF10BMAC_DATA_SPORT_MASK 0x00ff0000 #define NF10BMAC_DATA_SPORT_SHIFT 16 -#define NF10BMAC_DATA_LAST 0x00000080 +#define NF10BMAC_DATA_LAST 0x00008000 +#ifdef NF10BMAC_64BIT +#define NF10BMAC_DATA_STRB 0x000000ff +#define REGWTYPE uint64_t +#else #define NF10BMAC_DATA_STRB 0x0000000f +#define REGWTYPE uint32_t +#endif static inline void -nf10bmac_write_4(struct resource *res, uint32_t reg, uint32_t val4, +nf10bmac_write(struct resource *res, REGWTYPE reg, REGWTYPE val, const char *f __unused, const int l __unused) { - bus_write_4(res, reg, htole32(val4)); +#ifdef NF10BMAC_64BIT + bus_write_8(res, reg, htole64(val)); +#else + bus_write_4(res, reg, htole32(val)); +#endif } -static inline uint32_t -nf10bmac_read_4(struct resource *res, uint32_t reg, +static inline REGWTYPE +nf10bmac_read(struct resource *res, REGWTYPE reg, const char *f __unused, const int l __unused) { +#ifdef NF10BMAC_64BIT + return (le64toh(bus_read_8(res, reg))); +#else return (le32toh(bus_read_4(res, reg))); +#endif } static inline void -nf10bmac_write_4_be(struct resource *res, uint32_t reg, uint32_t val4, +nf10bmac_write_be(struct resource *res, REGWTYPE reg, REGWTYPE val, const char *f __unused, const int l __unused) { - bus_write_4(res, reg, htobe32(val4)); +#ifdef NF10BMAC_64BIT + bus_write_8(res, reg, htobe64(val)); +#else + bus_write_4(res, reg, htobe32(val)); +#endif } -static inline uint32_t -nf10bmac_read_4_be(struct resource *res, uint32_t reg, +static inline REGWTYPE +nf10bmac_read_be(struct resource *res, REGWTYPE reg, const char *f __unused, const int l __unused) { +#ifdef NF10BMAC_64BIT + return (be64toh(bus_read_8(res, reg))); +#else return (be32toh(bus_read_4(res, reg))); +#endif } -#define NF10BMAC_WRITE_CTRL_4(sc, reg, val) \ - nf10bmac_write_4((sc)->nf10bmac_mem_res, (reg), (val), \ +#define NF10BMAC_WRITE_CTRL(sc, reg, val) \ + nf10bmac_write((sc)->nf10bmac_ctrl_res, (reg), (val), \ __func__, __LINE__) -#define NF10BMAC_WRITE_4(sc, reg, val) \ - nf10bmac_write_4((sc)->nf10bmac_tx_mem_res, (reg), (val), \ +#define NF10BMAC_WRITE(sc, reg, val) \ + nf10bmac_write((sc)->nf10bmac_tx_mem_res, (reg), (val), \ __func__, __LINE__) -#define NF10BMAC_READ_4(sc, reg) \ - nf10bmac_read_4((sc)->nf10bmac_rx_mem_res, (reg), \ +#define NF10BMAC_READ(sc, reg) \ + nf10bmac_read((sc)->nf10bmac_rx_mem_res, (reg), \ __func__, __LINE__) -#define NF10BMAC_WRITE_4_BE(sc, reg, val) \ - nf10bmac_write_4_be((sc)->nf10bmac_tx_mem_res, (reg), (val), \ +#define NF10BMAC_WRITE_BE(sc, reg, val) \ + nf10bmac_write_be((sc)->nf10bmac_tx_mem_res, (reg), (val), \ __func__, __LINE__) -#define NF10BMAC_READ_4_BE(sc, reg) \ - nf10bmac_read_4_be((sc)->nf10bmac_rx_mem_res, (reg), \ +#define NF10BMAC_READ_BE(sc, reg) \ + nf10bmac_read_be((sc)->nf10bmac_rx_mem_res, (reg), \ __func__, __LINE__) +#define NF10BMAC_WRITE_INTR(sc, reg, val, _f, _l) \ + nf10bmac_write((sc)->nf10bmac_intr_res, (reg), (val), \ + (_f), (_l)) + +#define NF10BMAC_RX_INTR_CLEAR_DIS(sc) \ + NF10BMAC_WRITE_INTR((sc), NF10BMAC_INTR_CLEAR_DIS, 1, \ + __func__, __LINE__) +#define NF10BMAC_RX_INTR_ENABLE(sc) \ + NF10BMAC_WRITE_INTR((sc), NF10BMAC_INTR_CTRL, 1, \ + __func__, __LINE__) +#define NF10BMAC_RX_INTR_DISABLE(sc) \ + NF10BMAC_WRITE_INTR((sc), NF10BMAC_INTR_CTRL, 0, \ + __func__, __LINE__) + + #ifdef ENABLE_WATCHDOG static void nf10bmac_tick(void *); #endif @@ -178,7 +218,7 @@ static int nf10bmac_tx_locked(struct nf10bmac_softc *sc, struct mbuf *m) { int32_t len, l, ml; - uint32_t m4, val4; + REGWTYPE md, val; NF10BMAC_LOCK_ASSERT(sc); @@ -193,16 +233,16 @@ nf10bmac_tx_locked(struct nf10bmac_softc len = m->m_pkthdr.len; /* Write the length at start of packet. */ - NF10BMAC_WRITE_4(sc, NF10BMAC_TX_LEN, len); + NF10BMAC_WRITE(sc, NF10BMAC_TX_LEN, len); /* Write the meta data and data. */ - ml = len / sizeof(val4); - len -= (ml * sizeof(val4)); + ml = len / sizeof(val); + len -= (ml * sizeof(val)); for (l = 0; l <= ml; l++) { int32_t cl; - cl = sizeof(val4); - m4 = (NF10BMAC_TUSER_CPU0 << NF10BMAC_DATA_SPORT_SHIFT); + cl = sizeof(val); + md = (NF10BMAC_TUSER_CPU0 << NF10BMAC_DATA_SPORT_SHIFT); if (l == ml || (len == 0 && l == (ml - 1))) { if (l == ml && len == 0) { break; @@ -211,20 +251,20 @@ nf10bmac_tx_locked(struct nf10bmac_softc int sl; if (l == (ml - 1)) - len = 4; + len = sizeof(val); cl = len; for (s = 0, sl = len; sl > 0; sl--) s |= (1 << (sl - 1)); - m4 |= (s & NF10BMAC_DATA_STRB); - m4 |= NF10BMAC_DATA_LAST; + md |= (s & NF10BMAC_DATA_STRB); + md |= NF10BMAC_DATA_LAST; } } else { - m4 |= NF10BMAC_DATA_STRB; + md |= NF10BMAC_DATA_STRB; } - NF10BMAC_WRITE_4(sc, NF10BMAC_TX_META, m4); - bcopy(&sc->nf10bmac_tx_buf[l*sizeof(val4)], &val4, cl); - NF10BMAC_WRITE_4_BE(sc, NF10BMAC_TX_DATA, val4); + NF10BMAC_WRITE(sc, NF10BMAC_TX_META, md); + bcopy(&sc->nf10bmac_tx_buf[l*sizeof(val)], &val, cl); + NF10BMAC_WRITE_BE(sc, NF10BMAC_TX_DATA, val); } /* If anyone is interested give them a copy. */ @@ -293,14 +333,14 @@ nf10bmac_start(struct ifnet *ifp) static void nf10bmac_eat_packet_munch_munch(struct nf10bmac_softc *sc) { - uint32_t m4, val4; + REGWTYPE md, val; do { - m4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_META); - if ((m4 & NF10BMAC_DATA_STRB) != 0) - val4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_DATA); - } while ((m4 & NF10BMAC_DATA_STRB) != 0 && - (m4 & NF10BMAC_DATA_LAST) == 0); + md = NF10BMAC_READ_BE(sc, NF10BMAC_RX_META); + if ((md & NF10BMAC_DATA_STRB) != 0) + val = NF10BMAC_READ_BE(sc, NF10BMAC_RX_DATA); + } while ((md & NF10BMAC_DATA_STRB) != 0 && + (md & NF10BMAC_DATA_LAST) == 0); } static int @@ -308,7 +348,7 @@ nf10bmac_rx_locked(struct nf10bmac_softc { struct ifnet *ifp; struct mbuf *m; - uint32_t m4, val4; + REGWTYPE md, val; int32_t len, l; /* @@ -318,21 +358,21 @@ nf10bmac_rx_locked(struct nf10bmac_softc * skip to tlast). */ - len = NF10BMAC_READ_4(sc, NF10BMAC_RX_LEN); + len = NF10BMAC_READ(sc, NF10BMAC_RX_LEN) & NF10BMAC_DATA_LEN_MASK; if (len > (MCLBYTES - ETHER_ALIGN)) { nf10bmac_eat_packet_munch_munch(sc); return (0); } - m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META); - if (len == 0 && (m4 & NF10BMAC_DATA_STRB) == 0) { + md = NF10BMAC_READ(sc, NF10BMAC_RX_META); + if (len == 0 && (md & NF10BMAC_DATA_STRB) == 0) { /* No packet data available. */ return (0); - } else if (len == 0 && (m4 & NF10BMAC_DATA_STRB) != 0) { + } else if (len == 0 && (md & NF10BMAC_DATA_STRB) != 0) { /* We are in the middle of a packet. */ nf10bmac_eat_packet_munch_munch(sc); return (0); - } else if ((m4 & NF10BMAC_DATA_STRB) == 0) { + } else if ((md & NF10BMAC_DATA_STRB) == 0) { /* Invalid length "hint". */ device_printf(sc->nf10bmac_dev, "Unexpected length %d on zero strb\n", len); @@ -359,13 +399,13 @@ nf10bmac_rx_locked(struct nf10bmac_softc ifp = sc->nf10bmac_ifp; l = 0; /* - while ((m4 & NF10BMAC_DATA_STRB) != 0 && l < len) { + while ((md & NF10BMAC_DATA_STRB) != 0 && l < len) { */ while (l < len) { size_t cl; - if ((m4 & NF10BMAC_DATA_LAST) == 0 && - (len - l) < sizeof(val4)) { + if ((md & NF10BMAC_DATA_LAST) == 0 && + (len - l) < sizeof(val)) { /* * Our length and LAST disagree. We have a valid STRB. * We could continue until we fill the mbuf and just @@ -376,34 +416,34 @@ nf10bmac_rx_locked(struct nf10bmac_softc ifp->if_ierrors++; m_freem(m); return (0); - } else if ((len - l) <= sizeof(val4)) { + } else if ((len - l) <= sizeof(val)) { cl = len - l; } else { - cl = sizeof(val4); + cl = sizeof(val); } /* Read the first bytes of data as well. */ - val4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_DATA); - bcopy(&val4, (uint8_t *)(m->m_data + l), cl); + val = NF10BMAC_READ_BE(sc, NF10BMAC_RX_DATA); + bcopy(&val, (uint8_t *)(m->m_data + l), cl); l += cl; - if ((m4 & NF10BMAC_DATA_LAST) != 0 || l >= len) + if ((md & NF10BMAC_DATA_LAST) != 0 || l >= len) break; else { DELAY(50); - m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META); + md = NF10BMAC_READ(sc, NF10BMAC_RX_META); } cl = 10; - while ((m4 & NF10BMAC_DATA_STRB) == 0 && cl-- > 0) { + while ((md & NF10BMAC_DATA_STRB) == 0 && cl-- > 0) { DELAY(10); - m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META); + md = NF10BMAC_READ(sc, NF10BMAC_RX_META); } } /* We should get out of this loop with tlast and tsrb. */ - if ((m4 & NF10BMAC_DATA_LAST) == 0 || (m4 & NF10BMAC_DATA_STRB) == 0) { + if ((md & NF10BMAC_DATA_LAST) == 0 || (md & NF10BMAC_DATA_STRB) == 0) { device_printf(sc->nf10bmac_dev, "Unexpected rx loop end state: " - "m4=0x%08x len=%d l=%d\n", m4, len, l); + "md=0x%08jx len=%d l=%d\n", (uintmax_t)md, len, l); ifp->if_ierrors++; m_freem(m); return (0); @@ -435,6 +475,7 @@ nf10bmac_stop_locked(struct nf10bmac_sof ifp = sc->nf10bmac_ifp; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + NF10BMAC_RX_INTR_CLEAR_DIS(sc); sc->nf10bmac_flags &= ~NF10BMAC_FLAGS_LINK; if_link_state_change(ifp, LINK_STATE_DOWN); @@ -446,7 +487,25 @@ static int nf10bmac_reset(struct nf10bmac_softc *sc) { - /* Currently we cannot do anything. */ + /* + * If we do not have an ether address set, initialize to the same + * OUI as NetFPGA-10G Linux driver does (which luckily seems + * unallocated). We just change the NIC specific part from + * the slightly long "\0NF10C0" to "\0NFBSD". + * Oh and we keep the way of setting it from a string as they do. + * It's an amazing way to hide it. + * XXX-BZ If NetFPGA gets their own OUI we should fix this. + */ + if (sc->nf10bmac_eth_addr[0] == 0x00 && + sc->nf10bmac_eth_addr[1] == 0x00 && + sc->nf10bmac_eth_addr[2] == 0x00 && + sc->nf10bmac_eth_addr[3] == 0x00 && + sc->nf10bmac_eth_addr[4] == 0x00 && + sc->nf10bmac_eth_addr[5] == 0x00) { + memcpy(&sc->nf10bmac_eth_addr, "\0NFBSD", ETHER_ADDR_LEN); + sc->nf10bmac_eth_addr[5] += sc->nf10bmac_unit; + } + return (0); } @@ -480,6 +539,16 @@ nf10bmac_init_locked(struct nf10bmac_sof /* Instead drain the FIFO; or at least a possible first packet.. */ nf10bmac_eat_packet_munch_munch(sc); +#ifdef DEVICE_POLLING + /* Only enable interrupts if we are not polling. */ + if (ifp->if_capenable & IFCAP_POLLING) { + NF10BMAC_RX_INTR_CLEAR_DIS(sc); + } else +#endif + { + NF10BMAC_RX_INTR_ENABLE(sc); + } + ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -538,6 +607,49 @@ nf10bmac_tick(void *xsc) } #endif +static void +nf10bmac_intr(void *arg) +{ + struct nf10bmac_softc *sc; + struct ifnet *ifp; + int rx_npkts; + + sc = (struct nf10bmac_softc *)arg; + ifp = sc->nf10bmac_ifp; + + NF10BMAC_LOCK(sc); +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + NF10BMAC_UNLOCK(sc); + return; + } +#endif + + /* NF10BMAC_RX_INTR_DISABLE(sc); */ + NF10BMAC_RX_INTR_CLEAR_DIS(sc); + + /* We only have an RX interrupt and no status information. */ + rx_npkts = 0; + while (rx_npkts < NF10BMAC_MAX_PKTS) { + int c; + + c = nf10bmac_rx_locked(sc); + rx_npkts += c; + if (c == 0) + break; + } + + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* Re-enable interrupts. */ + NF10BMAC_RX_INTR_ENABLE(sc); + + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + nf10bmac_start_locked(ifp); + } + NF10BMAC_UNLOCK(sc); +} + + #ifdef DEVICE_POLLING static int nf10bmac_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) @@ -631,10 +743,16 @@ nf10bmac_ioctl(struct ifnet *ifp, u_long break; } + NF10BMAC_RX_INTR_CLEAR_DIS(sc); + /* * Do not allow disabling of polling if we do * not have interrupts. */ + } else if (sc->nf10bmac_rx_irq_res != NULL) { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + NF10BMAC_RX_INTR_ENABLE(sc); } else { ifp->if_capenable ^= IFCAP_POLLING; error = EINVAL; @@ -655,7 +773,6 @@ nf10bmac_ioctl(struct ifnet *ifp, u_long return (error); } - /* * Generic device handling routines. */ @@ -715,18 +832,40 @@ nf10bmac_attach(device_t dev) ifmedia_add(&sc->nf10bmac_media, IFM_ETHER | IFM_10G_T, 0, NULL); ifmedia_set(&sc->nf10bmac_media, IFM_ETHER | IFM_10G_T); - /* Interrupts would go here. */ + /* Initialise. */ + error = 0; + + /* Hook up interrupts. Well the one. */ + if (sc->nf10bmac_rx_irq_res != NULL) { + error = bus_setup_intr(dev, sc->nf10bmac_rx_irq_res, + INTR_TYPE_NET | INTR_MPSAFE, NULL, nf10bmac_intr, + sc, &sc->nf10bmac_rx_intrhand); + if (error != 0) { + device_printf(dev, "enabling RX IRQ failed\n"); + ether_ifdetach(ifp); + goto err; + } + } + if ((ifp->if_capenable & IFCAP_POLLING) != 0 || + sc->nf10bmac_rx_irq_res == NULL) { #ifdef DEVICE_POLLING - ifp->if_capenable |= IFCAP_POLLING; - device_printf(dev, "forcing to polling due to no interrupts\n"); - error = ether_poll_register(nf10bmac_poll, ifp); - if (error != 0) - goto err; + /* If not on and no IRQs force it on. */ + if (sc->nf10bmac_rx_irq_res == NULL) { + ifp->if_capenable |= IFCAP_POLLING; + device_printf(dev, + "forcing to polling due to no interrupts\n"); + } + error = ether_poll_register(nf10bmac_poll, ifp); + if (error != 0) + goto err; #else - device_printf(dev, "no DEVICE_POLLING in kernel and no IRQs\n"); - error = ENXIO; + device_printf(dev, "no DEVICE_POLLING in kernel and no IRQs\n"); + error = ENXIO; #endif + } else { + NF10BMAC_RX_INTR_ENABLE(sc); + } err: if (error != 0) @@ -762,6 +901,10 @@ nf10bmac_detach(device_t dev) ether_ifdetach(ifp); } + if (sc->nf10bmac_rx_intrhand) + bus_teardown_intr(dev, sc->nf10bmac_rx_irq_res, + sc->nf10bmac_rx_intrhand); + if (ifp != NULL) if_free(ifp); ifmedia_removeall(&sc->nf10bmac_media); @@ -779,10 +922,15 @@ nf10bmac_detach_resources(device_t dev) sc = device_get_softc(dev); - if (sc->nf10bmac_mem_res != NULL) { + if (sc->nf10bmac_rx_irq_res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, sc->nf10bmac_rx_irq_rid, + sc->nf10bmac_rx_irq_res); + sc->nf10bmac_rx_irq_res = NULL; + } + if (sc->nf10bmac_intr_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, - sc->nf10bmac_mem_rid, sc->nf10bmac_mem_res); - sc->nf10bmac_mem_res = NULL; + sc->nf10bmac_intr_rid, sc->nf10bmac_intr_res); + sc->nf10bmac_intr_res = NULL; } if (sc->nf10bmac_rx_mem_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, @@ -794,6 +942,11 @@ nf10bmac_detach_resources(device_t dev) sc->nf10bmac_tx_mem_rid, sc->nf10bmac_tx_mem_res); sc->nf10bmac_tx_mem_res = NULL; } + if (sc->nf10bmac_ctrl_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->nf10bmac_ctrl_rid, sc->nf10bmac_ctrl_res); + sc->nf10bmac_ctrl_res = NULL; + } } int Modified: stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c Thu Apr 17 12:33:26 2014 (r264601) +++ stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c Sat Aug 16 14:30:46 2014 (r270061) @@ -85,16 +85,34 @@ nf10bmac_attach_fdt(device_t dev) /* * FDT lists our resources. For convenience we use three different * mappings. We need to attach them in the oder specified in .dts: - * TX (size 0xc), RX (size 0xc), LOOP (size 0x4). + * LOOP (size 0x1f), TX (0x2f), RX (0x2f), INTR (0xf). */ + /* + * LOOP memory region (this could be a general control region). + * 0x00: 32/64bit register to enable a Y-"lopback". + */ + sc->nf10bmac_ctrl_rid = 0; + sc->nf10bmac_ctrl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->nf10bmac_ctrl_rid, RF_ACTIVE); + if (sc->nf10bmac_ctrl_res == NULL) { + device_printf(dev, "failed to map memory for CTRL region\n"); + error = ENXIO; + goto err; + } + if (bootverbose) + device_printf(sc->nf10bmac_dev, "CTRL region at mem %p-%p\n", + (void *)rman_get_start(sc->nf10bmac_ctrl_res), + (void *)(rman_get_start(sc->nf10bmac_ctrl_res) + + rman_get_size(sc->nf10bmac_ctrl_res))); + /* * TX and TX metadata FIFO memory region. - * 0x00: 32bit FIFO data, - * 0x04: 32bit FIFO metadata, - * 0x08: 32bit packet length. + * 0x00: 32/64bit FIFO data, + * 0x08: 32/64bit FIFO metadata, + * 0x10: 32/64bit packet length. */ - sc->nf10bmac_tx_mem_rid = 0; + sc->nf10bmac_tx_mem_rid = 1; sc->nf10bmac_tx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->nf10bmac_tx_mem_rid, RF_ACTIVE); if (sc->nf10bmac_tx_mem_res == NULL) { @@ -110,11 +128,11 @@ nf10bmac_attach_fdt(device_t dev) /* * RX and RXC metadata FIFO memory region. - * 0x00: 32bit FIFO data, - * 0x04: 32bit FIFO metadata, - * 0x08: 32bit packet length. + * 0x00: 32/64bit FIFO data, + * 0x08: 32/64bit FIFO metadata, + * 0x10: 32/64bit packet length. */ - sc->nf10bmac_rx_mem_rid = 1; + sc->nf10bmac_rx_mem_rid = 2; sc->nf10bmac_rx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->nf10bmac_rx_mem_rid, RF_ACTIVE); if (sc->nf10bmac_rx_mem_res == NULL) { @@ -129,22 +147,28 @@ nf10bmac_attach_fdt(device_t dev) rman_get_size(sc->nf10bmac_rx_mem_res))); /* - * LOOP memory region (this could be a general control region). - * 0x00: 32bit register to enable a Y-"lopback". + * Interrupt handling registers. + * 0x00: 32/64bit register to clear (and disable) the RX interrupt. + * 0x08: 32/64bit register to enable or disable the RX interrupt. */ - sc->nf10bmac_mem_rid = 2; - sc->nf10bmac_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->nf10bmac_mem_rid, RF_ACTIVE); - if (sc->nf10bmac_mem_res == NULL) { - device_printf(dev, "failed to map memory for CTRL region\n"); + sc->nf10bmac_intr_rid = 3; + sc->nf10bmac_intr_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->nf10bmac_intr_rid, RF_ACTIVE); + if (sc->nf10bmac_intr_res == NULL) { + device_printf(dev, "failed to map memory for INTR region\n"); error = ENXIO; goto err; } if (bootverbose) - device_printf(sc->nf10bmac_dev, "CTRL region at mem %p-%p\n", - (void *)rman_get_start(sc->nf10bmac_mem_res), - (void *)(rman_get_start(sc->nf10bmac_mem_res) + - rman_get_size(sc->nf10bmac_mem_res))); + device_printf(sc->nf10bmac_dev, "INTR region at mem %p-%p\n", + (void *)rman_get_start(sc->nf10bmac_intr_res), + (void *)(rman_get_start(sc->nf10bmac_intr_res) + + rman_get_size(sc->nf10bmac_intr_res))); + + /* (Optional) RX and TX IRQ. */ + sc->nf10bmac_rx_irq_rid = 0; + sc->nf10bmac_rx_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->nf10bmac_rx_irq_rid, RF_ACTIVE | RF_SHAREABLE); error = nf10bmac_attach(dev); if (error) Modified: stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h Thu Apr 17 12:33:26 2014 (r264601) +++ stable/10/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h Sat Aug 16 14:30:46 2014 (r270061) @@ -35,15 +35,20 @@ struct nf10bmac_softc { struct ifnet *nf10bmac_ifp; + struct resource *nf10bmac_ctrl_res; struct resource *nf10bmac_tx_mem_res; struct resource *nf10bmac_rx_mem_res; - struct resource *nf10bmac_mem_res; + struct resource *nf10bmac_intr_res; + struct resource *nf10bmac_rx_irq_res; + void *nf10bmac_rx_intrhand; uint8_t *nf10bmac_tx_buf; device_t nf10bmac_dev; int nf10bmac_unit; + int nf10bmac_ctrl_rid; int nf10bmac_tx_mem_rid; int nf10bmac_rx_mem_rid; - int nf10bmac_mem_rid; + int nf10bmac_intr_rid; + int nf10bmac_rx_irq_rid; int nf10bmac_if_flags; uint32_t nf10bmac_flags; #define NF10BMAC_FLAGS_LINK 0x00000001 Modified: stable/10/sys/mips/beri/files.beri ============================================================================== --- stable/10/sys/mips/beri/files.beri Sat Aug 16 14:21:03 2014 (r270060) +++ stable/10/sys/mips/beri/files.beri Sat Aug 16 14:30:46 2014 (r270061) @@ -6,6 +6,8 @@ dev/altera/jtag_uart/altera_jtag_uart_co dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_fdt.c optional altera_jtag_uart fdt dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart +dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c optional netfpga10g_nf10bmac fdt +dev/netfpga10g/nf10bmac/if_nf10bmac.c optional netfpga10g_nf10bmac dev/terasic/de4led/terasic_de4led.c optional terasic_de4led dev/terasic/de4led/terasic_de4led_fdt.c optional terasic_de4led fdt dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led Modified: stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT Sat Aug 16 14:21:03 2014 (r270060) +++ stable/10/sys/mips/conf/BERI_NETFPGA_MDROOT Sat Aug 16 14:30:46 2014 (r270061) @@ -19,6 +19,11 @@ makeoptions FDT_DTS_FILE=beri-netfpga.dt #device uart device altera_jtag_uart +device bpf + +options DEVICE_POLLING +device netfpga10g_nf10bmac + # # This kernel configuration uses an embedded memory root file system. # Adjust the following path and size based on local requirements. Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Sat Aug 16 14:21:03 2014 (r270060) +++ stable/10/sys/modules/Makefile Sat Aug 16 14:30:46 2014 (r270061) @@ -239,6 +239,7 @@ SUBDIR= \ ${_ncp} \ ${_ncv} \ ${_ndis} \ + netfpga10g \ ${_netgraph} \ ${_nfe} \ nfs_common \ From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 14:56:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D53DB66F; Sat, 16 Aug 2014 14:56:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A68A124FB; Sat, 16 Aug 2014 14:56:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GEuCt3084663; Sat, 16 Aug 2014 14:56:12 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GEuCIg084659; Sat, 16 Aug 2014 14:56:12 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201408161456.s7GEuCIg084659@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sat, 16 Aug 2014 14:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270062 - in head: sbin/umount usr.bin/showmount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 14:56:12 -0000 Author: peter Date: Sat Aug 16 14:56:11 2014 New Revision: 270062 URL: http://svnweb.freebsd.org/changeset/base/270062 Log: Use mount protocol version 3 by default for showmount and umount. mount_nfs effectively uses mount protocol v3 by default already. v1 mount protocol is being removed along with nfsv2 by a high profile NFS appliance vendor and our legacy v1 mount protocol usage causes rpc errors. Modified: head/sbin/umount/umount.c head/usr.bin/showmount/showmount.8 head/usr.bin/showmount/showmount.c Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Sat Aug 16 14:30:46 2014 (r270061) +++ head/sbin/umount/umount.c Sat Aug 16 14:56:11 2014 (r270062) @@ -394,7 +394,7 @@ umountfs(struct statfs *sfs) * has been unmounted. */ if (ai != NULL && !(fflag & MNT_FORCE) && do_rpc) { - clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS, "udp"); + clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS3, "udp"); if (clp == NULL) { warnx("%s: %s", hostp, clnt_spcreateerror("MOUNTPROG")); Modified: head/usr.bin/showmount/showmount.8 ============================================================================== --- head/usr.bin/showmount/showmount.8 Sat Aug 16 14:30:46 2014 (r270061) +++ head/usr.bin/showmount/showmount.8 Sat Aug 16 14:56:11 2014 (r270062) @@ -31,7 +31,7 @@ .\" @(#)showmount.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd March 29, 1995 +.Dd August 16, 2014 .Dt SHOWMOUNT 8 .Os .Sh NAME @@ -41,6 +41,7 @@ .Nm .Op Fl a | d .Op Fl e +.Op Fl 1 .Op Fl 3 .Op Ar host .Sh DESCRIPTION @@ -76,10 +77,10 @@ List directory paths of mount points ins Show the .Ar host Ns 's exports list. +.It Fl 1 +Use mount protocol Version 1, compatible with legacy servers. .It Fl 3 -Use mount protocol Version 3, compatible with -.Tn NFS -Version 3. +Ignored for backwards compatibility. .El .Sh SEE ALSO .Xr mount 8 , Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Sat Aug 16 14:30:46 2014 (r270061) +++ head/usr.bin/showmount/showmount.c Sat Aug 16 14:56:11 2014 (r270062) @@ -110,11 +110,11 @@ main(int argc, char **argv) { register struct exportslist *exp; register struct grouplist *grp; - register int rpcs = 0, mntvers = 1; + register int rpcs = 0, mntvers = 3; const char *host; int ch, estat; - while ((ch = getopt(argc, argv, "ade3")) != -1) + while ((ch = getopt(argc, argv, "ade13")) != -1) switch (ch) { case 'a': if (type == 0) { @@ -133,6 +133,9 @@ main(int argc, char **argv) case 'e': rpcs |= DOEXPORTS; break; + case '1': + mntvers = 1; + break; case '3': mntvers = 3; break; From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 15:00:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8964B8AF; Sat, 16 Aug 2014 15:00:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F1E251C; Sat, 16 Aug 2014 15:00:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GF03pY085557; Sat, 16 Aug 2014 15:00:03 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GF01KC085529; Sat, 16 Aug 2014 15:00:01 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201408161500.s7GF01KC085529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sat, 16 Aug 2014 15:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270063 - in head: sys/conf sys/dev/cxgbe sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/virtio/network sys/net tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 15:00:03 -0000 Author: luigi Date: Sat Aug 16 15:00:01 2014 New Revision: 270063 URL: http://svnweb.freebsd.org/changeset/base/270063 Log: Update to the current version of netmap. Mostly bugfixes or features developed in the past 6 months, so this is a 10.1 candidate. Basically no user API changes (some bugfixes in sys/net/netmap_user.h). In detail: 1. netmap support for virtio-net, including in netmap mode. Under bhyve and with a netmap backend [2] we reach over 1Mpps with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode. 2. (kernel) add support for multiple memory allocators, so we can better partition physical and virtual interfaces giving access to separate users. The most visible effect is one additional argument to the various kernel functions to compute buffer addresses. All netmap-supported drivers are affected, but changes are mechanical and trivial 3. (kernel) simplify the prototype for *txsync() and *rxsync() driver methods. All netmap drivers affected, changes mostly mechanical. 4. add support for netmap-monitor ports. Think of it as a mirroring port on a physical switch: a netmap monitor port replicates traffic present on the main port. Restrictions apply. Drive carefully. 5. if_lem.c: support for various paravirtualization features, experimental and disabled by default. Most of these are described in our ANCS'13 paper [1]. Paravirtualized support in netmap mode is new, and beats the numbers in the paper by a large factor (under qemu-kvm, we measured gues-host throughput up to 10-12 Mpps). A lot of refactoring and additional documentation in the files in sys/dev/netmap, but apart from #2 and #3 above, almost nothing of this stuff is visible to other kernel parts. Example programs in tools/tools/netmap have been updated with bugfixes and to support more of the existing features. This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline. A lot of this code has been contributed by my colleagues at UNIPI, including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella. MFC after: 3 days. Added: head/sys/dev/netmap/if_vtnet_netmap.h (contents, props changed) head/sys/dev/netmap/netmap_monitor.c (contents, props changed) head/sys/net/paravirt.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mbq.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/dev/netmap/netmap_offloadings.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_vale.c head/sys/dev/virtio/network/if_vtnet.c head/sys/net/netmap.h head/sys/net/netmap_user.h head/tools/tools/netmap/pkt-gen.c head/tools/tools/netmap/vale-ctl.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/conf/files Sat Aug 16 15:00:01 2014 (r270063) @@ -1948,6 +1948,7 @@ dev/netmap/netmap_freebsd.c optional net dev/netmap/netmap_generic.c optional netmap dev/netmap/netmap_mbq.c optional netmap dev/netmap/netmap_mem2.c optional netmap +dev/netmap/netmap_monitor.c optional netmap dev/netmap/netmap_offloadings.c optional netmap dev/netmap/netmap_pipe.c optional netmap dev/netmap/netmap_vale.c optional netmap Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/cxgbe/t4_netmap.c Sat Aug 16 15:00:01 2014 (r270063) @@ -434,19 +434,18 @@ cxgbe_netmap_on(struct adapter *sc, stru hwb = &sc->sge.hw_buf_info[0]; for (i = 0; i < SGE_FLBUF_SIZES; i++, hwb++) { - if (hwb->size == NETMAP_BUF_SIZE) + if (hwb->size == NETMAP_BUF_SIZE(na)) break; } if (i >= SGE_FLBUF_SIZES) { if_printf(ifp, "no hwidx for netmap buffer size %d.\n", - NETMAP_BUF_SIZE); + NETMAP_BUF_SIZE(na)); return (ENXIO); } hwidx = i; /* Must set caps before calling netmap_reset */ - na->na_flags |= (NAF_NATIVE_ON | NAF_NETMAP_ON); - ifp->if_capenable |= IFCAP_NETMAP; + nm_set_native_flags(na); for_each_nm_rxq(pi, i, nm_rxq) { alloc_nm_rxq_hwq(pi, nm_rxq); @@ -460,7 +459,7 @@ cxgbe_netmap_on(struct adapter *sc, stru for (j = 0; j < nm_rxq->fl_sidx - 8; j++) { uint64_t ba; - PNMB(&slot[j], &ba); + PNMB(na, &slot[j], &ba); nm_rxq->fl_desc[j] = htobe64(ba | hwidx); } nm_rxq->fl_pidx = j; @@ -512,8 +511,7 @@ cxgbe_netmap_off(struct adapter *sc, str rc = -t4_enable_vi(sc, sc->mbox, pi->nm_viid, false, false); if (rc != 0) if_printf(ifp, "netmap disable_vi failed: %d\n", rc); - na->na_flags &= ~(NAF_NATIVE_ON | NAF_NETMAP_ON); - ifp->if_capenable &= ~IFCAP_NETMAP; + nm_clear_native_flags(na); /* * XXXNM: We need to make sure that the tx queues are quiet and won't @@ -669,7 +667,7 @@ cxgbe_nm_tx(struct adapter *sc, struct s for (i = 0; i < n; i++) { slot = &ring->slot[kring->nr_hwcur]; - PNMB(slot, &ba); + PNMB(kring->na, slot, &ba); cpl->ctrl0 = nm_txq->cpl_ctrl0; cpl->pack = 0; @@ -786,13 +784,13 @@ reclaim_nm_tx_desc(struct sge_nm_txq *nm } static int -cxgbe_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) +cxgbe_netmap_txsync(struct netmap_kring *kring, int flags) { - struct netmap_kring *kring = &na->tx_rings[ring_nr]; + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; struct port_info *pi = ifp->if_softc; struct adapter *sc = pi->adapter; - struct sge_nm_txq *nm_txq = &sc->sge.nm_txq[pi->first_nm_txq + ring_nr]; + struct sge_nm_txq *nm_txq = &sc->sge.nm_txq[pi->first_nm_txq + kring->ring_id]; const u_int head = kring->rhead; u_int reclaimed = 0; int n, d, npkt_remaining, ndesc_remaining; @@ -851,14 +849,14 @@ cxgbe_netmap_txsync(struct netmap_adapte } static int -cxgbe_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) +cxgbe_netmap_rxsync(struct netmap_kring *kring, int flags) { - struct netmap_kring *kring = &na->rx_rings[ring_nr]; + struct netmap_adapter *na = kring->na; struct netmap_ring *ring = kring->ring; struct ifnet *ifp = na->ifp; struct port_info *pi = ifp->if_softc; struct adapter *sc = pi->adapter; - struct sge_nm_rxq *nm_rxq = &sc->sge.nm_rxq[pi->first_nm_rxq + ring_nr]; + struct sge_nm_rxq *nm_rxq = &sc->sge.nm_rxq[pi->first_nm_rxq + kring->ring_id]; u_int const head = nm_rxsync_prologue(kring); u_int n; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; @@ -891,7 +889,7 @@ cxgbe_netmap_rxsync(struct netmap_adapte while (n > 0) { for (i = 0; i < 8; i++, fl_pidx++, slot++) { - PNMB(slot, &ba); + PNMB(na, slot, &ba); nm_rxq->fl_desc[fl_pidx] = htobe64(ba | hwidx); slot->flags &= ~NS_BUF_CHANGED; MPASS(fl_pidx <= nm_rxq->fl_sidx); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/e1000/if_em.c Sat Aug 16 15:00:01 2014 (r270063) @@ -3340,10 +3340,10 @@ em_setup_transmit_ring(struct tx_ring *t uint64_t paddr; void *addr; - addr = PNMB(slot + si, &paddr); + addr = PNMB(na, slot + si, &paddr); txr->tx_base[i].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ - netmap_load_map(txr->txtag, txbuf->map, addr); + netmap_load_map(na, txr->txtag, txbuf->map, addr); } #endif /* DEV_NETMAP */ @@ -4082,8 +4082,8 @@ em_setup_receive_ring(struct rx_ring *rx uint64_t paddr; void *addr; - addr = PNMB(slot + si, &paddr); - netmap_load_map(rxr->rxtag, rxbuf->map, addr); + addr = PNMB(na, slot + si, &paddr); + netmap_load_map(na, rxr->rxtag, rxbuf->map, addr); /* Update descriptor */ rxr->rx_base[j].buffer_addr = htole64(paddr); continue; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/e1000/if_igb.c Sat Aug 16 15:00:01 2014 (r270063) @@ -3629,7 +3629,7 @@ igb_setup_transmit_ring(struct tx_ring * if (slot) { int si = netmap_idx_n2k(&na->tx_rings[txr->me], i); /* no need to set the address */ - netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); + netmap_load_map(na, txr->txtag, txbuf->map, NMB(na, slot + si)); } #endif /* DEV_NETMAP */ /* clear the watch index */ @@ -4433,8 +4433,8 @@ igb_setup_receive_ring(struct rx_ring *r uint64_t paddr; void *addr; - addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->ptag, rxbuf->pmap, addr); + addr = PNMB(na, slot + sj, &paddr); + netmap_load_map(na, rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ rxr->rx_base[j].read.pkt_addr = htole64(paddr); continue; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/e1000/if_lem.c Sat Aug 16 15:00:01 2014 (r270063) @@ -32,6 +32,15 @@ ******************************************************************************/ /*$FreeBSD$*/ +/* + * Uncomment the following extensions for better performance in a VM, + * especially if you have support in the hypervisor. + * See http://info.iet.unipi.it/~luigi/netmap/ + */ +// #define BATCH_DISPATCH +// #define NIC_SEND_COMBINING +// #define NIC_PARAVIRT /* enable virtio-like synchronization */ + #include "opt_inet.h" #include "opt_inet6.h" @@ -291,6 +300,10 @@ static int lem_tx_int_delay_dflt = EM_TI static int lem_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); static int lem_tx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_TADV); static int lem_rx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_RADV); +/* + * increase lem_rxd and lem_txd to at least 2048 in netmap mode + * for better performance. + */ static int lem_rxd = EM_DEFAULT_RXD; static int lem_txd = EM_DEFAULT_TXD; static int lem_smart_pwr_down = FALSE; @@ -460,6 +473,20 @@ lem_attach(device_t dev) "max number of rx packets to process", &adapter->rx_process_limit, lem_rx_process_limit); +#ifdef NIC_SEND_COMBINING + /* Sysctls to control mitigation */ + lem_add_rx_process_limit(adapter, "sc_enable", + "driver TDT mitigation", &adapter->sc_enable, 0); +#endif /* NIC_SEND_COMBINING */ +#ifdef BATCH_DISPATCH + lem_add_rx_process_limit(adapter, "batch_enable", + "driver rx batch", &adapter->batch_enable, 0); +#endif /* BATCH_DISPATCH */ +#ifdef NIC_PARAVIRT + lem_add_rx_process_limit(adapter, "rx_retries", + "driver rx retries", &adapter->rx_retries, 0); +#endif /* NIC_PARAVIRT */ + /* Sysctl for setting the interface flow control */ lem_set_flow_cntrl(adapter, "flow_control", "flow control setting", @@ -517,6 +544,49 @@ lem_attach(device_t dev) */ adapter->hw.mac.report_tx_early = 1; +#ifdef NIC_PARAVIRT + device_printf(dev, "driver supports paravirt, subdev 0x%x\n", + adapter->hw.subsystem_device_id); + if (adapter->hw.subsystem_device_id == E1000_PARA_SUBDEV) { + uint64_t bus_addr; + + device_printf(dev, "paravirt support on dev %p\n", adapter); + tsize = 4096; // XXX one page for the csb + if (lem_dma_malloc(adapter, tsize, &adapter->csb_mem, BUS_DMA_NOWAIT)) { + device_printf(dev, "Unable to allocate csb memory\n"); + error = ENOMEM; + goto err_csb; + } + /* Setup the Base of the CSB */ + adapter->csb = (struct paravirt_csb *)adapter->csb_mem.dma_vaddr; + /* force the first kick */ + adapter->csb->host_need_txkick = 1; /* txring empty */ + adapter->csb->guest_need_rxkick = 1; /* no rx packets */ + bus_addr = adapter->csb_mem.dma_paddr; + lem_add_rx_process_limit(adapter, "csb_on", + "enable paravirt.", &adapter->csb->guest_csb_on, 0); + lem_add_rx_process_limit(adapter, "txc_lim", + "txc_lim", &adapter->csb->host_txcycles_lim, 1); + + /* some stats */ +#define PA_SC(name, var, val) \ + lem_add_rx_process_limit(adapter, name, name, var, val) + PA_SC("host_need_txkick",&adapter->csb->host_need_txkick, 1); + PA_SC("host_rxkick_at",&adapter->csb->host_rxkick_at, ~0); + PA_SC("guest_need_txkick",&adapter->csb->guest_need_txkick, 0); + PA_SC("guest_need_rxkick",&adapter->csb->guest_need_rxkick, 1); + PA_SC("tdt_reg_count",&adapter->tdt_reg_count, 0); + PA_SC("tdt_csb_count",&adapter->tdt_csb_count, 0); + PA_SC("tdt_int_count",&adapter->tdt_int_count, 0); + PA_SC("guest_need_kick_count",&adapter->guest_need_kick_count, 0); + /* tell the host where the block is */ + E1000_WRITE_REG(&adapter->hw, E1000_CSBAH, + (u32)(bus_addr >> 32)); + E1000_WRITE_REG(&adapter->hw, E1000_CSBAL, + (u32)bus_addr); + } +#endif /* NIC_PARAVIRT */ + tsize = roundup2(adapter->num_tx_desc * sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); @@ -675,6 +745,11 @@ err_hw_init: err_rx_desc: lem_dma_free(adapter, &adapter->txdma); err_tx_desc: +#ifdef NIC_PARAVIRT + lem_dma_free(adapter, &adapter->csb_mem); +err_csb: +#endif /* NIC_PARAVIRT */ + err_pci: if (adapter->ifp != (void *)NULL) if_free_drv(adapter->ifp); @@ -762,6 +837,12 @@ lem_detach(device_t dev) adapter->rx_desc_base = NULL; } +#ifdef NIC_PARAVIRT + if (adapter->csb) { + lem_dma_free(adapter, &adapter->csb_mem); + adapter->csb = NULL; + } +#endif /* NIC_PARAVIRT */ lem_release_hw_control(adapter); free(adapter->mta, M_DEVBUF); EM_TX_LOCK_DESTROY(adapter); @@ -871,6 +952,16 @@ lem_start_locked(if_t ifp) } if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); +#ifdef NIC_PARAVIRT + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE && adapter->csb && + adapter->csb->guest_csb_on && + !(adapter->csb->guest_need_txkick & 1)) { + adapter->csb->guest_need_txkick = 1; + adapter->guest_need_kick_count++; + // XXX memory barrier + lem_txeof(adapter); // XXX possibly clear IFF_DRV_OACTIVE + } +#endif /* NIC_PARAVIRT */ return; } @@ -1716,6 +1807,37 @@ lem_xmit(struct adapter *adapter, struct */ bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + +#ifdef NIC_PARAVIRT + if (adapter->csb) { + adapter->csb->guest_tdt = i; + /* XXX memory barrier ? */ + if (adapter->csb->guest_csb_on && + !(adapter->csb->host_need_txkick & 1)) { + /* XXX maybe useless + * clean the ring. maybe do it before ? + * maybe a little bit of histeresys ? + */ + if (adapter->num_tx_desc_avail <= 64) {// XXX + lem_txeof(adapter); + } + return (0); + } + } +#endif /* NIC_PARAVIRT */ + +#ifdef NIC_SEND_COMBINING + if (adapter->sc_enable) { + if (adapter->shadow_tdt & MIT_PENDING_INT) { + /* signal intr and data pending */ + adapter->shadow_tdt = MIT_PENDING_TDT | (i & 0xffff); + return (0); + } else { + adapter->shadow_tdt = MIT_PENDING_INT; + } + } +#endif /* NIC_SEND_COMBINING */ + if (adapter->hw.mac.type == e1000_82547 && adapter->link_duplex == HALF_DUPLEX) lem_82547_move_tail(adapter); @@ -1959,6 +2081,20 @@ lem_local_timer(void *arg) lem_smartspeed(adapter); +#ifdef NIC_PARAVIRT + /* recover space if needed */ + if (adapter->csb && adapter->csb->guest_csb_on && + (adapter->watchdog_check == TRUE) && + (ticks - adapter->watchdog_time > EM_WATCHDOG) && + (adapter->num_tx_desc_avail != adapter->num_tx_desc) ) { + lem_txeof(adapter); + /* + * lem_txeof() normally (except when space in the queue + * runs low XXX) cleans watchdog_check so that + * we do not hung. + */ + } +#endif /* NIC_PARAVIRT */ /* * We check the watchdog: the time since * the last TX descriptor was cleaned. @@ -2643,10 +2779,10 @@ lem_setup_transmit_structures(struct ada uint64_t paddr; void *addr; - addr = PNMB(slot + si, &paddr); + addr = PNMB(na, slot + si, &paddr); adapter->tx_desc_base[i].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ - netmap_load_map(adapter->txtag, tx_buffer->map, addr); + netmap_load_map(na, adapter->txtag, tx_buffer->map, addr); } #endif /* DEV_NETMAP */ tx_buffer->next_eop = -1; @@ -3021,6 +3157,16 @@ lem_txeof(struct adapter *adapter) adapter->next_tx_to_clean = first; adapter->num_tx_desc_avail = num_avail; +#ifdef NIC_SEND_COMBINING + if ((adapter->shadow_tdt & MIT_PENDING_TDT) == MIT_PENDING_TDT) { + /* a tdt write is pending, do it */ + E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), + 0xffff & adapter->shadow_tdt); + adapter->shadow_tdt = MIT_PENDING_INT; + } else { + adapter->shadow_tdt = 0; // disable + } +#endif /* NIC_SEND_COMBINING */ /* * If we have enough room, clear IFF_DRV_OACTIVE to * tell the stack that it is OK to send packets. @@ -3028,6 +3174,12 @@ lem_txeof(struct adapter *adapter) */ if (adapter->num_tx_desc_avail > EM_TX_CLEANUP_THRESHOLD) { if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); +#ifdef NIC_PARAVIRT + if (adapter->csb) { // XXX also csb_on ? + adapter->csb->guest_need_txkick = 2; /* acked */ + // XXX memory barrier + } +#endif /* NIC_PARAVIRT */ if (adapter->num_tx_desc_avail == adapter->num_tx_desc) { adapter->watchdog_check = FALSE; return; @@ -3213,8 +3365,8 @@ lem_setup_receive_structures(struct adap uint64_t paddr; void *addr; - addr = PNMB(slot + si, &paddr); - netmap_load_map(adapter->rxtag, rx_buffer->map, addr); + addr = PNMB(na, slot + si, &paddr); + netmap_load_map(na, adapter->rxtag, rx_buffer->map, addr); /* Update descriptor */ adapter->rx_desc_base[i].buffer_addr = htole64(paddr); continue; @@ -3413,7 +3565,23 @@ lem_rxeof(struct adapter *adapter, int c int i, rx_sent = 0; struct e1000_rx_desc *current_desc; +#ifdef BATCH_DISPATCH + struct mbuf *mh = NULL, *mt = NULL; +#endif /* BATCH_DISPATCH */ +#ifdef NIC_PARAVIRT + int retries = 0; + struct paravirt_csb* csb = adapter->csb; + int csb_mode = csb && csb->guest_csb_on; + + //ND("clear guest_rxkick at %d", adapter->next_rx_desc_to_check); + if (csb_mode && csb->guest_need_rxkick) + csb->guest_need_rxkick = 0; +#endif /* NIC_PARAVIRT */ EM_RX_LOCK(adapter); + +#ifdef BATCH_DISPATCH + batch_again: +#endif /* BATCH_DISPATCH */ i = adapter->next_rx_desc_to_check; current_desc = &adapter->rx_desc_base[i]; bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, @@ -3426,19 +3594,45 @@ lem_rxeof(struct adapter *adapter, int c } #endif /* DEV_NETMAP */ +#if 1 // XXX optimization ? if (!((current_desc->status) & E1000_RXD_STAT_DD)) { if (done != NULL) *done = rx_sent; EM_RX_UNLOCK(adapter); return (FALSE); } +#endif /* 0 */ while (count != 0 && if_getdrvflags(ifp) & IFF_DRV_RUNNING) { struct mbuf *m = NULL; status = current_desc->status; - if ((status & E1000_RXD_STAT_DD) == 0) + if ((status & E1000_RXD_STAT_DD) == 0) { +#ifdef NIC_PARAVIRT + if (csb_mode) { + /* buffer not ready yet. Retry a few times before giving up */ + if (++retries <= adapter->rx_retries) { + continue; + } + if (csb->guest_need_rxkick == 0) { + // ND("set guest_rxkick at %d", adapter->next_rx_desc_to_check); + csb->guest_need_rxkick = 1; + // XXX memory barrier, status volatile ? + continue; /* double check */ + } + } + /* no buffer ready, give up */ +#endif /* NIC_PARAVIRT */ break; + } +#ifdef NIC_PARAVIRT + if (csb_mode) { + if (csb->guest_need_rxkick) + // ND("clear again guest_rxkick at %d", adapter->next_rx_desc_to_check); + csb->guest_need_rxkick = 0; + retries = 0; + } +#endif /* NIC_PARAVIRT */ mp = adapter->rx_buffer_area[i].m_head; /* @@ -3563,11 +3757,36 @@ discard: bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); +#ifdef NIC_PARAVIRT + if (csb_mode) { + /* the buffer at i has been already replaced by lem_get_buf() + * so it is safe to set guest_rdt = i and possibly send a kick. + * XXX see if we can optimize it later. + */ + csb->guest_rdt = i; + // XXX memory barrier + if (i == csb->host_rxkick_at) + E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); + } +#endif /* NIC_PARAVIRT */ /* Advance our pointers to the next descriptor. */ if (++i == adapter->num_rx_desc) i = 0; /* Call into the stack */ if (m != NULL) { +#ifdef BATCH_DISPATCH + if (adapter->batch_enable) { + if (mh == NULL) + mh = mt = m; + else + mt->m_nextpkt = m; + mt = m; + m->m_nextpkt = NULL; + rx_sent++; + current_desc = &adapter->rx_desc_base[i]; + continue; + } +#endif /* BATCH_DISPATCH */ adapter->next_rx_desc_to_check = i; EM_RX_UNLOCK(adapter); if_input(ifp, m); @@ -3578,10 +3797,27 @@ discard: current_desc = &adapter->rx_desc_base[i]; } adapter->next_rx_desc_to_check = i; +#ifdef BATCH_DISPATCH + if (mh) { + EM_RX_UNLOCK(adapter); + while ( (mt = mh) != NULL) { + mh = mh->m_nextpkt; + mt->m_nextpkt = NULL; + if_input(ifp, mt); + } + EM_RX_LOCK(adapter); + i = adapter->next_rx_desc_to_check; /* in case of interrupts */ + if (count > 0) + goto batch_again; + } +#endif /* BATCH_DISPATCH */ /* Advance the E1000's Receive Queue #0 "Tail Pointer". */ if (--i < 0) i = adapter->num_rx_desc - 1; +#ifdef NIC_PARAVIRT + if (!csb_mode) /* filter out writes */ +#endif /* NIC_PARAVIRT */ E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); if (done != NULL) *done = rx_sent; Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/ixgbe/ixgbe.c Sat Aug 16 15:00:01 2014 (r270063) @@ -3155,7 +3155,7 @@ ixgbe_setup_transmit_ring(struct tx_ring */ if (slot) { int si = netmap_idx_n2k(&na->tx_rings[txr->me], i); - netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); + netmap_load_map(na, txr->txtag, txbuf->map, NMB(na, slot + si)); } #endif /* DEV_NETMAP */ /* Clear the EOP descriptor pointer */ @@ -4098,8 +4098,8 @@ ixgbe_setup_receive_ring(struct rx_ring uint64_t paddr; void *addr; - addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->ptag, rxbuf->pmap, addr); + addr = PNMB(na, slot + sj, &paddr); + netmap_load_map(na, rxr->ptag, rxbuf->pmap, addr); /* Update descriptor and the cached value */ rxr->rx_base[j].read.pkt_addr = htole64(paddr); rxbuf->addr = htole64(paddr); Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/netmap/if_em_netmap.h Sat Aug 16 15:00:01 2014 (r270063) @@ -113,10 +113,10 @@ em_netmap_reg(struct netmap_adapter *na, * Reconcile kernel and user view of the transmit ring. */ static int -em_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) +em_netmap_txsync(struct netmap_kring *kring, int flags) { + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; - struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -128,7 +128,7 @@ em_netmap_txsync(struct netmap_adapter * /* device-specific */ struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr = &adapter->tx_rings[ring_nr]; + struct tx_ring *txr = &adapter->tx_rings[kring->ring_id]; bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); @@ -144,7 +144,7 @@ em_netmap_txsync(struct netmap_adapter * struct netmap_slot *slot = &ring->slot[nm_i]; u_int len = slot->len; uint64_t paddr; - void *addr = PNMB(slot, &paddr); + void *addr = PNMB(na, slot, &paddr); /* device-specific */ struct e1000_tx_desc *curr = &txr->tx_base[nic_i]; @@ -153,12 +153,12 @@ em_netmap_txsync(struct netmap_adapter * nic_i == 0 || nic_i == report_frequency) ? E1000_TXD_CMD_RS : 0; - NM_CHECK_ADDR_LEN(addr, len); + NM_CHECK_ADDR_LEN(na, addr, len); if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ - netmap_reload_map(txr->txtag, txbuf->map, addr); + netmap_reload_map(na, txr->txtag, txbuf->map, addr); } slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); @@ -187,7 +187,7 @@ em_netmap_txsync(struct netmap_adapter * */ if (flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) { /* record completed transmissions using TDH */ - nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); + nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(kring->ring_id)); if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("TDH wrap %d", nic_i); nic_i -= kring->nkr_num_slots; @@ -208,10 +208,10 @@ em_netmap_txsync(struct netmap_adapter * * Reconcile kernel and user view of the receive ring. */ static int -em_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) +em_netmap_rxsync(struct netmap_kring *kring, int flags) { + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; - struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -222,7 +222,7 @@ em_netmap_rxsync(struct netmap_adapter * /* device-specific */ struct adapter *adapter = ifp->if_softc; - struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; + struct rx_ring *rxr = &adapter->rx_rings[kring->ring_id]; if (head > lim) return netmap_ring_reinit(kring); @@ -271,18 +271,18 @@ em_netmap_rxsync(struct netmap_adapter * for (n = 0; nm_i != head; n++) { struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; - void *addr = PNMB(slot, &paddr); + void *addr = PNMB(na, slot, &paddr); struct e1000_rx_desc *curr = &rxr->rx_base[nic_i]; struct em_buffer *rxbuf = &rxr->rx_buffers[nic_i]; - if (addr == netmap_buffer_base) /* bad buf */ + if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ curr->buffer_addr = htole64(paddr); - netmap_reload_map(rxr->rxtag, rxbuf->map, addr); + netmap_reload_map(na, rxr->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } curr->status = 0; Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/netmap/if_igb_netmap.h Sat Aug 16 15:00:01 2014 (r270063) @@ -81,10 +81,10 @@ igb_netmap_reg(struct netmap_adapter *na * Reconcile kernel and user view of the transmit ring. */ static int -igb_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) +igb_netmap_txsync(struct netmap_kring *kring, int flags) { + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; - struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -96,7 +96,7 @@ igb_netmap_txsync(struct netmap_adapter /* device-specific */ struct adapter *adapter = ifp->if_softc; - struct tx_ring *txr = &adapter->tx_rings[ring_nr]; + struct tx_ring *txr = &adapter->tx_rings[kring->ring_id]; /* 82575 needs the queue index added */ u32 olinfo_status = (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; @@ -115,7 +115,7 @@ igb_netmap_txsync(struct netmap_adapter struct netmap_slot *slot = &ring->slot[nm_i]; u_int len = slot->len; uint64_t paddr; - void *addr = PNMB(slot, &paddr); + void *addr = PNMB(na, slot, &paddr); /* device-specific */ union e1000_adv_tx_desc *curr = @@ -125,11 +125,11 @@ igb_netmap_txsync(struct netmap_adapter nic_i == 0 || nic_i == report_frequency) ? E1000_ADVTXD_DCMD_RS : 0; - NM_CHECK_ADDR_LEN(addr, len); + NM_CHECK_ADDR_LEN(na, addr, len); if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - netmap_reload_map(txr->txtag, txbuf->map, addr); + netmap_reload_map(na, txr->txtag, txbuf->map, addr); } slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); @@ -171,7 +171,7 @@ igb_netmap_txsync(struct netmap_adapter */ if (flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) { /* record completed transmissions using TDH */ - nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); + nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(kring->ring_id)); if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("TDH wrap %d", nic_i); nic_i -= kring->nkr_num_slots; @@ -190,10 +190,10 @@ igb_netmap_txsync(struct netmap_adapter * Reconcile kernel and user view of the receive ring. */ static int -igb_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) +igb_netmap_rxsync(struct netmap_kring *kring, int flags) { + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; - struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -204,7 +204,7 @@ igb_netmap_rxsync(struct netmap_adapter /* device-specific */ struct adapter *adapter = ifp->if_softc; - struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; + struct rx_ring *rxr = &adapter->rx_rings[kring->ring_id]; if (head > lim) return netmap_ring_reinit(kring); @@ -251,17 +251,17 @@ igb_netmap_rxsync(struct netmap_adapter for (n = 0; nm_i != head; n++) { struct netmap_slot *slot = &ring->slot[nm_i]; uint64_t paddr; - void *addr = PNMB(slot, &paddr); + void *addr = PNMB(na, slot, &paddr); union e1000_adv_rx_desc *curr = &rxr->rx_base[nic_i]; struct igb_rx_buf *rxbuf = &rxr->rx_buffers[nic_i]; - if (addr == netmap_buffer_base) /* bad buf */ + if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); + netmap_reload_map(na, rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } curr->wb.upper.status_error = 0; Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Sat Aug 16 14:56:11 2014 (r270062) +++ head/sys/dev/netmap/if_lem_netmap.h Sat Aug 16 15:00:01 2014 (r270063) @@ -39,6 +39,7 @@ #include /* vtophys ? */ #include +extern int netmap_adaptive_io; /* * Register/unregister. We are already under netmap lock. @@ -84,10 +85,10 @@ lem_netmap_reg(struct netmap_adapter *na * Reconcile kernel and user view of the transmit ring. */ static int -lem_netmap_txsync(struct netmap_adapter *na, u_int ring_nr, int flags) +lem_netmap_txsync(struct netmap_kring *kring, int flags) { + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; - struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -98,6 +99,10 @@ lem_netmap_txsync(struct netmap_adapter /* device-specific */ struct adapter *adapter = ifp->if_softc; +#ifdef NIC_PARAVIRT + struct paravirt_csb *csb = adapter->csb; + uint64_t *csbd = (uint64_t *)(csb + 1); +#endif /* NIC_PARAVIRT */ bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_POSTREAD); @@ -108,12 +113,25 @@ lem_netmap_txsync(struct netmap_adapter nm_i = kring->nr_hwcur; if (nm_i != head) { /* we have new packets to send */ +#ifdef NIC_PARAVIRT + int do_kick = 0; + uint64_t t = 0; // timestamp + int n = head - nm_i; + if (n < 0) + n += lim + 1; + if (csb) { + t = rdtsc(); /* last timestamp */ + csbd[16] += t - csbd[0]; /* total Wg */ + csbd[17] += n; /* Wg count */ + csbd[0] = t; + } +#endif /* NIC_PARAVIRT */ nic_i = netmap_idx_k2n(kring, nm_i); while (nm_i != head) { struct netmap_slot *slot = &ring->slot[nm_i]; u_int len = slot->len; uint64_t paddr; - void *addr = PNMB(slot, &paddr); + void *addr = PNMB(na, slot, &paddr); /* device-specific */ struct e1000_tx_desc *curr = &adapter->tx_desc_base[nic_i]; @@ -122,12 +140,12 @@ lem_netmap_txsync(struct netmap_adapter nic_i == 0 || nic_i == report_frequency) ? E1000_TXD_CMD_RS : 0; - NM_CHECK_ADDR_LEN(addr, len); + NM_CHECK_ADDR_LEN(na, addr, len); if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ curr->buffer_addr = htole64(paddr); - netmap_reload_map(adapter->txtag, txbuf->map, addr); + netmap_reload_map(na, adapter->txtag, txbuf->map, addr); } slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); @@ -140,6 +158,7 @@ lem_netmap_txsync(struct netmap_adapter nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); + // XXX might try an early kick } kring->nr_hwcur = head; @@ -147,8 +166,38 @@ lem_netmap_txsync(struct netmap_adapter bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); +#ifdef NIC_PARAVIRT + /* set unconditionally, then also kick if needed */ + if (csb) { + t = rdtsc(); + if (csb->host_need_txkick == 2) { + /* can compute an update of delta */ + int64_t delta = t - csbd[3]; + if (delta < 0) + delta = -delta; + if (csbd[8] == 0 || delta < csbd[8]) { + csbd[8] = delta; + csbd[9]++; + } + csbd[10]++; + } + csb->guest_tdt = nic_i; + csbd[18] += t - csbd[0]; // total wp + csbd[19] += n; + } + if (!csb || !csb->guest_csb_on || (csb->host_need_txkick & 1)) + do_kick = 1; + if (do_kick) +#endif /* NIC_PARAVIRT */ /* (re)start the tx unit up to slot nic_i (excluded) */ E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), nic_i); +#ifdef NIC_PARAVIRT + if (do_kick) { + uint64_t t1 = rdtsc(); + csbd[20] += t1 - t; // total Np + csbd[21]++; + } +#endif /* NIC_PARAVIRT */ } /* @@ -157,6 +206,93 @@ lem_netmap_txsync(struct netmap_adapter if (ticks != kring->last_reclaim || flags & NAF_FORCE_RECLAIM || nm_kr_txempty(kring)) { kring->last_reclaim = ticks; /* record completed transmissions using TDH */ +#ifdef NIC_PARAVIRT + /* host updates tdh unconditionally, and we have + * no side effects on reads, so we can read from there + * instead of exiting. + */ + if (csb) { + static int drain = 0, nodrain=0, good = 0, bad = 0, fail = 0; + u_int x = adapter->next_tx_to_clean; + csbd[19]++; // XXX count reclaims + nic_i = csb->host_tdh; + if (csb->guest_csb_on) { + if (nic_i == x) { + bad++; + csbd[24]++; // failed reclaims + /* no progress, request kick and retry */ + csb->guest_need_txkick = 1; + mb(); // XXX barrier + nic_i = csb->host_tdh; + } else { + good++; + } + if (nic_i != x) { + csb->guest_need_txkick = 2; + if (nic_i == csb->guest_tdt) + drain++; + else + nodrain++; +#if 1 + if (netmap_adaptive_io) { + /* new mechanism: last half ring (or so) + * released one slot at a time. + * This effectively makes the system spin. + * + * Take next_to_clean + 1 as a reference. + * tdh must be ahead or equal + * On entry, the logical order is + * x < tdh = nic_i + * We first push tdh up to avoid wraps. + * The limit is tdh-ll (half ring). + * if tdh-256 < x we report x; + * else we report tdh-256 + */ + u_int tdh = nic_i; + u_int ll = csbd[15]; + u_int delta = lim/8; + if (netmap_adaptive_io == 2 || ll > delta) + csbd[15] = ll = delta; + else if (netmap_adaptive_io == 1 && ll > 1) { + csbd[15]--; + } + + if (nic_i >= kring->nkr_num_slots) { + RD(5, "bad nic_i %d on input", nic_i); + } + x = nm_next(x, lim); + if (tdh < x) + tdh += lim + 1; + if (tdh <= x + ll) { + nic_i = x; + csbd[25]++; //report n + 1; + } else { + tdh = nic_i; + if (tdh < ll) + tdh += lim + 1; + nic_i = tdh - ll; + csbd[26]++; // report tdh - ll + } + } +#endif + } else { + /* we stop, count whether we are idle or not */ + int bh_active = csb->host_need_txkick & 2 ? 4 : 0; + csbd[27+ csb->host_need_txkick]++; + if (netmap_adaptive_io == 1) { + if (bh_active && csbd[15] > 1) + csbd[15]--; + else if (!bh_active && csbd[15] < lim/2) + csbd[15]++; + } + bad--; + fail++; + } + } + RD(1, "drain %d nodrain %d good %d retry %d fail %d", + drain, nodrain, good, bad, fail); + } else +#endif /* !NIC_PARAVIRT */ nic_i = E1000_READ_REG(&adapter->hw, E1000_TDH(0)); if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("TDH wrap %d", nic_i); @@ -176,10 +312,10 @@ lem_netmap_txsync(struct netmap_adapter * Reconcile kernel and user view of the receive ring. */ static int -lem_netmap_rxsync(struct netmap_adapter *na, u_int ring_nr, int flags) +lem_netmap_rxsync(struct netmap_kring *kring, int flags) { + struct netmap_adapter *na = kring->na; struct ifnet *ifp = na->ifp; - struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -190,10 +326,21 @@ lem_netmap_rxsync(struct netmap_adapter *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 16:57:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44211ADB; Sat, 16 Aug 2014 16:57:02 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 0560B2039; Sat, 16 Aug 2014 16:57:01 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id D8C507300A; Sat, 16 Aug 2014 19:00:52 +0200 (CEST) Date: Sat, 16 Aug 2014 19:00:52 +0200 From: Luigi Rizzo To: Luigi Rizzo Subject: Re: svn commit: r270063 - in head: sys/conf sys/dev/cxgbe sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/virtio/network sys/net tools/tools/netmap Message-ID: <20140816170052.GA58169@onelab2.iet.unipi.it> References: <201408161500.s7GF01KC085529@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201408161500.s7GF01KC085529@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 16:57:02 -0000 On Sat, Aug 16, 2014 at 03:00:01PM +0000, Luigi Rizzo wrote: > Author: luigi ... > 5. if_lem.c: support for various paravirtualization features, > experimental and disabled by default. > Most of these are described in our ANCS'13 paper [1]. > Paravirtualized support in netmap mode is new, and beats the > numbers in the paper by a large factor (under qemu-kvm, > we measured gues-host throughput up to 10-12 Mpps). ref. [1] is Luigi Rizzo, Giuseppe Lettieri, Vincenzo Maffione, Speeding up packet I/O in virtual machines, ACM/IEEE ANCS'13, October 2013, San Jose you can find a draft of the pdf on my research page http://info.iet.unipi.it/~luigi/research.html cheers luigi From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 17:30:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFFC3352; Sat, 16 Aug 2014 17:30:14 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 76BDC229B; Sat, 16 Aug 2014 17:30:14 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id AA22525D3A98; Sat, 16 Aug 2014 17:30:02 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CEDA1C26EAC; Sat, 16 Aug 2014 17:30:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 4YXS1lMFqVaE; Sat, 16 Aug 2014 17:30:00 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9E6EEC26EA8; Sat, 16 Aug 2014 17:29:58 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270063 - in head: sys/conf sys/dev/cxgbe sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/virtio/network sys/net tools/tools/netmap From: "Bjoern A. Zeeb" In-Reply-To: <201408161500.s7GF01KC085529@svn.freebsd.org> Date: Sat, 16 Aug 2014 17:29:56 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201408161500.s7GF01KC085529@svn.freebsd.org> To: Luigi Rizzo X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 17:30:14 -0000 On 16 Aug 2014, at 15:00 , Luigi Rizzo wrote: > Author: luigi > Date: Sat Aug 16 15:00:01 2014 > New Revision: 270063 > URL: http://svnweb.freebsd.org/changeset/base/270063 >=20 > Log: > Update to the current version of netmap. > Mostly bugfixes or features developed in the past 6 months, > so this is a 10.1 candidate. >=20 > Basically no user API changes (some bugfixes in = sys/net/netmap_user.h). > =85 > MFC after: 3 days. >=20 Or not=85 Sparc64: netmap.c:(.text+0x2a74): undefined reference to `netmap_get_monitor_na' i386.LINT and amd64.LINT and related: In file included from = /scratch/tmp/bz/head.svn/sys/modules/virtio/network/../../../dev/virtio/ne= twork/if_vtnet.c:293: @/dev/netmap/if_vtnet_netmap.h:46:1: error: no previous prototype for = function 'vtnet_netmap_free_bufs' [-Werror,-Wmissing-prototypes] vtnet_netmap_free_bufs(struct SOFTC_T* sc) ^ @/dev/netmap/if_vtnet_netmap.h:84:1: error: no previous prototype for = function 'vtnet_netmap_reg' [-Werror,-Wmissing-prototypes] vtnet_netmap_reg(struct netmap_adapter *na, int onoff) ^ @/dev/netmap/if_vtnet_netmap.h:240:26: error: suggest braces around = initialization of subobject [-Werror,-Wmissing-braces] struct sglist sg[1] =3D { ss, 0, 0, 2}; ^~~~~~~~~~~ { } 3 errors generated. --- if_vtnet.o --- *** [if_vtnet.o] Error code 1 No idea what else; it=92s all still compiling. =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 19:13:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41760CEF; Sat, 16 Aug 2014 19:13:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B4102D0E; Sat, 16 Aug 2014 19:13:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GJDr7f012208; Sat, 16 Aug 2014 19:13:53 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GJDqtF012204; Sat, 16 Aug 2014 19:13:52 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201408161913.s7GJDqtF012204@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 16 Aug 2014 19:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270064 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 19:13:53 -0000 Author: melifaro Date: Sat Aug 16 19:13:52 2014 New Revision: 270064 URL: http://svnweb.freebsd.org/changeset/base/270064 Log: Add support for reading i2c SFP/SFP+ data from NIC driver and presenting most interesting fields via ifconfig -v. This version supports Intel ixgbe driver only. Tested on: Cisco,Intel,Mellanox,ModuleTech,Molex transceivers MFC after: 2 weeks Added: head/sbin/ifconfig/sfp.c (contents, props changed) Modified: head/sbin/ifconfig/Makefile head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifconfig.h Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Sat Aug 16 15:00:01 2014 (r270063) +++ head/sbin/ifconfig/Makefile Sat Aug 16 19:13:52 2014 (r270064) @@ -33,6 +33,9 @@ SRCS+= ifvlan.c # SIOC[GS]ETVLAN suppor SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround +SRCS+= sfp.c # SFP/SFP+ information +LDADD+= -lm + SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support DPADD+= ${LIBBSDXML} ${LIBSBUF} LDADD+= -lbsdxml -lsbuf Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sat Aug 16 15:00:01 2014 (r270063) +++ head/sbin/ifconfig/ifconfig.c Sat Aug 16 19:13:52 2014 (r270064) @@ -1011,6 +1011,9 @@ status(const struct afswtch *afp, const if (ioctl(s, SIOCGIFSTATUS, &ifs) == 0) printf("%s", ifs.ascii); + if (verbose > 0) + sfp_status(s, &ifr, verbose); + close(s); return; } Modified: head/sbin/ifconfig/ifconfig.h ============================================================================== --- head/sbin/ifconfig/ifconfig.h Sat Aug 16 15:00:01 2014 (r270063) +++ head/sbin/ifconfig/ifconfig.h Sat Aug 16 19:13:52 2014 (r270064) @@ -143,6 +143,8 @@ void ifmaybeload(const char *name); typedef void clone_callback_func(int, struct ifreq *); void clone_setdefcallback(const char *, clone_callback_func *); +void sfp_status(int s, struct ifreq *ifr, int verbose); + /* * XXX expose this so modules that neeed to know of any pending * operations on ifmedia can avoid cmd line ordering confusion. Added: head/sbin/ifconfig/sfp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ifconfig/sfp.c Sat Aug 16 19:13:52 2014 (r270064) @@ -0,0 +1,543 @@ +/*- + * Copyright (c) 2014 Alexander V. Chernikov. 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. + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ifconfig.h" + +/* 2wire addresses */ +#define SFP_ADDR_MSA 0xA0 /* Identification data */ +#define SFP_ADDR_DDM 0xA2 /* digital monitoring interface */ + +/* Definitions from Table 3.1 */ +#define SFP_MSA_IDENTIFIER 0 /* Type of transceiver (T. 3.2), 1B */ +#define SFP_MSA_CONNECTOR 2 /* Connector type (T. 3.3), 1B */ + +#define SFP_MSA_TRANSCEIVER_CLASS 3 /* Ethernet/Sonet/IB code, 1B */ + +#define SFP_MSA_VENDOR_NAME 20 /* ASCII vendor name, 16B */ +#define SFP_MSA_VENDOR_PN 40 /* ASCII vendor partnum, 16B */ +#define SFP_MSA_VENDOR_SN 68 /* ASCII vendor serialnum, 16B */ +#define SFP_MSA_VENDOR_DATE 84 /* Vendor's date code, 8B */ +#define SFP_MSA_DMONTYPE 92 /* Type of disagnostic monitoring, 1B */ + +/* Definitions from table 3.17 */ +#define SFP_DDM_TEMP 96 /* Module temperature, 2B */ +#define SFP_DDM_TXPOWER 102 /* Measured TX output power, 2B */ +#define SFP_DDM_RXPOWER 104 /* Measured RX input power, 2B */ + +struct i2c_info; +typedef int (read_i2c)(struct i2c_info *ii, uint8_t addr, uint8_t off, + uint8_t len, caddr_t buf); + +struct i2c_info { + int s; + int error; + struct ifreq *ifr; + read_i2c *f; + uint8_t diag_type; + char *textbuf; + size_t bufsize; +}; + +struct _nv { + int v; + const char *n; +}; + +const char *find_value(struct _nv *x, int value); +const char *find_zero_bit(struct _nv *x, int value, int sz); + + +/* SFF-8472 Rev. 11.4 table 3.2: Identifier values */ +static struct _nv ids[] = { + { 0x00, "Unknown" }, + { 0x01, "GBIC" }, + { 0x02, "SFF" }, + { 0x03, "SFP/SFP+" }, + { 0x04, "300 pin XBI" }, + { 0x05, "Xenpak" }, + { 0x06, "XFP" }, + { 0x07, "XFF" }, + { 0x08, "XFP-E" }, + { 0x09, "XPak" }, + { 0x0A, "X2" }, + { 0x0B, "DWDM-SFP/DWDM-SFP+" }, + { 0x0C, "QSFP" }, + { 0, NULL, }, +}; + +/* SFF-8472 Rev. 11.4 table 3.4: Connector values */ +static struct _nv conn[] = { + { 0x00, "Unknown" }, + { 0x01, "SC" }, + { 0x02, "Fibre Channel Style 1 copper" }, + { 0x03, "Fibre Channel Style 2 copper" }, + { 0x04, "BNC/TNC" }, + { 0x05, "Fibre Channel coaxial" }, + { 0x06, "FiberJack" }, + { 0x07, "LC" }, + { 0x08, "MT-RJ" }, + { 0x09, "MU" }, + { 0x0A, "SG" }, + { 0x0B, "Optical pigtail" }, + { 0x0C, "MPO Parallel Optic" }, + { 0x20, "HSSDC II" }, + { 0x21, "Copper pigtail" }, + { 0x22, "RJ45" }, + { 0, NULL } +}; + +const char * +find_value(struct _nv *x, int value) +{ + for (; x->n != NULL; x++) + if (x->v == value) + return (x->n); + return (NULL); +} + +const char * +find_zero_bit(struct _nv *x, int value, int sz) +{ + int v, m; + const char *s; + + v = 1; + for (v = 1, m = 1 << (8 * sz); v < m; v *= 2) { + if ((value & v) == 0) + continue; + if ((s = find_value(x, value & v)) != NULL) { + value &= ~v; + return (s); + } + } + + return (NULL); +} + +static void +get_sfp_identifier(struct i2c_info *ii, char *buf, size_t size) +{ + const char *x; + uint8_t data; + + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_IDENTIFIER, 1, (caddr_t)&data); + + if ((x = find_value(ids, data)) == NULL) { + if (data > 0x80) + x = "Vendor specific"; + else + x = "Reserved"; + } + + snprintf(buf, size, "%s", x); +} + +static void +get_sfp_connector(struct i2c_info *ii, char *buf, size_t size) +{ + const char *x; + uint8_t data; + + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_CONNECTOR, 1, (caddr_t)&data); + + if ((x = find_value(conn, data)) == NULL) { + if (data >= 0x0D && data <= 0x1F) + x = "Unallocated"; + else if (data >= 0x23 && data <= 0x7F) + x = "Unallocated"; + else + x = "Vendor specific"; + } + + snprintf(buf, size, "%s", x); +} + +/* SFF-8472 Rev. 11.4 table 3.5: Transceiver codes */ +/* 10G Ethernet compliance codes, byte 3 */ +static struct _nv eth_10g[] = { + { 0x80, "10G Base-ER" }, + { 0x40, "10G Base-LRM" }, + { 0x20, "10G Base-LR" }, + { 0x10, "10G Base-SR" }, + { 0x08, "1X SX" }, + { 0x04, "1X LX" }, + { 0x02, "1X Copper Active" }, + { 0x01, "1X Copper Passive" }, + { 0, NULL } +}; + +/* Ethernet compliance codes, byte 6 */ +static struct _nv eth_compat[] = { + { 0x80, "BASE-PX" }, + { 0x40, "BASE-BX10" }, + { 0x20, "100BASE-FX" }, + { 0x10, "100BASE-LX/LX10" }, + { 0x08, "1000BASE-T" }, + { 0x04, "1000BASE-CX" }, + { 0x02, "1000BASE-LX" }, + { 0x01, "1000BASE-SX" }, + { 0, NULL } +}; + +/* FC link length, byte 7 */ +static struct _nv fc_len[] = { + { 0x80, "very long distance" }, + { 0x40, "short distance" }, + { 0x20, "intermediate distance" }, + { 0x10, "long distance" }, + { 0x08, "medium distance" }, + { 0, NULL } +}; + +/* Channel/Cable technology, byte 7-8 */ +static struct _nv cab_tech[] = { + { 0x0400, "Shortwave laser (SA)" }, + { 0x0200, "Longwave laser (LC)" }, + { 0x0100, "Electrical inter-enclosure (EL)" }, + { 0x80, "Electrical intra-enclosure (EL)" }, + { 0x40, "Shortwave laser (SN)" }, + { 0x20, "Shortwave laser (SL)" }, + { 0x10, "Longwave laser (LL)" }, + { 0x08, "Active Cable" }, + { 0x04, "Passive Cable" }, + { 0, NULL } +}; + +/* FC Transmission media, byte 9 */ +static struct _nv fc_media[] = { + { 0x80, "Twin Axial Pair" }, + { 0x40, "Twisted Pair" }, + { 0x20, "Miniature Coax" }, + { 0x10, "Viao Coax" }, + { 0x08, "Miltimode, 62.5um" }, + { 0x04, "Multimode, 50um" }, + { 0x02, "" }, + { 0x01, "Single Mode" }, + { 0, NULL } +}; + +/* FC Speed, byte 10 */ +static struct _nv fc_speed[] = { + { 0x80, "1200 MBytes/sec" }, + { 0x40, "800 MBytes/sec" }, + { 0x20, "1600 MBytes/sec" }, + { 0x10, "400 MBytes/sec" }, + { 0x08, "3200 MBytes/sec" }, + { 0x04, "200 MBytes/sec" }, + { 0x01, "100 MBytes/sec" }, + { 0, NULL } +}; + +static void +printf_sfp_transceiver_descr(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[12]; + const char *tech_class, *tech_len, *tech_tech, *tech_media, *tech_speed; + + tech_class = NULL; + tech_len = NULL; + tech_tech = NULL; + tech_media = NULL; + tech_speed = NULL; + + /* Read bytes 3-10 at once */ + ii->f(ii, SFP_ADDR_MSA, 3, 8, &xbuf[3]); + + /* Check 10G first */ + tech_class = find_zero_bit(eth_10g, xbuf[3], 1); + if (tech_class == NULL) { + /* No match. Try 1G */ + tech_class = find_zero_bit(eth_compat, xbuf[6], 1); + } + + tech_len = find_zero_bit(fc_len, xbuf[7], 1); + tech_tech = find_zero_bit(cab_tech, xbuf[7] << 8 | xbuf[8], 2); + tech_media = find_zero_bit(fc_media, xbuf[9], 1); + tech_speed = find_zero_bit(fc_speed, xbuf[10], 1); + + printf("Class: %s\n", tech_class); + printf("Length: %s\n", tech_len); + printf("Tech: %s\n", tech_tech); + printf("Media: %s\n", tech_media); + printf("Speed: %s\n", tech_speed); +} + +static void +get_sfp_transceiver_class(struct i2c_info *ii, char *buf, size_t size) +{ + const char *tech_class; + uint8_t code; + + /* Check 10G Ethernet/IB first */ + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_TRANSCEIVER_CLASS, 1, (caddr_t)&code); + tech_class = find_zero_bit(eth_10g, code, 1); + if (tech_class == NULL) { + /* No match. Try Ethernet 1G */ + ii->f(ii, SFP_ADDR_MSA, 6, 1, (caddr_t)&code); + tech_class = find_zero_bit(eth_compat, code, 1); + } + + if (tech_class == NULL) + tech_class = "Unknown"; + + snprintf(buf, size, "%s", tech_class); +} + + +static void +get_sfp_vendor_name(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[17], *p; + + memset(xbuf, 0, sizeof(xbuf)); + /* ASCII String, right-padded with 0x20 */ + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_NAME, 16, xbuf); + for (p = &xbuf[16]; *(p - 1) == 0x20; p--) + ; + *p = '\0'; + + snprintf(buf, size, "%s", xbuf); +} + +static void +get_sfp_vendor_pn(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[17], *p; + + memset(xbuf, 0, sizeof(xbuf)); + /* ASCII String, right-padded with 0x20 */ + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_PN, 16, xbuf); + for (p = &xbuf[16]; *(p - 1) == 0x20; p--) + ; + *p = '\0'; + + snprintf(buf, size, "%s", xbuf); +} + +static void +get_sfp_vendor_sn(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[17], *p; + + memset(xbuf, 0, sizeof(xbuf)); + /* ASCII String, right-padded with 0x20 */ + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_SN, 16, xbuf); + for (p = &xbuf[16]; *(p - 1) == 0x20; p--) + ; + *p = '\0'; + snprintf(buf, size, "%s", xbuf); +} + +static void +get_sfp_vendor_date(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[6]; + + memset(xbuf, 0, sizeof(xbuf)); + /* Date code, see Table 3.8 for description */ + ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_DATE, 6, xbuf); + snprintf(buf, size, "20%c%c-%c%c-%c%c", xbuf[0], xbuf[1], + xbuf[2], xbuf[3], xbuf[4], xbuf[5]); +} + +static void +print_sfp_vendor(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[80]; + + memset(xbuf, 0, sizeof(xbuf)); + get_sfp_vendor_name(ii, xbuf, 20); + get_sfp_vendor_pn(ii, &xbuf[20], 20); + get_sfp_vendor_sn(ii, &xbuf[40], 20); + get_sfp_vendor_date(ii, &xbuf[60], 20); + + snprintf(buf, size, "vendor: %s PN: %s SN: %s DATE: %s", + xbuf, &xbuf[20], &xbuf[40], &xbuf[60]); +} + +static void +get_sfp_temp(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[2]; + + int8_t major; + uint8_t minor; + int k; + + memset(xbuf, 0, sizeof(xbuf)); + ii->f(ii, SFP_ADDR_DDM, SFP_DDM_TEMP, 2, xbuf); + + /* Convert temperature to string according to table 3.13 */ + major = (int8_t)xbuf[0]; + minor = (uint8_t)buf[1]; + k = minor * 1000 / 256; + + snprintf(buf, size, "%d.%d C", major, k / 100); +} + +static void +convert_power(struct i2c_info *ii, char *xbuf, char *buf, size_t size) +{ + uint16_t mW; + double dbm; + + mW = ((uint8_t)xbuf[0] << 8) + (uint8_t)xbuf[1]; + + /* Convert mw to dbm */ + dbm = 10.0 * log10(1.0 * mW / 10000); + + /* Table 3.9, bit 5 is set, internally calibrated */ + if ((ii->diag_type & 0x20) != 0) { + snprintf(buf, size, "%d.%02d mW (%.2f dBm)", + mW / 10000, (mW % 10000) / 100, dbm); + } +} + +static void +get_sfp_rx_power(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[2]; + + memset(xbuf, 0, sizeof(xbuf)); + ii->f(ii, SFP_ADDR_DDM, SFP_DDM_RXPOWER, 2, xbuf); + convert_power(ii, xbuf, buf, size); +} + +static void +get_sfp_tx_power(struct i2c_info *ii, char *buf, size_t size) +{ + char xbuf[2]; + + memset(xbuf, 0, sizeof(xbuf)); + ii->f(ii, SFP_ADDR_DDM, SFP_DDM_TXPOWER, 2, xbuf); + convert_power(ii, xbuf, buf, size); +} + +/* Intel ixgbe-specific structures and handlers */ +struct ixgbe_i2c_req { + uint8_t dev_addr; + uint8_t offset; + uint8_t len; + uint8_t data[8]; +}; +#define SIOCGI2C SIOCGIFGENERIC + +static int +read_i2c_ixgbe(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len, + caddr_t buf) +{ + struct ixgbe_i2c_req ixreq; + int i; + + if (ii->error != 0) + return (ii->error); + + ii->ifr->ifr_data = (caddr_t)&ixreq; + + memset(&ixreq, 0, sizeof(ixreq)); + ixreq.dev_addr = addr; + + for (i = 0; i < len; i += 1) { + ixreq.offset = off + i; + ixreq.len = 1; + + if (ioctl(ii->s, SIOCGI2C, ii->ifr) != 0) { + ii->error = errno; + return (errno); + } + memcpy(&buf[i], ixreq.data, 1); + } + + return (0); +} + +void +sfp_status(int s, struct ifreq *ifr, int verbose) +{ + struct i2c_info ii; + char buf[80], buf2[40], buf3[40]; + + /* + * Check if we have i2c support for particular driver. + * TODO: Determine driver by original name. + */ + memset(&ii, 0, sizeof(ii)); + if (strncmp(ifr->ifr_name, "ix", 2) == 0) { + ii.f = read_i2c_ixgbe; + } else + return; + + /* Prepare necessary into to pass to NIC handler */ + ii.s = s; + ii.ifr = ifr; + + /* Read diagnostic monitoring type */ + ii.f(&ii, SFP_ADDR_MSA, SFP_MSA_DMONTYPE, 1, (caddr_t)&ii.diag_type); + + /* Transceiver type */ + get_sfp_identifier(&ii, buf, sizeof(buf)); + get_sfp_transceiver_class(&ii, buf2, sizeof(buf2)); + get_sfp_connector(&ii, buf3, sizeof(buf3)); + if (ii.error == 0) + printf("\ti2c: %s %s (%s)\n", buf, buf2, buf3); + if (verbose > 2) + printf_sfp_transceiver_descr(&ii, buf, sizeof(buf)); + print_sfp_vendor(&ii, buf, sizeof(buf)); + if (ii.error == 0) + printf("\t%s\n", buf); + /* + * Request current measurements iff they are implemented: + * Bit 6 must be set. + */ + if ((ii.diag_type & 0x40) != 0) { + get_sfp_temp(&ii, buf, sizeof(buf)); + get_sfp_rx_power(&ii, buf2, sizeof(buf2)); + get_sfp_tx_power(&ii, buf3, sizeof(buf3)); + printf("\tTemp: %s RX: %s TX: %s\n", buf, buf2, buf3); + } + + close(s); +} + From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 20:44:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19962827; Sat, 16 Aug 2014 20:44:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05824281C; Sat, 16 Aug 2014 20:44:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GKijWD053166; Sat, 16 Aug 2014 20:44:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GKij8h053165; Sat, 16 Aug 2014 20:44:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201408162044.s7GKij8h053165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 16 Aug 2014 20:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270065 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 20:44:46 -0000 Author: ian Date: Sat Aug 16 20:44:45 2014 New Revision: 270065 URL: http://svnweb.freebsd.org/changeset/base/270065 Log: Move the imx6 sysctl temperature info to hw.imx6 where all the other soc-wide info lives. It was under dev.imx6_anatop.0. What does anatop mean anyway? Nobody seems to know, so it's probably not where somebody will think to look for imx6 hardware info. Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Sat Aug 16 19:13:52 2014 (r270064) +++ head/sys/arm/freescale/imx/imx6_anatop.c Sat Aug 16 20:44:45 2014 (r270065) @@ -558,7 +558,6 @@ static void initialize_tempmon(struct imx6_anatop_softc *sc) { uint32_t cal; - struct sysctl_ctx_list *ctx; /* * Fetch calibration data: a sensor count at room temperature (25C), @@ -602,11 +601,10 @@ initialize_tempmon(struct imx6_anatop_so callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay, 0, tempmon_throttle_check, sc, 0); - ctx = device_get_sysctl_ctx(sc->dev); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, temp_sysctl_handler, "IK", "Current die temperature"); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc, 0, temp_throttle_sysctl_handler, "IK", "Throttle CPU when exceeding this temperature"); From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 21:36:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 377CADEE; Sat, 16 Aug 2014 21:36:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22BAC2E97; Sat, 16 Aug 2014 21:36:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GLaN5V077451; Sat, 16 Aug 2014 21:36:23 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GLaM6g077450; Sat, 16 Aug 2014 21:36:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201408162136.s7GLaM6g077450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 16 Aug 2014 21:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270066 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 21:36:23 -0000 Author: rmacklem Date: Sat Aug 16 21:36:22 2014 New Revision: 270066 URL: http://svnweb.freebsd.org/changeset/base/270066 Log: MFC: r269771 Change the NFS server's printf related to hitting the DRC cache's flood level so that it suggests increasing vfs.nfsd.tcphighwater. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 16 20:44:45 2014 (r270065) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 16 21:36:22 2014 (r270066) @@ -749,10 +749,9 @@ nfsrvd_compound(struct nfsrv_descript *n nd->nd_rp->rc_refcnt == 0) && (nfsrv_mallocmget_limit() || nfsrc_tcpsavedreplies > nfsrc_floodlevel)) { - if (nfsrc_tcpsavedreplies > nfsrc_floodlevel) { - printf("nfsd server cache flooded, try to"); - printf(" increase nfsrc_floodlevel\n"); - } + if (nfsrc_tcpsavedreplies > nfsrc_floodlevel) + printf("nfsd server cache flooded, try " + "increasing vfs.nfsd.tcphighwater\n"); nd->nd_repstat = NFSERR_RESOURCE; *repp = nfsd_errmap(nd); if (op == NFSV4OP_SETATTR) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 21:42:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C1F3BB; Sat, 16 Aug 2014 21:42:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6699F2026; Sat, 16 Aug 2014 21:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GLguNc081437; Sat, 16 Aug 2014 21:42:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GLgtPF081431; Sat, 16 Aug 2014 21:42:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201408162142.s7GLgtPF081431@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 16 Aug 2014 21:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270067 - in head/sys: cddl/dev/fbt cddl/dev/fbt/powerpc cddl/dev/fbt/x86 modules/dtrace/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2014 21:42:56 -0000 Author: markj Date: Sat Aug 16 21:42:55 2014 New Revision: 270067 URL: http://svnweb.freebsd.org/changeset/base/270067 Log: Factor out the common code for function boundary tracing instead of duplicating the entire implementation for both x86 and powerpc. This makes it easier to add support for other architectures and has no functional impact. Phabric: D613 Reviewed by: gnn, jhibbits, rpaulo Tested by: jhibbits (powerpc) MFC after: 2 weeks Added: head/sys/cddl/dev/fbt/fbt.h (contents, props changed) head/sys/cddl/dev/fbt/powerpc/ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c (contents, props changed) head/sys/cddl/dev/fbt/powerpc/fbt_isa.h (contents, props changed) head/sys/cddl/dev/fbt/x86/ head/sys/cddl/dev/fbt/x86/fbt_isa.c (contents, props changed) head/sys/cddl/dev/fbt/x86/fbt_isa.h (contents, props changed) Deleted: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt.c head/sys/modules/dtrace/fbt/Makefile Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Sat Aug 16 21:36:22 2014 (r270066) +++ head/sys/cddl/dev/fbt/fbt.c Sat Aug 16 21:42:55 2014 (r270067) @@ -61,25 +61,13 @@ #include #include -static MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); +#include "fbt.h" -#define FBT_PUSHL_EBP 0x55 -#define FBT_MOVL_ESP_EBP0_V0 0x8b -#define FBT_MOVL_ESP_EBP1_V0 0xec -#define FBT_MOVL_ESP_EBP0_V1 0x89 -#define FBT_MOVL_ESP_EBP1_V1 0xe5 -#define FBT_REX_RSP_RBP 0x48 - -#define FBT_POPL_EBP 0x5d -#define FBT_RET 0xc3 -#define FBT_RET_IMM16 0xc2 -#define FBT_LEAVE 0xc9 - -#ifdef __amd64__ -#define FBT_PATCHVAL 0xcc -#else -#define FBT_PATCHVAL 0xf0 -#endif +MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); + +dtrace_provider_id_t fbt_id; +fbt_probe_t **fbt_probetab; +int fbt_probetab_mask; static d_open_t fbt_open; static int fbt_unload(void); @@ -92,11 +80,6 @@ static void fbt_load(void *); static void fbt_suspend(void *, dtrace_id_t, void *); static void fbt_resume(void *, dtrace_id_t, void *); -#define FBT_ENTRY "entry" -#define FBT_RETURN "return" -#define FBT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & fbt_probetab_mask) -#define FBT_PROBETAB_SIZE 0x8000 /* 32k entries -- 128K total */ - static struct cdevsw fbt_cdevsw = { .d_version = D_VERSION, .d_open = fbt_open, @@ -124,28 +107,8 @@ static dtrace_pops_t fbt_pops = { fbt_destroy }; -typedef struct fbt_probe { - struct fbt_probe *fbtp_hashnext; - uint8_t *fbtp_patchpoint; - int8_t fbtp_rval; - uint8_t fbtp_patchval; - uint8_t fbtp_savedval; - uintptr_t fbtp_roffset; - dtrace_id_t fbtp_id; - const char *fbtp_name; - modctl_t *fbtp_ctl; - int fbtp_loadcnt; - int fbtp_primary; - int fbtp_invop_cnt; - int fbtp_symindx; - struct fbt_probe *fbtp_next; -} fbt_probe_t; - static struct cdev *fbt_cdev; -static dtrace_provider_id_t fbt_id; -static fbt_probe_t **fbt_probetab; static int fbt_probetab_size; -static int fbt_probetab_mask; static int fbt_verbose = 0; static void @@ -162,257 +125,6 @@ fbt_doubletrap(void) } } -static int -fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) -{ - solaris_cpu_t *cpu = &solaris_cpu[curcpu]; - uintptr_t stack0, stack1, stack2, stack3, stack4; - fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; - - for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { - if ((uintptr_t)fbt->fbtp_patchpoint == addr) { - fbt->fbtp_invop_cnt++; - if (fbt->fbtp_roffset == 0) { - int i = 0; - /* - * When accessing the arguments on the stack, - * we must protect against accessing beyond - * the stack. We can safely set NOFAULT here - * -- we know that interrupts are already - * disabled. - */ - DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - cpu->cpu_dtrace_caller = stack[i++]; - stack0 = stack[i++]; - stack1 = stack[i++]; - stack2 = stack[i++]; - stack3 = stack[i++]; - stack4 = stack[i++]; - DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | - CPU_DTRACE_BADADDR); - - dtrace_probe(fbt->fbtp_id, stack0, stack1, - stack2, stack3, stack4); - - cpu->cpu_dtrace_caller = 0; - } else { -#ifdef __amd64__ - /* - * On amd64, we instrument the ret, not the - * leave. We therefore need to set the caller - * to assure that the top frame of a stack() - * action is correct. - */ - DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - cpu->cpu_dtrace_caller = stack[0]; - DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | - CPU_DTRACE_BADADDR); -#endif - - dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, - rval, 0, 0, 0); - cpu->cpu_dtrace_caller = 0; - } - - return (fbt->fbtp_rval); - } - } - - return (0); -} - -static int -fbt_provide_module_function(linker_file_t lf, int symindx, - linker_symval_t *symval, void *opaque) -{ - char *modname = opaque; - const char *name = symval->name; - fbt_probe_t *fbt, *retfbt; - int j; - int size; - u_int8_t *instr, *limit; - - if ((strncmp(name, "dtrace_", 7) == 0 && - strncmp(name, "dtrace_safe_", 12) != 0) || - strcmp(name, "trap_check") == 0) { - /* - * Anything beginning with "dtrace_" may be called - * from probe context unless it explicitly indicates - * that it won't be called from probe context by - * using the prefix "dtrace_safe_". - * - * Additionally, we avoid instrumenting trap_check() to avoid - * the possibility of generating a fault in probe context before - * DTrace's fault handler is called. - */ - return (0); - } - - if (name[0] == '_' && name[1] == '_') - return (0); - - size = symval->size; - - instr = (u_int8_t *) symval->value; - limit = (u_int8_t *) symval->value + symval->size; - -#ifdef __amd64__ - while (instr < limit) { - if (*instr == FBT_PUSHL_EBP) - break; - - if ((size = dtrace_instr_size(instr)) <= 0) - break; - - instr += size; - } - - if (instr >= limit || *instr != FBT_PUSHL_EBP) { - /* - * We either don't save the frame pointer in this - * function, or we ran into some disassembly - * screw-up. Either way, we bail. - */ - return (0); - } -#else - if (instr[0] != FBT_PUSHL_EBP) - return (0); - - if (!(instr[1] == FBT_MOVL_ESP_EBP0_V0 && - instr[2] == FBT_MOVL_ESP_EBP1_V0) && - !(instr[1] == FBT_MOVL_ESP_EBP0_V1 && - instr[2] == FBT_MOVL_ESP_EBP1_V1)) - return (0); -#endif - - fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); - fbt->fbtp_name = name; - fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, - name, FBT_ENTRY, 3, fbt); - fbt->fbtp_patchpoint = instr; - fbt->fbtp_ctl = lf; - fbt->fbtp_loadcnt = lf->loadcnt; - fbt->fbtp_rval = DTRACE_INVOP_PUSHL_EBP; - fbt->fbtp_savedval = *instr; - fbt->fbtp_patchval = FBT_PATCHVAL; - fbt->fbtp_symindx = symindx; - - fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; - fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; - - lf->fbt_nentries++; - - retfbt = NULL; -again: - if (instr >= limit) - return (0); - - /* - * If this disassembly fails, then we've likely walked off into - * a jump table or some other unsuitable area. Bail out of the - * disassembly now. - */ - if ((size = dtrace_instr_size(instr)) <= 0) - return (0); - -#ifdef __amd64__ - /* - * We only instrument "ret" on amd64 -- we don't yet instrument - * ret imm16, largely because the compiler doesn't seem to - * (yet) emit them in the kernel... - */ - if (*instr != FBT_RET) { - instr += size; - goto again; - } -#else - if (!(size == 1 && - (*instr == FBT_POPL_EBP || *instr == FBT_LEAVE) && - (*(instr + 1) == FBT_RET || - *(instr + 1) == FBT_RET_IMM16))) { - instr += size; - goto again; - } -#endif - - /* - * We (desperately) want to avoid erroneously instrumenting a - * jump table, especially given that our markers are pretty - * short: two bytes on x86, and just one byte on amd64. To - * determine if we're looking at a true instruction sequence - * or an inline jump table that happens to contain the same - * byte sequences, we resort to some heuristic sleeze: we - * treat this instruction as being contained within a pointer, - * and see if that pointer points to within the body of the - * function. If it does, we refuse to instrument it. - */ - for (j = 0; j < sizeof (uintptr_t); j++) { - caddr_t check = (caddr_t) instr - j; - uint8_t *ptr; - - if (check < symval->value) - break; - - if (check + sizeof (caddr_t) > (caddr_t)limit) - continue; - - ptr = *(uint8_t **)check; - - if (ptr >= (uint8_t *) symval->value && ptr < limit) { - instr += size; - goto again; - } - } - - /* - * We have a winner! - */ - fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); - fbt->fbtp_name = name; - - if (retfbt == NULL) { - fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, - name, FBT_RETURN, 3, fbt); - } else { - retfbt->fbtp_next = fbt; - fbt->fbtp_id = retfbt->fbtp_id; - } - - retfbt = fbt; - fbt->fbtp_patchpoint = instr; - fbt->fbtp_ctl = lf; - fbt->fbtp_loadcnt = lf->loadcnt; - fbt->fbtp_symindx = symindx; - -#ifndef __amd64__ - if (*instr == FBT_POPL_EBP) { - fbt->fbtp_rval = DTRACE_INVOP_POPL_EBP; - } else { - ASSERT(*instr == FBT_LEAVE); - fbt->fbtp_rval = DTRACE_INVOP_LEAVE; - } - fbt->fbtp_roffset = - (uintptr_t)(instr - (uint8_t *) symval->value) + 1; - -#else - ASSERT(*instr == FBT_RET); - fbt->fbtp_rval = DTRACE_INVOP_RET; - fbt->fbtp_roffset = - (uintptr_t)(instr - (uint8_t *) symval->value); -#endif - - fbt->fbtp_savedval = *instr; - fbt->fbtp_patchval = FBT_PATCHVAL; - fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; - fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; - - lf->fbt_nentries++; - - instr += size; - goto again; -} - static void fbt_provide_module(void *arg, modctl_t *lf) { @@ -524,9 +236,8 @@ fbt_enable(void *arg, dtrace_id_t id, vo return; } - for (; fbt != NULL; fbt = fbt->fbtp_next) { - *fbt->fbtp_patchpoint = fbt->fbtp_patchval; - } + for (; fbt != NULL; fbt = fbt->fbtp_next) + fbt_patch_tracepoint(fbt, fbt->fbtp_patchval); } static void @@ -542,7 +253,7 @@ fbt_disable(void *arg, dtrace_id_t id, v return; for (; fbt != NULL; fbt = fbt->fbtp_next) - *fbt->fbtp_patchpoint = fbt->fbtp_savedval; + fbt_patch_tracepoint(fbt, fbt->fbtp_patchval); } static void @@ -557,7 +268,7 @@ fbt_suspend(void *arg, dtrace_id_t id, v return; for (; fbt != NULL; fbt = fbt->fbtp_next) - *fbt->fbtp_patchpoint = fbt->fbtp_savedval; + fbt_patch_tracepoint(fbt, fbt->fbtp_patchval); } static void @@ -572,7 +283,7 @@ fbt_resume(void *arg, dtrace_id_t id, vo return; for (; fbt != NULL; fbt = fbt->fbtp_next) - *fbt->fbtp_patchpoint = fbt->fbtp_patchval; + fbt_patch_tracepoint(fbt, fbt->fbtp_patchval); } static int Added: head/sys/cddl/dev/fbt/fbt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/fbt/fbt.h Sat Aug 16 21:42:55 2014 (r270067) @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Portions Copyright 2006-2008 John Birrell jb@freebsd.org + * + * $FreeBSD$ + * + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FBT_H_ +#define _FBT_H_ + +#include "fbt_isa.h" + +typedef struct fbt_probe { + struct fbt_probe *fbtp_hashnext; + fbt_patchval_t *fbtp_patchpoint; + int8_t fbtp_rval; + fbt_patchval_t fbtp_patchval; + fbt_patchval_t fbtp_savedval; + uintptr_t fbtp_roffset; + dtrace_id_t fbtp_id; + const char *fbtp_name; + modctl_t *fbtp_ctl; + int fbtp_loadcnt; + int fbtp_primary; + int fbtp_invop_cnt; + int fbtp_symindx; + struct fbt_probe *fbtp_next; +} fbt_probe_t; + +struct linker_file; +struct linker_symval; + +int fbt_invop(uintptr_t, uintptr_t *, uintptr_t); +void fbt_patch_tracepoint(fbt_probe_t *, fbt_patchval_t); +int fbt_provide_module_function(struct linker_file *, int, + struct linker_symval *, void *); + +extern dtrace_provider_id_t fbt_id; +extern fbt_probe_t **fbt_probetab; +extern int fbt_probetab_mask; + +#define FBT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & fbt_probetab_mask) +#define FBT_PROBETAB_SIZE 0x8000 /* 32k entries -- 128K total */ + +#ifdef MALLOC_DECLARE +MALLOC_DECLARE(M_FBT); +#endif + +#endif Added: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Sat Aug 16 21:42:55 2014 (r270067) @@ -0,0 +1,241 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Portions Copyright 2006-2008 John Birrell jb@freebsd.org + * Portions Copyright 2013 Justin Hibbits jhibbits@freebsd.org + * + * $FreeBSD$ + * + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +#include +#include +#include + +#include "fbt.h" + +#define FBT_PATCHVAL 0x7c810808 +#define FBT_MFLR_R0 0x7c0802a6 +#define FBT_MTLR_R0 0x7c0803a6 +#define FBT_BLR 0x4e800020 +#define FBT_BCTR 0x4e800030 +#define FBT_BRANCH 0x48000000 +#define FBT_BR_MASK 0x03fffffc +#define FBT_IS_JUMP(instr) ((instr & ~FBT_BR_MASK) == FBT_BRANCH) + +#define FBT_ENTRY "entry" +#define FBT_RETURN "return" + +int +fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) +{ + struct trapframe *frame = (struct trapframe *)stack; + solaris_cpu_t *cpu = &solaris_cpu[curcpu]; + fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; + uintptr_t tmp; + + for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { + if ((uintptr_t)fbt->fbtp_patchpoint == addr) { + fbt->fbtp_invop_cnt++; + if (fbt->fbtp_roffset == 0) { + cpu->cpu_dtrace_caller = addr; + + dtrace_probe(fbt->fbtp_id, frame->fixreg[3], + frame->fixreg[4], frame->fixreg[5], + frame->fixreg[6], frame->fixreg[7]); + + cpu->cpu_dtrace_caller = 0; + } else { + + dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, + rval, 0, 0, 0); + /* + * The caller doesn't have the fbt item, so + * fixup tail calls here. + */ + if (fbt->fbtp_rval == DTRACE_INVOP_JUMP) { + frame->srr0 = (uintptr_t)fbt->fbtp_patchpoint; + tmp = fbt->fbtp_savedval & FBT_BR_MASK; + /* Sign extend. */ + if (tmp & 0x02000000) +#ifdef __powerpc64__ + tmp |= 0xfffffffffc000000ULL; +#else + tmp |= 0xfc000000UL; +#endif + frame->srr0 += tmp; + } + cpu->cpu_dtrace_caller = 0; + } + + return (fbt->fbtp_rval); + } + } + + return (0); +} + +void +fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) +{ + + *fbt->fbtp_patchpoint = val; + __syncicache(fbt->fbtp_patchpoint, 4); +} + +int +fbt_provide_module_function(linker_file_t lf, int symindx, + linker_symval_t *symval, void *opaque) +{ + char *modname = opaque; + const char *name = symval->name; + fbt_probe_t *fbt, *retfbt; + int j; + uint32_t *instr, *limit; + + /* PowerPC64 uses '.' prefixes on symbol names, ignore it. */ + if (name[0] == '.') + name++; + + if (strncmp(name, "dtrace_", 7) == 0 && + strncmp(name, "dtrace_safe_", 12) != 0) { + /* + * Anything beginning with "dtrace_" may be called + * from probe context unless it explicitly indicates + * that it won't be called from probe context by + * using the prefix "dtrace_safe_". + */ + return (0); + } + + if (name[0] == '_' && name[1] == '_') + return (0); + + instr = (uint32_t *) symval->value; + limit = (uint32_t *) (symval->value + symval->size); + + for (; instr < limit; instr++) + if (*instr == FBT_MFLR_R0) + break; + + if (*instr != FBT_MFLR_R0) + return (0); + + fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); + fbt->fbtp_name = name; + fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, + name, FBT_ENTRY, 3, fbt); + fbt->fbtp_patchpoint = instr; + fbt->fbtp_ctl = lf; + fbt->fbtp_loadcnt = lf->loadcnt; + fbt->fbtp_savedval = *instr; + fbt->fbtp_patchval = FBT_PATCHVAL; + fbt->fbtp_rval = DTRACE_INVOP_MFLR_R0; + fbt->fbtp_symindx = symindx; + + fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; + fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; + + lf->fbt_nentries++; + + retfbt = NULL; +again: + if (instr >= limit) + return (0); + + /* + * We (desperately) want to avoid erroneously instrumenting a + * jump table. To determine if we're looking at a true instruction + * sequence or an inline jump table that happens to contain the same + * byte sequences, we resort to some heuristic sleeze: we treat this + * instruction as being contained within a pointer, and see if that + * pointer points to within the body of the function. If it does, we + * refuse to instrument it. + */ + { + uint32_t *ptr; + + ptr = *(uint32_t **)instr; + + if (ptr >= (uint32_t *) symval->value && ptr < limit) { + instr++; + goto again; + } + } + + if (*instr != FBT_MTLR_R0) { + instr++; + goto again; + } + + instr++; + + for (j = 0; j < 12 && instr < limit; j++, instr++) { + if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) || + FBT_IS_JUMP(*instr)) + break; + } + + if (!(*instr == FBT_BCTR || *instr == FBT_BLR || FBT_IS_JUMP(*instr))) + goto again; + + /* + * We have a winner! + */ + fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); + fbt->fbtp_name = name; + + if (retfbt == NULL) { + fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, + name, FBT_RETURN, 5, fbt); + } else { + retfbt->fbtp_next = fbt; + fbt->fbtp_id = retfbt->fbtp_id; + } + + retfbt = fbt; + fbt->fbtp_patchpoint = instr; + fbt->fbtp_ctl = lf; + fbt->fbtp_loadcnt = lf->loadcnt; + fbt->fbtp_symindx = symindx; + + if (*instr == FBT_BCTR) + fbt->fbtp_rval = DTRACE_INVOP_BCTR; + else if (*instr == FBT_BLR) + fbt->fbtp_rval = DTRACE_INVOP_RET; + else + fbt->fbtp_rval = DTRACE_INVOP_JUMP; + + fbt->fbtp_savedval = *instr; + fbt->fbtp_patchval = FBT_PATCHVAL; + fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; + fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; + + lf->fbt_nentries++; + + instr += 4; + goto again; +} Added: head/sys/cddl/dev/fbt/powerpc/fbt_isa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.h Sat Aug 16 21:42:55 2014 (r270067) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + * + */ + +#ifndef _FBT_ISA_H_ +#define _FBT_ISA_H_ + +typedef uint32_t fbt_patchval_t; + +#endif Added: head/sys/cddl/dev/fbt/x86/fbt_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/fbt/x86/fbt_isa.c Sat Aug 16 21:42:55 2014 (r270067) @@ -0,0 +1,316 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Portions Copyright 2006-2008 John Birrell jb@freebsd.org + * + * $FreeBSD$ + * + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +#include + +#include + +#include "fbt.h" + +#define FBT_PUSHL_EBP 0x55 +#define FBT_MOVL_ESP_EBP0_V0 0x8b +#define FBT_MOVL_ESP_EBP1_V0 0xec +#define FBT_MOVL_ESP_EBP0_V1 0x89 +#define FBT_MOVL_ESP_EBP1_V1 0xe5 +#define FBT_REX_RSP_RBP 0x48 + +#define FBT_POPL_EBP 0x5d +#define FBT_RET 0xc3 +#define FBT_RET_IMM16 0xc2 +#define FBT_LEAVE 0xc9 + +#ifdef __amd64__ +#define FBT_PATCHVAL 0xcc +#else +#define FBT_PATCHVAL 0xf0 +#endif + +#define FBT_ENTRY "entry" +#define FBT_RETURN "return" + +int +fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval) +{ + solaris_cpu_t *cpu = &solaris_cpu[curcpu]; + uintptr_t stack0, stack1, stack2, stack3, stack4; + fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; + + for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { + if ((uintptr_t)fbt->fbtp_patchpoint == addr) { + fbt->fbtp_invop_cnt++; + if (fbt->fbtp_roffset == 0) { + int i = 0; + /* + * When accessing the arguments on the stack, + * we must protect against accessing beyond + * the stack. We can safely set NOFAULT here + * -- we know that interrupts are already + * disabled. + */ + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); + cpu->cpu_dtrace_caller = stack[i++]; + stack0 = stack[i++]; + stack1 = stack[i++]; + stack2 = stack[i++]; + stack3 = stack[i++]; + stack4 = stack[i++]; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | + CPU_DTRACE_BADADDR); + + dtrace_probe(fbt->fbtp_id, stack0, stack1, + stack2, stack3, stack4); + + cpu->cpu_dtrace_caller = 0; + } else { +#ifdef __amd64__ + /* + * On amd64, we instrument the ret, not the + * leave. We therefore need to set the caller + * to assure that the top frame of a stack() + * action is correct. + */ + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); + cpu->cpu_dtrace_caller = stack[0]; + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | + CPU_DTRACE_BADADDR); +#endif + + dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, + rval, 0, 0, 0); + cpu->cpu_dtrace_caller = 0; + } + + return (fbt->fbtp_rval); + } + } + + return (0); +} + +void +fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) +{ + + *fbt->fbtp_patchpoint = val; +} + +int +fbt_provide_module_function(linker_file_t lf, int symindx, + linker_symval_t *symval, void *opaque) +{ + char *modname = opaque; + const char *name = symval->name; + fbt_probe_t *fbt, *retfbt; + int j; + int size; + uint8_t *instr, *limit; + + if ((strncmp(name, "dtrace_", 7) == 0 && + strncmp(name, "dtrace_safe_", 12) != 0) || + strcmp(name, "trap_check") == 0) { + /* + * Anything beginning with "dtrace_" may be called + * from probe context unless it explicitly indicates + * that it won't be called from probe context by + * using the prefix "dtrace_safe_". + * + * Additionally, we avoid instrumenting trap_check() to avoid + * the possibility of generating a fault in probe context before + * DTrace's fault handler is called. + */ + return (0); + } + + if (name[0] == '_' && name[1] == '_') + return (0); + + size = symval->size; + + instr = (uint8_t *) symval->value; + limit = (uint8_t *) symval->value + symval->size; + +#ifdef __amd64__ + while (instr < limit) { + if (*instr == FBT_PUSHL_EBP) + break; + + if ((size = dtrace_instr_size(instr)) <= 0) + break; + + instr += size; + } + + if (instr >= limit || *instr != FBT_PUSHL_EBP) { + /* + * We either don't save the frame pointer in this + * function, or we ran into some disassembly + * screw-up. Either way, we bail. + */ + return (0); + } +#else + if (instr[0] != FBT_PUSHL_EBP) + return (0); + + if (!(instr[1] == FBT_MOVL_ESP_EBP0_V0 && + instr[2] == FBT_MOVL_ESP_EBP1_V0) && + !(instr[1] == FBT_MOVL_ESP_EBP0_V1 && + instr[2] == FBT_MOVL_ESP_EBP1_V1)) + return (0); +#endif + + fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); + fbt->fbtp_name = name; + fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, + name, FBT_ENTRY, 3, fbt); + fbt->fbtp_patchpoint = instr; + fbt->fbtp_ctl = lf; + fbt->fbtp_loadcnt = lf->loadcnt; + fbt->fbtp_rval = DTRACE_INVOP_PUSHL_EBP; + fbt->fbtp_savedval = *instr; + fbt->fbtp_patchval = FBT_PATCHVAL; + fbt->fbtp_symindx = symindx; + + fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; + fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; + + lf->fbt_nentries++; + + retfbt = NULL; +again: + if (instr >= limit) + return (0); + + /* + * If this disassembly fails, then we've likely walked off into + * a jump table or some other unsuitable area. Bail out of the + * disassembly now. + */ + if ((size = dtrace_instr_size(instr)) <= 0) + return (0); + +#ifdef __amd64__ + /* + * We only instrument "ret" on amd64 -- we don't yet instrument + * ret imm16, largely because the compiler doesn't seem to + * (yet) emit them in the kernel... + */ + if (*instr != FBT_RET) { + instr += size; + goto again; + } +#else + if (!(size == 1 && + (*instr == FBT_POPL_EBP || *instr == FBT_LEAVE) && + (*(instr + 1) == FBT_RET || + *(instr + 1) == FBT_RET_IMM16))) { + instr += size; + goto again; + } +#endif + + /* + * We (desperately) want to avoid erroneously instrumenting a + * jump table, especially given that our markers are pretty + * short: two bytes on x86, and just one byte on amd64. To + * determine if we're looking at a true instruction sequence + * or an inline jump table that happens to contain the same + * byte sequences, we resort to some heuristic sleeze: we + * treat this instruction as being contained within a pointer, + * and see if that pointer points to within the body of the + * function. If it does, we refuse to instrument it. + */ + for (j = 0; j < sizeof (uintptr_t); j++) { + caddr_t check = (caddr_t) instr - j; + uint8_t *ptr; + + if (check < symval->value) + break; + + if (check + sizeof (caddr_t) > (caddr_t)limit) + continue; + + ptr = *(uint8_t **)check; + + if (ptr >= (uint8_t *) symval->value && ptr < limit) { + instr += size; + goto again; + } + } + + /* + * We have a winner! + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 21:53:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03B9C2EF; Sat, 16 Aug 2014 21:53:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E259120D4; Sat, 16 Aug 2014 21:53:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GLrioM086055; Sat, 16 Aug 2014 21:53:44 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GLrigk086053; Sat, 16 Aug 2014 21:53:44 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201408162153.s7GLrigk086053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 16 Aug 2014 21:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270068 - in head: sbin/ifconfig sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 21:53:45 -0000 Author: melifaro Date: Sat Aug 16 21:53:44 2014 New Revision: 270068 URL: http://svnweb.freebsd.org/changeset/base/270068 Log: * Use standard net/sff8472.h header for sff bits and offsets. * Convert sff_8472_id to 'const char *' to please clang. Pointed by: np Modified: head/sbin/ifconfig/sfp.c head/sys/net/sff8472.h Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Sat Aug 16 21:42:55 2014 (r270067) +++ head/sbin/ifconfig/sfp.c Sat Aug 16 21:53:44 2014 (r270068) @@ -34,6 +34,7 @@ static const char rcsid[] = #include #include +#include #include #include @@ -45,10 +46,6 @@ static const char rcsid[] = #include "ifconfig.h" -/* 2wire addresses */ -#define SFP_ADDR_MSA 0xA0 /* Identification data */ -#define SFP_ADDR_DDM 0xA2 /* digital monitoring interface */ - /* Definitions from Table 3.1 */ #define SFP_MSA_IDENTIFIER 0 /* Type of transceiver (T. 3.2), 1B */ #define SFP_MSA_CONNECTOR 2 /* Connector type (T. 3.3), 1B */ @@ -88,25 +85,6 @@ struct _nv { const char *find_value(struct _nv *x, int value); const char *find_zero_bit(struct _nv *x, int value, int sz); - -/* SFF-8472 Rev. 11.4 table 3.2: Identifier values */ -static struct _nv ids[] = { - { 0x00, "Unknown" }, - { 0x01, "GBIC" }, - { 0x02, "SFF" }, - { 0x03, "SFP/SFP+" }, - { 0x04, "300 pin XBI" }, - { 0x05, "Xenpak" }, - { 0x06, "XFP" }, - { 0x07, "XFF" }, - { 0x08, "XFP-E" }, - { 0x09, "XPak" }, - { 0x0A, "X2" }, - { 0x0B, "DWDM-SFP/DWDM-SFP+" }, - { 0x0C, "QSFP" }, - { 0, NULL, }, -}; - /* SFF-8472 Rev. 11.4 table 3.4: Connector values */ static struct _nv conn[] = { { 0x00, "Unknown" }, @@ -128,72 +106,6 @@ static struct _nv conn[] = { { 0, NULL } }; -const char * -find_value(struct _nv *x, int value) -{ - for (; x->n != NULL; x++) - if (x->v == value) - return (x->n); - return (NULL); -} - -const char * -find_zero_bit(struct _nv *x, int value, int sz) -{ - int v, m; - const char *s; - - v = 1; - for (v = 1, m = 1 << (8 * sz); v < m; v *= 2) { - if ((value & v) == 0) - continue; - if ((s = find_value(x, value & v)) != NULL) { - value &= ~v; - return (s); - } - } - - return (NULL); -} - -static void -get_sfp_identifier(struct i2c_info *ii, char *buf, size_t size) -{ - const char *x; - uint8_t data; - - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_IDENTIFIER, 1, (caddr_t)&data); - - if ((x = find_value(ids, data)) == NULL) { - if (data > 0x80) - x = "Vendor specific"; - else - x = "Reserved"; - } - - snprintf(buf, size, "%s", x); -} - -static void -get_sfp_connector(struct i2c_info *ii, char *buf, size_t size) -{ - const char *x; - uint8_t data; - - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_CONNECTOR, 1, (caddr_t)&data); - - if ((x = find_value(conn, data)) == NULL) { - if (data >= 0x0D && data <= 0x1F) - x = "Unallocated"; - else if (data >= 0x23 && data <= 0x7F) - x = "Unallocated"; - else - x = "Vendor specific"; - } - - snprintf(buf, size, "%s", x); -} - /* SFF-8472 Rev. 11.4 table 3.5: Transceiver codes */ /* 10G Ethernet compliance codes, byte 3 */ static struct _nv eth_10g[] = { @@ -270,6 +182,76 @@ static struct _nv fc_speed[] = { { 0, NULL } }; +const char * +find_value(struct _nv *x, int value) +{ + for (; x->n != NULL; x++) + if (x->v == value) + return (x->n); + return (NULL); +} + +const char * +find_zero_bit(struct _nv *x, int value, int sz) +{ + int v, m; + const char *s; + + v = 1; + for (v = 1, m = 1 << (8 * sz); v < m; v *= 2) { + if ((value & v) == 0) + continue; + if ((s = find_value(x, value & v)) != NULL) { + value &= ~v; + return (s); + } + } + + return (NULL); +} + +static void +get_sfp_identifier(struct i2c_info *ii, char *buf, size_t size) +{ + const char *x; + uint8_t data; + + ii->f(ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&data); + + x = NULL; + if (data <= SFF_8472_ID_LAST) { + x = NULL; + //x = sff_8472_id[data]; + } else { + if (data > 0x80) + x = "Vendor specific"; + else + x = "Reserved"; + } + + snprintf(buf, size, "%s", x); +} + +static void +get_sfp_connector(struct i2c_info *ii, char *buf, size_t size) +{ + const char *x; + uint8_t data; + + ii->f(ii, SFF_8472_BASE, SFF_8472_CONNECTOR, 1, (caddr_t)&data); + + if ((x = find_value(conn, data)) == NULL) { + if (data >= 0x0D && data <= 0x1F) + x = "Unallocated"; + else if (data >= 0x23 && data <= 0x7F) + x = "Unallocated"; + else + x = "Vendor specific"; + } + + snprintf(buf, size, "%s", x); +} + static void printf_sfp_transceiver_descr(struct i2c_info *ii, char *buf, size_t size) { @@ -283,7 +265,7 @@ printf_sfp_transceiver_descr(struct i2c_ tech_speed = NULL; /* Read bytes 3-10 at once */ - ii->f(ii, SFP_ADDR_MSA, 3, 8, &xbuf[3]); + ii->f(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, &xbuf[3]); /* Check 10G first */ tech_class = find_zero_bit(eth_10g, xbuf[3], 1); @@ -311,11 +293,12 @@ get_sfp_transceiver_class(struct i2c_inf uint8_t code; /* Check 10G Ethernet/IB first */ - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_TRANSCEIVER_CLASS, 1, (caddr_t)&code); + ii->f(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, (caddr_t)&code); tech_class = find_zero_bit(eth_10g, code, 1); if (tech_class == NULL) { /* No match. Try Ethernet 1G */ - ii->f(ii, SFP_ADDR_MSA, 6, 1, (caddr_t)&code); + ii->f(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3, + 1, (caddr_t)&code); tech_class = find_zero_bit(eth_compat, code, 1); } @@ -333,7 +316,7 @@ get_sfp_vendor_name(struct i2c_info *ii, memset(xbuf, 0, sizeof(xbuf)); /* ASCII String, right-padded with 0x20 */ - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_NAME, 16, xbuf); + ii->f(ii, SFF_8472_BASE, SFF_8472_VENDOR_START, 16, xbuf); for (p = &xbuf[16]; *(p - 1) == 0x20; p--) ; *p = '\0'; @@ -348,7 +331,7 @@ get_sfp_vendor_pn(struct i2c_info *ii, c memset(xbuf, 0, sizeof(xbuf)); /* ASCII String, right-padded with 0x20 */ - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_PN, 16, xbuf); + ii->f(ii, SFF_8472_BASE, SFF_8472_PN_START, 16, xbuf); for (p = &xbuf[16]; *(p - 1) == 0x20; p--) ; *p = '\0'; @@ -363,7 +346,7 @@ get_sfp_vendor_sn(struct i2c_info *ii, c memset(xbuf, 0, sizeof(xbuf)); /* ASCII String, right-padded with 0x20 */ - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_SN, 16, xbuf); + ii->f(ii, SFF_8472_BASE, SFF_8472_SN_START, 16, xbuf); for (p = &xbuf[16]; *(p - 1) == 0x20; p--) ; *p = '\0'; @@ -377,7 +360,7 @@ get_sfp_vendor_date(struct i2c_info *ii, memset(xbuf, 0, sizeof(xbuf)); /* Date code, see Table 3.8 for description */ - ii->f(ii, SFP_ADDR_MSA, SFP_MSA_VENDOR_DATE, 6, xbuf); + ii->f(ii, SFF_8472_BASE, SFF_8472_DATE_START, 6, xbuf); snprintf(buf, size, "20%c%c-%c%c-%c%c", xbuf[0], xbuf[1], xbuf[2], xbuf[3], xbuf[4], xbuf[5]); } @@ -407,7 +390,7 @@ get_sfp_temp(struct i2c_info *ii, char * int k; memset(xbuf, 0, sizeof(xbuf)); - ii->f(ii, SFP_ADDR_DDM, SFP_DDM_TEMP, 2, xbuf); + ii->f(ii, SFF_8472_DIAG, SFF_8472_TEMP, 2, xbuf); /* Convert temperature to string according to table 3.13 */ major = (int8_t)xbuf[0]; @@ -441,7 +424,7 @@ get_sfp_rx_power(struct i2c_info *ii, ch char xbuf[2]; memset(xbuf, 0, sizeof(xbuf)); - ii->f(ii, SFP_ADDR_DDM, SFP_DDM_RXPOWER, 2, xbuf); + ii->f(ii, SFF_8472_DIAG, SFF_8472_RX_POWER, 2, xbuf); convert_power(ii, xbuf, buf, size); } @@ -451,7 +434,7 @@ get_sfp_tx_power(struct i2c_info *ii, ch char xbuf[2]; memset(xbuf, 0, sizeof(xbuf)); - ii->f(ii, SFP_ADDR_DDM, SFP_DDM_TXPOWER, 2, xbuf); + ii->f(ii, SFF_8472_DIAG, SFF_8472_TX_POWER, 2, xbuf); convert_power(ii, xbuf, buf, size); } @@ -514,7 +497,7 @@ sfp_status(int s, struct ifreq *ifr, int ii.ifr = ifr; /* Read diagnostic monitoring type */ - ii.f(&ii, SFP_ADDR_MSA, SFP_MSA_DMONTYPE, 1, (caddr_t)&ii.diag_type); + ii.f(&ii, SFF_8472_BASE, SFF_8472_DIAG_TYPE, 1, (caddr_t)&ii.diag_type); /* Transceiver type */ get_sfp_identifier(&ii, buf, sizeof(buf)); @@ -527,8 +510,9 @@ sfp_status(int s, struct ifreq *ifr, int print_sfp_vendor(&ii, buf, sizeof(buf)); if (ii.error == 0) printf("\t%s\n", buf); + /* - * Request current measurements iff they are implemented: + * Request current measurements iff they are provided: * Bit 6 must be set. */ if ((ii.diag_type & 0x40) != 0) { @@ -537,7 +521,5 @@ sfp_status(int s, struct ifreq *ifr, int get_sfp_tx_power(&ii, buf3, sizeof(buf3)); printf("\tTemp: %s RX: %s TX: %s\n", buf, buf2, buf3); } - - close(s); } Modified: head/sys/net/sff8472.h ============================================================================== --- head/sys/net/sff8472.h Sat Aug 16 21:42:55 2014 (r270067) +++ head/sys/net/sff8472.h Sat Aug 16 21:53:44 2014 (r270068) @@ -393,7 +393,7 @@ enum { SFF_8472_ID_LAST = SFF_8472_ID_QSFP }; -static char *sff_8472_id[SFF_8472_ID_LAST + 1] = {"Unknown", +static const char *sff_8472_id[SFF_8472_ID_LAST + 1] = {"Unknown", "GBIC", "SFF", "SFP", From owner-svn-src-all@FreeBSD.ORG Sat Aug 16 22:55:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7507E7D; Sat, 16 Aug 2014 22:55:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7938B2654; Sat, 16 Aug 2014 22:55:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7GMtx3O013348; Sat, 16 Aug 2014 22:55:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7GMtxgZ013347; Sat, 16 Aug 2014 22:55:59 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201408162255.s7GMtxgZ013347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 16 Aug 2014 22:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270069 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2014 22:55:59 -0000 Author: melifaro Date: Sat Aug 16 22:55:58 2014 New Revision: 270069 URL: http://svnweb.freebsd.org/changeset/base/270069 Log: Clean up unused definitions. Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Sat Aug 16 21:53:44 2014 (r270068) +++ head/sbin/ifconfig/sfp.c Sat Aug 16 22:55:58 2014 (r270069) @@ -46,23 +46,6 @@ static const char rcsid[] = #include "ifconfig.h" -/* Definitions from Table 3.1 */ -#define SFP_MSA_IDENTIFIER 0 /* Type of transceiver (T. 3.2), 1B */ -#define SFP_MSA_CONNECTOR 2 /* Connector type (T. 3.3), 1B */ - -#define SFP_MSA_TRANSCEIVER_CLASS 3 /* Ethernet/Sonet/IB code, 1B */ - -#define SFP_MSA_VENDOR_NAME 20 /* ASCII vendor name, 16B */ -#define SFP_MSA_VENDOR_PN 40 /* ASCII vendor partnum, 16B */ -#define SFP_MSA_VENDOR_SN 68 /* ASCII vendor serialnum, 16B */ -#define SFP_MSA_VENDOR_DATE 84 /* Vendor's date code, 8B */ -#define SFP_MSA_DMONTYPE 92 /* Type of disagnostic monitoring, 1B */ - -/* Definitions from table 3.17 */ -#define SFP_DDM_TEMP 96 /* Module temperature, 2B */ -#define SFP_DDM_TXPOWER 102 /* Measured TX output power, 2B */ -#define SFP_DDM_RXPOWER 104 /* Measured RX input power, 2B */ - struct i2c_info; typedef int (read_i2c)(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len, caddr_t buf); @@ -219,10 +202,9 @@ get_sfp_identifier(struct i2c_info *ii, ii->f(ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&data); x = NULL; - if (data <= SFF_8472_ID_LAST) { - x = NULL; - //x = sff_8472_id[data]; - } else { + if (data <= SFF_8472_ID_LAST) + x = sff_8472_id[data]; + else { if (data > 0x80) x = "Vendor specific"; else @@ -267,7 +249,7 @@ printf_sfp_transceiver_descr(struct i2c_ /* Read bytes 3-10 at once */ ii->f(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, &xbuf[3]); - /* Check 10G first */ + /* Check 10G ethernet first */ tech_class = find_zero_bit(eth_10g, xbuf[3], 1); if (tech_class == NULL) { /* No match. Try 1G */ @@ -400,6 +382,10 @@ get_sfp_temp(struct i2c_info *ii, char * snprintf(buf, size, "%d.%d C", major, k / 100); } +/* + * Converts value in @xbuf to both milliwats and dBm + * human representation. + */ static void convert_power(struct i2c_info *ii, char *xbuf, char *buf, size_t size) {