From owner-svn-src-all@FreeBSD.ORG Sun May 3 07:13:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23E7F99D; Sun, 3 May 2015 07:13: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 EA9141C0E; Sun, 3 May 2015 07:13: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 t437DFNB096472; Sun, 3 May 2015 07:13:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t437DE3V096469; Sun, 3 May 2015 07:13:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505030713.t437DE3V096469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 May 2015 07:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282361 - in stable/10/sys: cddl/contrib/opensolaris/uts/common/fs/zfs 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.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 07:13:16 -0000 Author: mav Date: Sun May 3 07:13:14 2015 New Revision: 282361 URL: https://svnweb.freebsd.org/changeset/base/282361 Log: MFC r281026, r281108, r281109: Make ZFS ARC track both KVA usage and fragmentation. Even on Illumos, with its much larger KVA, ZFS ARC steps back if KVA usage reaches certain threshold (3/4 on i386 or 16/17 otherwise). FreeBSD has even less KVA, but had no such limit on archs with direct map as amd64. As result, on machines with a lot of RAM, during load with very small user- space memory pressure, such as `zfs send`, it was possible to reach state, when there is enough both physical RAM and KVA (I've seen up to 25-30%), but no continuous KVA range to allocate even single 128KB I/O request. Address this situation from two sides: - restore KVA usage limitations in a way the most close to Illumos; - introduce new requirement for KVA fragmentation, specifying that we should have at least one sequential KVA range of zfs_max_recordsize bytes. Experiments show that first limitation done alone is not sufficient. On machine with 64GB of RAM it is sometimes needed to drop up to half of ARC size to get at leats one 1MB KVA chunk. Statically limiting ARC to half of KVA/RAM is too strict, so second limitation makes it to work in cycles: accumulate trash up to certain critical mass, do massive spring-cleaning, and then start littering again. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/kern/subr_vmem.c stable/10/sys/sys/vmem.h 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 Sun May 3 04:24:29 2015 (r282360) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun May 3 07:13:14 2015 (r282361) @@ -2606,8 +2606,11 @@ arc_reclaim_needed(void) (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC)) >> 2); return (1); } +#define zio_arena NULL +#else +#define zio_arena heap_arena #endif -#ifdef sun + /* * If zio data pages are being allocated out of a separate heap segment, * then enforce that the size of available vmem for this arena remains @@ -2621,7 +2624,14 @@ arc_reclaim_needed(void) vmem_size(zio_arena, VMEM_FREE) < (vmem_size(zio_arena, VMEM_ALLOC) >> 4)) return (1); -#endif /* sun */ + + /* + * Above limits know nothing about real level of KVA fragmentation. + * Start aggressive reclamation if too little sequential KVA left. + */ + if (vmem_size(heap_arena, VMEM_MAXFREE) < zfs_max_recordsize) + return (1); + #else /* _KERNEL */ if (spa_get_random(100) == 0) return (1); Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Sun May 3 04:24:29 2015 (r282360) +++ stable/10/sys/kern/subr_vmem.c Sun May 3 07:13:14 2015 (r282361) @@ -1319,6 +1319,7 @@ vmem_add(vmem_t *vm, vmem_addr_t addr, v vmem_size_t vmem_size(vmem_t *vm, int typemask) { + int i; switch (typemask) { case VMEM_ALLOC: @@ -1327,6 +1328,17 @@ vmem_size(vmem_t *vm, int typemask) return vm->vm_size - vm->vm_inuse; case VMEM_FREE|VMEM_ALLOC: return vm->vm_size; + case VMEM_MAXFREE: + VMEM_LOCK(vm); + for (i = VMEM_MAXORDER - 1; i >= 0; i--) { + if (LIST_EMPTY(&vm->vm_freelist[i])) + continue; + VMEM_UNLOCK(vm); + return ((vmem_size_t)ORDER2SIZE(i) << + vm->vm_quantum_shift); + } + VMEM_UNLOCK(vm); + return (0); default: panic("vmem_size"); } Modified: stable/10/sys/sys/vmem.h ============================================================================== --- stable/10/sys/sys/vmem.h Sun May 3 04:24:29 2015 (r282360) +++ stable/10/sys/sys/vmem.h Sun May 3 07:13:14 2015 (r282361) @@ -129,6 +129,7 @@ void vmem_startup(void); /* vmem_size typemask */ #define VMEM_ALLOC 0x01 #define VMEM_FREE 0x02 +#define VMEM_MAXFREE 0x10 #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sun May 3 07:16:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42AF1AE8; Sun, 3 May 2015 07:16: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 30C131C22; Sun, 3 May 2015 07:16: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 t437Gmf8097043; Sun, 3 May 2015 07:16:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t437GmXh097042; Sun, 3 May 2015 07:16:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505030716.t437GmXh097042@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 May 2015 07:16: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: r282362 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 07:16:48 -0000 Author: mav Date: Sun May 3 07:16:47 2015 New Revision: 282362 URL: https://svnweb.freebsd.org/changeset/base/282362 Log: MFC r281738: Change wcommitsize default from one empirical value to another. The new value is more predictable with growing RAM size: hibufspace maxvnodes old new i386: 256MB 32980992 15800 2198732 2097152 2GB 94027776 107677 878764 4194304 amd64: 256MB 32980992 15800 2198732 2097152 1GB 114114560 68062 1678155 4194304 4GB 217055232 111807 1955452 4194304 16GB 1717846016 337308 5097465 16777216 64GB 1734918144 1164427 1490479 16777216 256GB 1734918144 4426453 391983 16777216 Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvfsops.c Sun May 3 07:13:14 2015 (r282361) +++ stable/10/sys/fs/nfsclient/nfs_clvfsops.c Sun May 3 07:16:47 2015 (r282362) @@ -1319,10 +1319,13 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; nmp->nm_readahead = NFS_DEFRAHEAD; - if (desiredvnodes >= 11000) - nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); - else - nmp->nm_wcommitsize = hibufspace / 10; + + /* This is empirical approximation of sqrt(hibufspace) * 256. */ + nmp->nm_wcommitsize = NFS_MAXBSIZE / 256; + while ((long)nmp->nm_wcommitsize * nmp->nm_wcommitsize < hibufspace) + nmp->nm_wcommitsize *= 2; + nmp->nm_wcommitsize *= 256; + if ((argp->flags & NFSMNT_NFSV4) != 0) nmp->nm_minorvers = minvers; else From owner-svn-src-all@FreeBSD.ORG Sun May 3 07:18:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B65CDC3A; Sun, 3 May 2015 07:18: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 A3F601C28; Sun, 3 May 2015 07:18: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 t437I73G097282; Sun, 3 May 2015 07:18:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t437I7hR097281; Sun, 3 May 2015 07:18:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505030718.t437I7hR097281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 May 2015 07:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282363 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 07:18:07 -0000 Author: mav Date: Sun May 3 07:18:06 2015 New Revision: 282363 URL: https://svnweb.freebsd.org/changeset/base/282363 Log: MFC r281738: Change wcommitsize default from one empirical value to another. The new value is more predictable with growing RAM size: hibufspace maxvnodes old new i386: 256MB 32980992 15800 2198732 2097152 2GB 94027776 107677 878764 4194304 amd64: 256MB 32980992 15800 2198732 2097152 1GB 114114560 68062 1678155 4194304 4GB 217055232 111807 1955452 4194304 16GB 1717846016 337308 5097465 16777216 64GB 1734918144 1164427 1490479 16777216 256GB 1734918144 4426453 391983 16777216 Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Sun May 3 07:16:47 2015 (r282362) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Sun May 3 07:18:06 2015 (r282363) @@ -1265,10 +1265,13 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; nmp->nm_readahead = NFS_DEFRAHEAD; - if (desiredvnodes >= 11000) - nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); - else - nmp->nm_wcommitsize = hibufspace / 10; + + /* This is empirical approximation of sqrt(hibufspace) * 256. */ + nmp->nm_wcommitsize = NFS_MAXBSIZE / 256; + while ((long)nmp->nm_wcommitsize * nmp->nm_wcommitsize < hibufspace) + nmp->nm_wcommitsize *= 2; + nmp->nm_wcommitsize *= 256; + nfs_decode_args(mp, nmp, argp, hst, cred, td); From owner-svn-src-all@FreeBSD.ORG Sun May 3 07:43:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A911578; Sun, 3 May 2015 07:43:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78B321ED3; Sun, 3 May 2015 07:43:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t437hxpW012181; Sun, 3 May 2015 07:43:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t437hxsT012180; Sun, 3 May 2015 07:43:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505030743.t437hxsT012180@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 May 2015 07:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282364 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 07:43:59 -0000 Author: mav Date: Sun May 3 07:43:58 2015 New Revision: 282364 URL: https://svnweb.freebsd.org/changeset/base/282364 Log: Implement basic PxTFD.STS.BSY reporting. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sun May 3 07:18:06 2015 (r282363) +++ head/usr.sbin/bhyve/pci_ahci.c Sun May 3 07:43:58 2015 (r282364) @@ -269,22 +269,24 @@ ahci_write_fis(struct ahci_port *p, enum case FIS_TYPE_REGD2H: offset = 0x40; len = 20; - irq = AHCI_P_IX_DHR; + irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_DHR : 0; break; case FIS_TYPE_SETDEVBITS: offset = 0x58; len = 8; - irq = AHCI_P_IX_SDB; + irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_SDB : 0; break; case FIS_TYPE_PIOSETUP: offset = 0x20; len = 20; - irq = 0; + irq = (fis[1] & (1 << 6)) ? AHCI_P_IX_PS : 0; break; default: WPRINTF("unsupported fis type %d\n", ft); return; } + if (fis[2] & ATA_S_ERROR) + irq |= AHCI_P_IX_TFE; memcpy(p->rfis + offset, fis, len); if (irq) { p->is |= irq; @@ -309,22 +311,23 @@ ahci_write_fis_sdb(struct ahci_port *p, uint8_t error; error = (tfd >> 8) & 0xff; + tfd &= 0x77; memset(fis, 0, sizeof(fis)); fis[0] = FIS_TYPE_SETDEVBITS; fis[1] = (1 << 6); - fis[2] = tfd & 0x77; + fis[2] = tfd; fis[3] = error; if (fis[2] & ATA_S_ERROR) { - p->is |= AHCI_P_IX_TFE; p->err_cfis[0] = slot; - p->err_cfis[2] = tfd & 0x77; + p->err_cfis[2] = tfd; p->err_cfis[3] = error; memcpy(&p->err_cfis[4], cfis + 4, 16); } else { *(uint32_t *)(fis + 4) = (1 << slot); p->sact &= ~(1 << slot); } - p->tfd = tfd; + p->tfd &= ~0x77; + p->tfd |= tfd; ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); } @@ -351,7 +354,6 @@ ahci_write_fis_d2h(struct ahci_port *p, fis[12] = cfis[12]; fis[13] = cfis[13]; if (fis[2] & ATA_S_ERROR) { - p->is |= AHCI_P_IX_TFE; p->err_cfis[0] = 0x80; p->err_cfis[2] = tfd & 0xff; p->err_cfis[3] = error; @@ -363,6 +365,21 @@ ahci_write_fis_d2h(struct ahci_port *p, } static void +ahci_write_fis_d2h_ncq(struct ahci_port *p, int slot) +{ + uint8_t fis[20]; + + p->tfd = ATA_S_READY | ATA_S_DSC; + memset(fis, 0, sizeof(fis)); + fis[0] = FIS_TYPE_REGD2H; + fis[1] = 0; /* No interrupt */ + fis[2] = p->tfd; /* Status */ + fis[3] = 0; /* No error */ + p->ci &= ~(1 << slot); + ahci_write_fis(p, FIS_TYPE_REGD2H, fis); +} + +static void ahci_write_reset_fis_d2h(struct ahci_port *p) { uint8_t fis[20]; @@ -589,12 +606,13 @@ ahci_handle_rw(struct ahci_port *p, int struct ahci_cmd_hdr *hdr; uint64_t lba; uint32_t len; - int err, ncq, readop; + int err, first, ncq, readop; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); ncq = 0; readop = 1; + first = (done == 0); if (cfis[2] == ATA_WRITE || cfis[2] == ATA_WRITE48 || cfis[2] == ATA_WRITE_MUL || cfis[2] == ATA_WRITE_MUL48 || @@ -655,14 +673,14 @@ ahci_handle_rw(struct ahci_port *p, int /* Stuff request onto busy list. */ TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); + if (ncq && first) + ahci_write_fis_d2h_ncq(p, slot); + if (readop) err = blockif_read(p->bctx, breq); else err = blockif_write(p->bctx, breq); assert(err == 0); - - if (ncq) - p->ci &= ~(1 << slot); } static void @@ -735,15 +753,18 @@ ahci_handle_dsm_trim(struct ahci_port *p uint8_t *entry; uint64_t elba; uint32_t len, elen; - int err; + int err, first, ncq; uint8_t buf[512]; + first = (done == 0); if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { len = (uint16_t)cfis[13] << 8 | cfis[12]; len *= 512; + ncq = 0; } else { /* ATA_SEND_FPDMA_QUEUED */ len = (uint16_t)cfis[11] << 8 | cfis[3]; len *= 512; + ncq = 1; } read_prdt(p, slot, cfis, buf, sizeof(buf)); @@ -793,6 +814,9 @@ next: */ TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); + if (ncq && first) + ahci_write_fis_d2h_ncq(p, slot); + err = blockif_delete(p->bctx, breq); assert(err == 0); } @@ -1548,6 +1572,7 @@ static void ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis) { + p->tfd |= ATA_S_BUSY; switch (cfis[2]) { case ATA_ATA_IDENTIFY: handle_identify(p, slot, cfis); From owner-svn-src-all@FreeBSD.ORG Sun May 3 08:17:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24DAD96D; Sun, 3 May 2015 08:17: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 12F991195; Sun, 3 May 2015 08:17: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 t438Hb34027295; Sun, 3 May 2015 08:17:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t438Hbbf027294; Sun, 3 May 2015 08:17:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201505030817.t438Hbbf027294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 3 May 2015 08:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282365 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 08:17:38 -0000 Author: np Date: Sun May 3 08:17:37 2015 New Revision: 282365 URL: https://svnweb.freebsd.org/changeset/base/282365 Log: MFC r272051: cxgbe(4): Verify that the addresses in if_multiaddrs really are multicast addresses. (The chip doesn't really care, it's just that it needs to be told explicitly if unicast DMACs are checked for "hits" in the hash that is used after the TCAM entries are all used up). Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sun May 3 07:43:58 2015 (r282364) +++ stable/10/sys/dev/cxgbe/t4_main.c Sun May 3 08:17:37 2015 (r282365) @@ -2994,8 +2994,10 @@ update_mac_settings(struct ifnet *ifp, i TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - mcaddr[i++] = + mcaddr[i] = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + MPASS(ETHER_IS_MULTICAST(mcaddr[i])); + i++; if (i == FW_MAC_EXACT_CHUNK) { rc = t4_alloc_mac_filt(sc, sc->mbox, viid, del, From owner-svn-src-all@FreeBSD.ORG Sun May 3 14:00:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CFB7A31 for ; Sun, 3 May 2015 14:00:17 +0000 (UTC) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 509901FEC for ; Sun, 3 May 2015 14:00:16 +0000 (UTC) Received: by igbyr2 with SMTP id yr2so67921968igb.0 for ; Sun, 03 May 2015 07:00:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=W4s3ZvOr2CldeZx34f73BcdTEcyUmqf4OI8aEan3kfg=; b=iQrJHAXN0GBMdp0H6zHzz+2OO2GNrTdKC51NimN/x1xndn7Pl+pUCnA5DlzBQpHG8Y TZcyf8T95h1qkOxzQ14raafdS6FFLwL9/lRUtl2+vsFUumDlWCayQr+nedvNpUk6FSD6 eUCIecXRldayv9jiuxF5NpDYaL9teFk/3GcyDyXptQbGyZPQ6KUs+lKzxoolnG3DBNqS DPZ0vsnm6alJ64+86/Fcyaq1YniW4kroZCSIb/CUurxmWaje0lJSLl8JdarAoALBF+BA EV49BP3cpCh81f8ab/sDXCWWdL8a6+MQMxL8cGaB8OrkUYOZyAa4ypxQBbWSav3bqjy3 zk3g== X-Gm-Message-State: ALoCoQlDP3F9+9v09eYsmtV2TWn+oHy+jG2hJm4k+J/fd+LYM2PLwz7SpMZbPVaHbCfDESF0CfrJ MIME-Version: 1.0 X-Received: by 10.107.165.206 with SMTP id o197mr22781111ioe.56.1430661616117; Sun, 03 May 2015 07:00:16 -0700 (PDT) Received: by 10.79.11.6 with HTTP; Sun, 3 May 2015 07:00:15 -0700 (PDT) In-Reply-To: <201505011832.t41IWGSs002284@svn.freebsd.org> References: <201505011832.t41IWGSs002284@svn.freebsd.org> Date: Sun, 3 May 2015 16:00:15 +0200 Message-ID: Subject: Re: svn commit: r282314 - in head: include lib/libc/stdlib From: Oliver Pinter To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:00:17 -0000 On 5/1/15, Baptiste Daroussin wrote: > Author: bapt > Date: Fri May 1 18:32:16 2015 > New Revision: 282314 > URL: https://svnweb.freebsd.org/changeset/base/282314 > > Log: > Import reallocarray(3) from OpenBSD > > Add a manpage for it, assign the copyright to the OpenBSD project on it > since it > is mostly copy/paste from OpenBSD manpage. > style(9) fixes > > Differential Revision: https://reviews.freebsd.org/D2420 > Reviewed by: kib > > Added: > head/lib/libc/stdlib/reallocarray.3 (contents, props changed) > head/lib/libc/stdlib/reallocarray.c (contents, props changed) > Modified: > head/include/stdlib.h > head/lib/libc/stdlib/Makefile.inc > head/lib/libc/stdlib/Symbol.map > > Modified: head/include/stdlib.h > ... > +} Hey Bapt! Do you have any plan to MFC these changes to 10-STABLE? > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Sun May 3 14:06:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C76DBD3; Sun, 3 May 2015 14:06:40 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33AAC10B8; Sun, 3 May 2015 14:06:40 +0000 (UTC) Received: by widdi4 with SMTP id di4so87110799wid.0; Sun, 03 May 2015 07:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=3c/SosCoAzTH9922UMfhDW6c8uEMMRvSF4f6XqseyRM=; b=RqQ12Jhbfrl8xZz4AHTF7j224RlOdyeGLhk3+PrvcIDkpCmGwhjp4E2/T0rstgFZ/u hdPkLzePVlh77kN9xdaICzdsT9KZRvEDeXSqZSRD1ZVUR30XprQKILWberxYEMcyPXYr fwpUkWEMWq/CI87mi2dYiCFeGxhB5k6IZ6Xbz8H+YqsORQiMxg5Tibq1wICKhDontXxt Kwiq5nuBCwNO+8nq47yZ+Uymx1AxR04T3t5nfBpq2t4mBdjzsLZagqvn3+YFiDUlC78u czD6Z7urE+VmLSAyzXxxl9eqHnk2g1tuOEg5QTX7lSZanI+2gMDIhH9e/g4NDLrJSYoO cmUA== X-Received: by 10.194.92.137 with SMTP id cm9mr34262656wjb.133.1430661998469; Sun, 03 May 2015 07:06:38 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id l1sm6771170wiy.20.2015.05.03.07.06.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 07:06:36 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 3 May 2015 16:06:34 +0200 From: Baptiste Daroussin To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282314 - in head: include lib/libc/stdlib Message-ID: <20150503140634.GA80213@ivaldir.etoilebsd.net> References: <201505011832.t41IWGSs002284@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:06:40 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 03, 2015 at 04:00:15PM +0200, Oliver Pinter wrote: > On 5/1/15, Baptiste Daroussin wrote: > > Author: bapt > > Date: Fri May 1 18:32:16 2015 > > New Revision: 282314 > > URL: https://svnweb.freebsd.org/changeset/base/282314 > > > > Log: > > Import reallocarray(3) from OpenBSD > > > > Add a manpage for it, assign the copyright to the OpenBSD project on = it > > since it > > is mostly copy/paste from OpenBSD manpage. > > style(9) fixes > > > > Differential Revision: https://reviews.freebsd.org/D2420 > > Reviewed by: kib > > > > Added: > > head/lib/libc/stdlib/reallocarray.3 (contents, props changed) > > head/lib/libc/stdlib/reallocarray.c (contents, props changed) > > Modified: > > head/include/stdlib.h > > head/lib/libc/stdlib/Makefile.inc > > head/lib/libc/stdlib/Symbol.map > > > > Modified: head/include/stdlib.h > > ... > > +} >=20 > Hey Bapt! >=20 > Do you have any plan to MFC these changes to 10-STABLE? I had no plan to but you are the 5th one to ask me about that :) So yes I may MFC that in a couple of weeks. Best regards, Bapt --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVGK2oACgkQ8kTtMUmk6EzhfQCbB1q8aYty9p3zmrxDlfQhRrh5 ZWMAoI6BMhrNYRb7hhjqD5QHUrFi9pzZ =p8pF -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From owner-svn-src-all@FreeBSD.ORG Sun May 3 14:25:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E3F994 for ; Sun, 3 May 2015 14:25:47 +0000 (UTC) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0139F1284 for ; Sun, 3 May 2015 14:25:46 +0000 (UTC) Received: by igblo3 with SMTP id lo3so67472110igb.1 for ; Sun, 03 May 2015 07:25:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LfrK8sE09hT/VcUinpoaejBQqACjilxPVSW9Ehi4ptY=; b=J4NpJ8p+e71VWAP1ZTpBYueWDGwOScnWemCqVZ4EV4k+6lzYJS1c9KDRtiBPiwjLE8 jEWJt9NuOlTEmQGIXiXO0HgVElKBOokunyZSsHmvB2k2Cz3wHW37ItIHpgbfKtAV0OMH zShyvWiSIWQpsl2mnPAMpAf1qin6p1dsGciX2GSc1kupdePS2pJ3BfSv4n2mHQuaNcmu g6qyj5IlYfSuBCOxUHP34Z2NUHU6l28xjeE/krDCsS7v8nfk/woxwgEwGHUfwiydjPaN 23+eDYqN5u3t++x2yg0us/BOfGnuVTLEkToBP5jFv0KASDdk3dc78QlmH/M90uwrqis6 +3cw== X-Gm-Message-State: ALoCoQklC0aW1/oK6y/yr9ij5k7w3RDMGUbga7A0xTtG/6vha2o29hdzjufhRNYT+zdA3iYv8ZVv MIME-Version: 1.0 X-Received: by 10.50.23.114 with SMTP id l18mr8145064igf.26.1430663139853; Sun, 03 May 2015 07:25:39 -0700 (PDT) Received: by 10.79.11.6 with HTTP; Sun, 3 May 2015 07:25:39 -0700 (PDT) In-Reply-To: <20150503140634.GA80213@ivaldir.etoilebsd.net> References: <201505011832.t41IWGSs002284@svn.freebsd.org> <20150503140634.GA80213@ivaldir.etoilebsd.net> Date: Sun, 3 May 2015 16:25:39 +0200 Message-ID: Subject: Re: svn commit: r282314 - in head: include lib/libc/stdlib From: Oliver Pinter To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:25:47 -0000 On 5/3/15, Baptiste Daroussin wrote: > On Sun, May 03, 2015 at 04:00:15PM +0200, Oliver Pinter wrote: >> On 5/1/15, Baptiste Daroussin wrote: >> > Author: bapt >> > Date: Fri May 1 18:32:16 2015 >> > New Revision: 282314 >> > URL: https://svnweb.freebsd.org/changeset/base/282314 >> > >> > Log: >> > Import reallocarray(3) from OpenBSD >> > >> > Add a manpage for it, assign the copyright to the OpenBSD project on >> > it >> > since it >> > is mostly copy/paste from OpenBSD manpage. >> > style(9) fixes >> > >> > Differential Revision: https://reviews.freebsd.org/D2420 >> > Reviewed by: kib >> > >> > Added: >> > head/lib/libc/stdlib/reallocarray.3 (contents, props changed) >> > head/lib/libc/stdlib/reallocarray.c (contents, props changed) >> > Modified: >> > head/include/stdlib.h >> > head/lib/libc/stdlib/Makefile.inc >> > head/lib/libc/stdlib/Symbol.map >> > >> > Modified: head/include/stdlib.h >> > ... >> > +} >> >> Hey Bapt! >> >> Do you have any plan to MFC these changes to 10-STABLE? > > I had no plan to but you are the 5th one to ask me about that :) > So yes I may MFC that in a couple of weeks. > Cool! Thanks! > Best regards, > Bapt > From owner-svn-src-all@FreeBSD.ORG Sun May 3 15:09:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E955AA8; Sun, 3 May 2015 15:09:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BA7C16A1; Sun, 3 May 2015 15:09:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43F9YPL032142; Sun, 3 May 2015 15:09:34 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43F9YXF032138; Sun, 3 May 2015 15:09:34 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201505031509.t43F9YXF032138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sun, 3 May 2015 15:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282366 - in stable/10/sys/dev/usb: . wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 15:09:35 -0000 Author: kevlo Date: Sun May 3 15:09:34 2015 New Revision: 282366 URL: https://svnweb.freebsd.org/changeset/base/282366 Log: MFC r281592, r281918, r282119, r282266: - Fix the length of efuse content - Disable usb aggregation mode by default since it boots performance Modified: stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Sun May 3 08:17:37 2015 (r282365) +++ stable/10/sys/dev/usb/usbdevs Sun May 3 15:09:34 2015 (r282366) @@ -3729,6 +3729,7 @@ product REALTEK RTL8188CU_1 0x817a RTL81 product REALTEK RTL8188CU_2 0x817b RTL8188CU product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter +product REALTEK RTL8188CU_3 0x8191 RTL8188CU product REALTEK RTL8196EU 0x8196 RTL8196EU product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Sun May 3 08:17:37 2015 (r282365) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Sun May 3 15:09:34 2015 (r282366) @@ -136,6 +136,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(REALTEK, RTL8188CU_0), URTWN_DEV(REALTEK, RTL8188CU_1), URTWN_DEV(REALTEK, RTL8188CU_2), + URTWN_DEV(REALTEK, RTL8188CU_3), URTWN_DEV(REALTEK, RTL8188CU_COMBO), URTWN_DEV(REALTEK, RTL8188CUS), URTWN_DEV(REALTEK, RTL8188RU_1), @@ -144,7 +145,6 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(REALTEK, RTL8191CU), URTWN_DEV(REALTEK, RTL8192CE), URTWN_DEV(REALTEK, RTL8192CU), - URTWN_DEV(REALTEK, RTL8188CU_0), URTWN_DEV(SITECOMEU, RTL8188CU_1), URTWN_DEV(SITECOMEU, RTL8188CU_2), URTWN_DEV(SITECOMEU, RTL8192CU), @@ -1188,7 +1188,7 @@ urtwn_efuse_read(struct urtwn_softc *sc) uint8_t *rom = (uint8_t *)&sc->rom; uint16_t addr = 0; uint32_t reg; - uint8_t off, msk; + uint8_t off, msk, vol; int i; urtwn_efuse_switch_power(sc); @@ -1221,12 +1221,19 @@ urtwn_efuse_read(struct urtwn_softc *sc) printf("\n"); } #endif + /* Disable LDO 2.5V. */ + vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); + urtwn_write_1(sc, R92C_EFUSE_TEST + 3, vol & ~(0x80)); + } static void urtwn_efuse_switch_power(struct urtwn_softc *sc) { uint32_t reg; + if (sc->chip & URTWN_CHIP_88E) + urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_ON); + reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { urtwn_write_2(sc, R92C_SYS_ISO_CTRL, @@ -1243,6 +1250,16 @@ urtwn_efuse_switch_power(struct urtwn_so urtwn_write_2(sc, R92C_SYS_CLKR, reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); } + + if (!(sc->chip & URTWN_CHIP_88E)) { + uint8_t vol; + + /* Enable LDO 2.5V. */ + vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); + vol &= 0x0f; + vol |= 0x30; + urtwn_write_1(sc, R92C_EFUSE_TEST + 3, (vol | 0x80)); + } } static int @@ -1310,7 +1327,7 @@ urtwn_r88e_read_rom(struct urtwn_softc * /* Read full ROM image. */ memset(&sc->r88e_rom, 0xff, sizeof(sc->r88e_rom)); - while (addr < 1024) { + while (addr < 512) { reg = urtwn_efuse_read_1(sc, addr); if (reg == 0xff) break; @@ -1336,6 +1353,8 @@ urtwn_r88e_read_rom(struct urtwn_softc * } } + urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_OFF); + addr = 0x10; for (i = 0; i < 6; i++) sc->cck_tx_pwr[i] = sc->r88e_rom[addr++]; @@ -2175,14 +2194,12 @@ urtwn_r92c_power_on(struct urtwn_softc * static int urtwn_r88e_power_on(struct urtwn_softc *sc) { - uint8_t val; uint32_t reg; int ntries; /* Wait for power ready bit. */ for (ntries = 0; ntries < 5000; ntries++) { - val = urtwn_read_1(sc, 0x6) & 0x2; - if (val == 0x2) + if (urtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) break; urtwn_ms_delay(sc); } @@ -2197,17 +2214,23 @@ urtwn_r88e_power_on(struct urtwn_softc * urtwn_read_1(sc, R92C_SYS_FUNC_EN) & ~(R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST)); - urtwn_write_1(sc, 0x26, urtwn_read_1(sc, 0x26) | 0x80); + urtwn_write_1(sc, R92C_AFE_XTAL_CTRL + 2, + urtwn_read_1(sc, R92C_AFE_XTAL_CTRL + 2) | 0x80); /* Disable HWPDN. */ - urtwn_write_1(sc, 0x5, urtwn_read_1(sc, 0x5) & ~0x80); + urtwn_write_2(sc, R92C_APS_FSMCO, + urtwn_read_2(sc, R92C_APS_FSMCO) & ~R92C_APS_FSMCO_APDM_HPDN); /* Disable WL suspend. */ - urtwn_write_1(sc, 0x5, urtwn_read_1(sc, 0x5) & ~0x18); + urtwn_write_2(sc, R92C_APS_FSMCO, + urtwn_read_2(sc, R92C_APS_FSMCO) & + ~(R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE)); - urtwn_write_1(sc, 0x5, urtwn_read_1(sc, 0x5) | 0x1); + urtwn_write_2(sc, R92C_APS_FSMCO, + urtwn_read_2(sc, R92C_APS_FSMCO) | R92C_APS_FSMCO_APFM_ONMAC); for (ntries = 0; ntries < 5000; ntries++) { - if (!(urtwn_read_1(sc, 0x5) & 0x1)) + if (!(urtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) break; urtwn_ms_delay(sc); } @@ -2215,7 +2238,8 @@ urtwn_r88e_power_on(struct urtwn_softc * return (ETIMEDOUT); /* Enable LDO normal mode. */ - urtwn_write_1(sc, 0x23, urtwn_read_1(sc, 0x23) & ~0x10); + urtwn_write_1(sc, R92C_LPLDO_CTRL, + urtwn_read_1(sc, R92C_LPLDO_CTRL) & ~0x10); /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ urtwn_write_2(sc, R92C_CR, 0); @@ -2547,7 +2571,6 @@ urtwn_r88e_dma_init(struct urtwn_softc * return (EIO); /* Set number of pages for normal priority queue. */ - urtwn_write_2(sc, R92C_RQPN_NPQ, 0); urtwn_write_2(sc, R92C_RQPN_NPQ, 0x000d); urtwn_write_4(sc, R92C_RQPN, 0x808e000d); @@ -3366,16 +3389,17 @@ urtwn_init_locked(void *arg) urtwn_write_1(sc, R92C_TRXDMA_CTRL, urtwn_read_1(sc, R92C_TRXDMA_CTRL) | R92C_TRXDMA_CTRL_RXDMA_AGG_EN); - urtwn_write_1(sc, R92C_USB_SPECIAL_OPTION, - urtwn_read_1(sc, R92C_USB_SPECIAL_OPTION) | - R92C_USB_SPECIAL_OPTION_AGG_EN); urtwn_write_1(sc, R92C_RXDMA_AGG_PG_TH, 48); if (sc->chip & URTWN_CHIP_88E) urtwn_write_1(sc, R92C_RXDMA_AGG_PG_TH + 1, 4); - else + else { urtwn_write_1(sc, R92C_USB_DMA_AGG_TO, 4); - urtwn_write_1(sc, R92C_USB_AGG_TH, 8); - urtwn_write_1(sc, R92C_USB_AGG_TO, 6); + urtwn_write_1(sc, R92C_USB_SPECIAL_OPTION, + urtwn_read_1(sc, R92C_USB_SPECIAL_OPTION) | + R92C_USB_SPECIAL_OPTION_AGG_EN); + urtwn_write_1(sc, R92C_USB_AGG_TH, 8); + urtwn_write_1(sc, R92C_USB_AGG_TO, 6); + } /* Initialize beacon parameters. */ urtwn_write_2(sc, R92C_BCN_CTRL, 0x1010); From owner-svn-src-all@FreeBSD.ORG Sun May 3 18:54:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0986F5F0; Sun, 3 May 2015 18:54:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB65A1BD5; Sun, 3 May 2015 18:54:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43IsHjb046545; Sun, 3 May 2015 18:54:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43IsHkb046544; Sun, 3 May 2015 18:54:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201505031854.t43IsHkb046544@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 3 May 2015 18:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282367 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 18:54:18 -0000 Author: np Date: Sun May 3 18:54:17 2015 New Revision: 282367 URL: https://svnweb.freebsd.org/changeset/base/282367 Log: MFC r272183: Make sure the adapter's management queue and the event queue are available before any uppper layer driver (TOE, iWARP, or iSCSI) registers with the base cxgbe(4) driver. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sun May 3 15:09:34 2015 (r282366) +++ stable/10/sys/dev/cxgbe/t4_main.c Sun May 3 18:54:17 2015 (r282367) @@ -8262,6 +8262,12 @@ t4_activate_uld(struct adapter *sc, int SLIST_FOREACH(ui, &t4_uld_list, link) { if (ui->uld_id == id) { + if (!(sc->flags & FULL_INIT_DONE)) { + rc = adapter_full_init(sc); + if (rc != 0) + goto done; + } + rc = ui->activate(sc); if (rc == 0) ui->refcount++; From owner-svn-src-all@FreeBSD.ORG Sun May 3 20:56:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CAFCF8F; Sun, 3 May 2015 20:56: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 610FA197A; Sun, 3 May 2015 20:56: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 t43KuYxR014189; Sun, 3 May 2015 20:56:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43KuXrG014186; Sun, 3 May 2015 20:56:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032056.t43KuXrG014186@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 20:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282369 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 20:56:34 -0000 Author: adrian Date: Sun May 3 20:56:33 2015 New Revision: 282369 URL: https://svnweb.freebsd.org/changeset/base/282369 Log: Retry twice at the same rate. Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 19:30:11 2015 (r282368) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 20:56:33 2015 (r282369) @@ -1957,7 +1957,7 @@ wpi_tx_done(struct wpi_softc *sc, struct struct ieee80211vap *vap; struct ieee80211com *ic; uint32_t status = le32toh(stat->status); - int ackfailcnt = stat->ackfailcnt / 2; /* wpi_mrr_setup() */ + int ackfailcnt = stat->ackfailcnt / WPI_NTRIES_DEFAULT; KASSERT(data->ni != NULL, ("no node")); KASSERT(data->m != NULL, ("no mbuf")); @@ -1966,7 +1966,7 @@ wpi_tx_done(struct wpi_softc *sc, struct DPRINTF(sc, WPI_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d btkillcnt %d rate %x duration %d " - "status %x\n", __func__, desc->qid, desc->idx, ackfailcnt, + "status %x\n", __func__, desc->qid, desc->idx, stat->ackfailcnt, stat->btkillcnt, stat->rate, le32toh(stat->duration), status); /* Unmap and free mbuf. */ @@ -3125,8 +3125,8 @@ wpi_mrr_setup(struct wpi_softc *sc) /* Fallback to the immediate lower CCK rate (if any.) */ mrr.rates[i].next = (i == WPI_RIDX_CCK1) ? WPI_RIDX_CCK1 : i - 1; - /* Try one time at this rate before falling back to "next". */ - mrr.rates[i].ntries = 1; + /* Try twice at this rate before falling back to "next". */ + mrr.rates[i].ntries = WPI_NTRIES_DEFAULT; } /* OFDM rates (not used with 802.11b). */ for (i = WPI_RIDX_OFDM6; i <= WPI_RIDX_OFDM54; i++) { @@ -3138,8 +3138,8 @@ wpi_mrr_setup(struct wpi_softc *sc) ((ic->ic_curmode == IEEE80211_MODE_11A) ? WPI_RIDX_OFDM6 : WPI_RIDX_CCK2) : i - 1; - /* Try one time at this rate before falling back to "next". */ - mrr.rates[i].ntries = 1; + /* Try twice at this rate before falling back to "next". */ + mrr.rates[i].ntries = WPI_NTRIES_DEFAULT; } /* Setup MRR for control frames. */ mrr.which = htole32(WPI_MRR_CTL); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 19:30:11 2015 (r282368) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 20:56:33 2015 (r282369) @@ -547,6 +547,8 @@ struct wpi_mrr_setup { uint8_t plcp; uint8_t flags; uint8_t ntries; +#define WPI_NTRIES_DEFAULT 2 + uint8_t next; } __packed rates[WPI_RIDX_MAX + 1]; } __packed; From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:10:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83FB3154; Sun, 3 May 2015 22:10: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 7286B10CC; Sun, 3 May 2015 22:10: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 t43MATHW050149; Sun, 3 May 2015 22:10:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MATKb050148; Sun, 3 May 2015 22:10:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032210.t43MATKb050148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282370 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:10:29 -0000 Author: adrian Date: Sun May 3 22:10:28 2015 New Revision: 282370 URL: https://svnweb.freebsd.org/changeset/base/282370 Log: Remove this; it's currently a no-op. History note: it's good to document what the driver expects like this even if it's currently a no-op. Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 20:56:33 2015 (r282369) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:10:28 2015 (r282370) @@ -4274,8 +4274,6 @@ wpi_run(struct wpi_softc *sc, struct iee sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); - /* Short preamble and slot time are negotiated when associating. */ - sc->rxon.flags &= ~htole32(WPI_RXON_SHPREAMBLE | WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:13:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B51238C; Sun, 3 May 2015 22:13:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 794DF1183; Sun, 3 May 2015 22:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43MDu0l053837; Sun, 3 May 2015 22:13:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MDuh9053836; Sun, 3 May 2015 22:13:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032213.t43MDuh9053836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282371 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:13:56 -0000 Author: adrian Date: Sun May 3 22:13:55 2015 New Revision: 282371 URL: https://svnweb.freebsd.org/changeset/base/282371 Log: Add a few local variables to improve readability. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:10:28 2015 (r282370) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:13:55 2015 (r282371) @@ -3710,6 +3710,7 @@ wpi_config(struct wpi_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211_channel *c = ic->ic_curchan; uint32_t flags; int error; @@ -3734,9 +3735,9 @@ wpi_config(struct wpi_softc *sc) IEEE80211_ADDR_COPY(sc->rxon.myaddr, vap->iv_myaddr); /* Set default channel. */ - sc->rxon.chan = ieee80211_chan2ieee(ic, ic->ic_curchan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); sc->rxon.filter = WPI_FILTER_MULTICAST; @@ -4044,6 +4045,7 @@ wpi_auth(struct wpi_softc *sc, struct ie { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; + struct ieee80211_channel *c = ni->ni_chan; int error; WPI_RXON_LOCK(sc); @@ -4054,18 +4056,18 @@ wpi_auth(struct wpi_softc *sc, struct ie sc->rxon.associd = 0; sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); - sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) sc->rxon.flags |= htole32(WPI_RXON_SHPREAMBLE); - if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_A(c)) { sc->rxon.cck_mask = 0; sc->rxon.ofdm_mask = 0x15; - } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) { + } else if (IEEE80211_IS_CHAN_B(c)) { sc->rxon.cck_mask = 0x03; sc->rxon.ofdm_mask = 0; } else { @@ -4243,6 +4245,7 @@ wpi_run(struct wpi_softc *sc, struct iee { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni = vap->iv_bss; + struct ieee80211_channel *c = ni->ni_chan; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -4254,7 +4257,7 @@ wpi_run(struct wpi_softc *sc, struct iee } /* XXX kernel panic workaround */ - if (ni->ni_chan == IEEE80211_CHAN_ANYC) { + if (c == IEEE80211_CHAN_ANYC) { device_printf(sc->sc_dev, "%s: incomplete configuration\n", __func__); return EINVAL; @@ -4270,18 +4273,18 @@ wpi_run(struct wpi_softc *sc, struct iee WPI_RXON_LOCK(sc); IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid); sc->rxon.associd = htole16(IEEE80211_NODE_AID(ni)); - sc->rxon.chan = ieee80211_chan2ieee(ic, ni->ni_chan); + sc->rxon.chan = ieee80211_chan2ieee(ic, c); sc->rxon.flags = htole32(WPI_RXON_TSF | WPI_RXON_CTS_TO_SELF); - if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + if (IEEE80211_IS_CHAN_2GHZ(c)) sc->rxon.flags |= htole32(WPI_RXON_AUTO | WPI_RXON_24GHZ); if (ic->ic_flags & IEEE80211_F_SHSLOT) sc->rxon.flags |= htole32(WPI_RXON_SHSLOT); if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) sc->rxon.flags |= htole32(WPI_RXON_SHPREAMBLE); - if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_A(c)) { sc->rxon.cck_mask = 0; sc->rxon.ofdm_mask = 0x15; - } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) { + } else if (IEEE80211_IS_CHAN_B(c)) { sc->rxon.cck_mask = 0x03; sc->rxon.ofdm_mask = 0; } else { From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:28:43 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 438F661C; Sun, 3 May 2015 22:28: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 188FE1283; Sun, 3 May 2015 22:28: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 t43MSggj059395; Sun, 3 May 2015 22:28:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MSg1P059394; Sun, 3 May 2015 22:28:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032228.t43MSg1P059394@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282372 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 22:28:43 -0000 Author: adrian Date: Sun May 3 22:28:42 2015 New Revision: 282372 URL: https://svnweb.freebsd.org/changeset/base/282372 Log: Remove old iv_bss entry from the node table This may happen on RUN -> SCAN -> RUN -> SCAN state transition: 1. RUN -> SCAN: in ieee80211_sta_join1(): iv_bss will be moved to obss, refcnt will be reduced by 2 (default minimum). Now, if old iv_bss have some extra references (for example, from unacknowledged probe responses), it will not be freed and will stay in the node table. 2. SCAN -> RUN. 3. If old iv_bss will not be deleted by the time when the next RUN -> SCAN state transition occurs, then sta_leave() will reduce it's reference counter once more. As a result, two last users will free it -> this will lead to kernel panic. In this patch old iv_bss entry is explicitly removed from the node table in ieee80211_sta_join1() (as a result, it will not be processed by sta_leave()). PR: kern/199676 Differential Revision: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun May 3 22:13:55 2015 (r282371) +++ head/sys/net80211/ieee80211_node.c Sun May 3 22:28:42 2015 (r282372) @@ -93,6 +93,8 @@ static void node_getmimoinfo(const struc static void _ieee80211_free_node(struct ieee80211_node *); +static void node_reclaim(struct ieee80211_node_table *nt, + struct ieee80211_node *ni); static void ieee80211_node_table_init(struct ieee80211com *ic, struct ieee80211_node_table *nt, const char *name, int inact, int keymaxix); @@ -719,9 +721,15 @@ ieee80211_sta_join1(struct ieee80211_nod IEEE80211_ADDR_EQ(obss->ni_macaddr, selbs->ni_macaddr)); vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */ if (obss != NULL) { + struct ieee80211_node_table *nt = obss->ni_table; + copy_bss(selbs, obss); ieee80211_node_decref(obss); /* iv_bss reference */ - ieee80211_free_node(obss); /* station table reference */ + + IEEE80211_NODE_LOCK(nt); + node_reclaim(nt, obss); /* station table reference */ + IEEE80211_NODE_UNLOCK(nt); + obss = NULL; /* NB: guard against later use */ } From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:30:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 657D77B6; Sun, 3 May 2015 22:30: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 541EE12BA; Sun, 3 May 2015 22:30: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 t43MUCGU059809; Sun, 3 May 2015 22:30:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MUC1Z059808; Sun, 3 May 2015 22:30:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032230.t43MUC1Z059808@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282373 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:30:12 -0000 Author: adrian Date: Sun May 3 22:30:11 2015 New Revision: 282373 URL: https://svnweb.freebsd.org/changeset/base/282373 Log: Remove workaround for bug 199676. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:28:42 2015 (r282372) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:30:11 2015 (r282373) @@ -2705,9 +2705,6 @@ wpi_tx_data(struct wpi_softc *sc, struct tx->id = wn->id; } - if (type != IEEE80211_FC0_TYPE_MGT) - tx->data_ntries = tp->maxretry; - if (k != NULL && !swcrypt) { switch (k->wk_cipher->ic_cipher) { case IEEE80211_CIPHER_AES_CCM: @@ -2729,6 +2726,7 @@ wpi_tx_data(struct wpi_softc *sc, struct tx->ofdm_mask = 0xff; tx->cck_mask = 0x0f; tx->rts_ntries = 7; + tx->data_ntries = tp->maxretry; tx_data.ni = ni; tx_data.m = m; From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:32:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93559ABC; Sun, 3 May 2015 22:32: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 81FA813A9; Sun, 3 May 2015 22:32: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 t43MWkDK063728; Sun, 3 May 2015 22:32:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MWk6x063727; Sun, 3 May 2015 22:32:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032232.t43MWk6x063727@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282374 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:32:46 -0000 Author: adrian Date: Sun May 3 22:32:45 2015 New Revision: 282374 URL: https://svnweb.freebsd.org/changeset/base/282374 Log: Fix KASSERT statements in if_wpi_debug.h PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 22:30:11 2015 (r282373) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 22:32:45 2015 (r282374) @@ -90,7 +90,6 @@ static const char *wpi_cmd_str(int cmd) WPI_DESC(WPI_CMD_BT_COEX); default: - KASSERT(1, ("Unknown Command: %d\n", cmd)); return "UNKNOWN CMD"; } } @@ -117,7 +116,7 @@ static const char *wpi_get_csr_string(in WPI_DESC(WPI_ANA_PLL); WPI_DESC(WPI_DBG_HPET_MEM); default: - KASSERT(1, ("Unknown CSR: %d\n", csr)); + KASSERT(0, ("Unknown CSR: %d\n", csr)); return "UNKNOWN CSR"; } } @@ -130,7 +129,7 @@ static const char *wpi_get_prph_string(i WPI_DESC(WPI_APMG_PCI_STT); WPI_DESC(WPI_APMG_RFKILL); default: - KASSERT(1, ("Unknown register: %d\n", prph)); + KASSERT(0, ("Unknown register: %d\n", prph)); return "UNKNOWN PRPH"; } } From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:34:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FE9C51; Sun, 3 May 2015 22:34:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2804513C6; Sun, 3 May 2015 22:34: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 t43MYXAh064045; Sun, 3 May 2015 22:34:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MYXS6064044; Sun, 3 May 2015 22:34:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032234.t43MYXS6064044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282375 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:34:33 -0000 Author: adrian Date: Sun May 3 22:34:32 2015 New Revision: 282375 URL: https://svnweb.freebsd.org/changeset/base/282375 Log: Add wpi_check_bss_filter() PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:32:45 2015 (r282374) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:34:32 2015 (r282375) @@ -1651,6 +1651,12 @@ wpi_node_free(struct ieee80211_node *ni) sc->sc_node_free(ni); } +static __inline int +wpi_check_bss_filter(struct wpi_softc *sc) +{ + return (sc->rxon.filter & htole32(WPI_FILTER_BSS)) != 0; +} + /** * Called by net80211 when ever there is a change to 80211 state machine */ @@ -1681,7 +1687,7 @@ wpi_newstate(struct ieee80211vap *vap, e switch (nstate) { case IEEE80211_S_SCAN: WPI_RXON_LOCK(sc); - if ((sc->rxon.filter & htole32(WPI_FILTER_BSS)) && + if (wpi_check_bss_filter(sc) != 0 && vap->iv_opmode != IEEE80211_M_STA) { sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { @@ -1749,7 +1755,7 @@ wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; - if (!(sc->rxon.filter & htole32(WPI_FILTER_BSS))) + if (wpi_check_bss_filter(sc) == 0) return; wpi_power_calibration(sc); @@ -3642,7 +3648,7 @@ wpi_send_rxon(struct wpi_softc *sc, int if (async) WPI_RXON_LOCK_ASSERT(sc); - if (assoc && (sc->rxon.filter & htole32(WPI_FILTER_BSS))) { + if (assoc && wpi_check_bss_filter(sc) != 0) { struct wpi_assoc rxon_assoc; rxon_assoc.flags = sc->rxon.flags; From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:43:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD5E4EB7; Sun, 3 May 2015 22:43: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 81B68150F; Sun, 3 May 2015 22:43: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 t43MhkRC068849; Sun, 3 May 2015 22:43:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MhkfO068847; Sun, 3 May 2015 22:43:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032243.t43MhkfO068847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282376 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:43:46 -0000 Author: adrian Date: Sun May 3 22:43:45 2015 New Revision: 282376 URL: https://svnweb.freebsd.org/changeset/base/282376 Log: Use another workaround for scanning. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:34:32 2015 (r282375) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:43:45 2015 (r282376) @@ -516,7 +516,6 @@ wpi_attach(device_t dev) ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; ic->ic_set_channel = wpi_set_channel; - sc->sc_scan_curchan = ic->ic_scan_curchan; ic->ic_scan_curchan = wpi_scan_curchan; ic->ic_scan_mindwell = wpi_scan_mindwell; ic->ic_setregdomain = wpi_setregdomain; @@ -4020,6 +4019,20 @@ wpi_scan(struct wpi_softc *sc, struct ie chan->chan, IEEE80211_IS_CHAN_PASSIVE(c)); hdr->nchan++; + + if (hdr->nchan == 1 && sc->rxon.chan == chan->chan) { + /* XXX Force probe request transmission. */ + memcpy(chan + 1, chan, sizeof (struct wpi_scan_chan)); + + chan++; + + /* Reduce unnecessary delay. */ + chan->flags = 0; + chan->passive = chan->active = hdr->quiet_time; + + hdr->nchan++; + } + chan++; buflen = (uint8_t *)chan - buf; @@ -5400,16 +5413,10 @@ wpi_scan_curchan(struct ieee80211_scan_s int error; WPI_RXON_LOCK(sc); - if (sc->rxon.chan != ieee80211_chan2ieee(ic, ic->ic_curchan)) { - error = wpi_scan(sc, ic->ic_curchan); - WPI_RXON_UNLOCK(sc); - if (error != 0) - ieee80211_cancel_scan(vap); - } else { - WPI_RXON_UNLOCK(sc); - /* Send probe request when associated. */ - sc->sc_scan_curchan(ss, maxdwell); - } + error = wpi_scan(sc, ic->ic_curchan); + WPI_RXON_UNLOCK(sc); + if (error != 0) + ieee80211_cancel_scan(vap); } /** Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun May 3 22:34:32 2015 (r282375) +++ head/sys/dev/wpi/if_wpivar.h Sun May 3 22:43:45 2015 (r282376) @@ -210,8 +210,6 @@ struct wpi_softc { struct mtx nt_mtx; void (*sc_node_free)(struct ieee80211_node *); - void (*sc_scan_curchan)(struct ieee80211_scan_state *, - unsigned long); struct wpi_rx_radiotap_header sc_rxtap; struct wpi_tx_radiotap_header sc_txtap; From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:47:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB8D6B7; Sun, 3 May 2015 22:47: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 D98A81531; Sun, 3 May 2015 22:47: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 t43Ml6ku069407; Sun, 3 May 2015 22:47:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Ml6Nq069406; Sun, 3 May 2015 22:47:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032247.t43Ml6Nq069406@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282377 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:47:07 -0000 Author: adrian Date: Sun May 3 22:47:06 2015 New Revision: 282377 URL: https://svnweb.freebsd.org/changeset/base/282377 Log: Move radiooff_task to the internal taskqueue. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:43:45 2015 (r282376) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:47:06 2015 (r282377) @@ -688,8 +688,6 @@ wpi_detach(device_t dev) if (ifp != NULL) { ic = ifp->if_l2com; - ieee80211_draintask(ic, &sc->sc_reinittask); - ieee80211_draintask(ic, &sc->sc_radiooff_task); ieee80211_draintask(ic, &sc->sc_radioon_task); ieee80211_draintask(ic, &sc->sc_start_task); @@ -2168,7 +2166,8 @@ wpi_notif_intr(struct wpi_softc *sc) WPI_NT_LOCK(sc); wpi_clear_node_table(sc); WPI_NT_UNLOCK(sc); - ieee80211_runtask(ic, &sc->sc_radiooff_task); + taskqueue_enqueue(sc->sc_tq, + &sc->sc_radiooff_task); return; } break; From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:49:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 574A9253; Sun, 3 May 2015 22:49: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 2BEBE1546; Sun, 3 May 2015 22:49: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 t43MnmWV069805; Sun, 3 May 2015 22:49:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Mnl8s069803; Sun, 3 May 2015 22:49:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032249.t43Mnl8s069803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282378 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:49:48 -0000 Author: adrian Date: Sun May 3 22:49:47 2015 New Revision: 282378 URL: https://svnweb.freebsd.org/changeset/base/282378 Log: Add TX status codes (obtained from iwlegacy) PR: kern/197143 Differential Revision: Andriy Voskoboinyk Obtained from: Linux drivers/net/wireless/iwlegacy Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:47:06 2015 (r282377) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:49:47 2015 (r282378) @@ -1983,7 +1983,7 @@ wpi_tx_done(struct wpi_softc *sc, struct /* * Update rate control statistics for the node. */ - if ((status & 0xff) != 1) { + if (status & WPI_TX_STATUS_FAIL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_ratectl_tx_complete(vap, ni, IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); @@ -1993,7 +1993,7 @@ wpi_tx_done(struct wpi_softc *sc, struct IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); } - ieee80211_tx_complete(ni, m, (status & 0xff) != 1); + ieee80211_tx_complete(ni, m, (status & WPI_TX_STATUS_FAIL) != 0); WPI_TXQ_STATE_LOCK(sc); ring->queued -= 1; Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 22:47:06 2015 (r282377) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 22:49:47 2015 (r282378) @@ -256,6 +256,26 @@ struct wpi_tx_stat { uint8_t rate; uint32_t duration; uint32_t status; +#define WPI_TX_STATUS_SUCCESS 0x01 +#define WPI_TX_STATUS_DIRECT_DONE 0x02 +#define WPI_TX_STATUS_FAIL 0x80 +#define WPI_TX_STATUS_FAIL_SHORT_LIMIT 0x82 +#define WPI_TX_STATUS_FAIL_LONG_LIMIT 0x83 +#define WPI_TX_STATUS_FAIL_FIFO_UNDERRUN 0x84 +#define WPI_TX_STATUS_FAIL_MGMNT_ABORT 0x85 +#define WPI_TX_STATUS_FAIL_NEXT_FRAG 0x86 +#define WPI_TX_STATUS_FAIL_LIFE_EXPIRE 0x87 +#define WPI_TX_STATUS_FAIL_NODE_PS 0x88 +#define WPI_TX_STATUS_FAIL_ABORTED 0x89 +#define WPI_TX_STATUS_FAIL_BT_RETRY 0x8a +#define WPI_TX_STATUS_FAIL_NODE_INVALID 0x8b +#define WPI_TX_STATUS_FAIL_FRAG_DROPPED 0x8c +#define WPI_TX_STATUS_FAIL_TID_DISABLE 0x8d +#define WPI_TX_STATUS_FAIL_FRAME_FLUSHED 0x8e +#define WPI_TX_STATUS_FAIL_INSUFFICIENT_CF_POLL 0x8f +#define WPI_TX_STATUS_FAIL_TX_LOCKED 0x90 +#define WPI_TX_STATUS_FAIL_NO_BEACON_ON_RADAR 0x91 + } __packed; struct wpi_rx_desc { From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:51:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28F23C1; Sun, 3 May 2015 22:51:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B13E0160E; Sun, 3 May 2015 22:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43MpUOA071792; Sun, 3 May 2015 22:51:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MpUlE071791; Sun, 3 May 2015 22:51:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505032251.t43MpUlE071791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 May 2015 22:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282379 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 22:51:30 -0000 Author: imp Date: Sun May 3 22:51:29 2015 New Revision: 282379 URL: https://svnweb.freebsd.org/changeset/base/282379 Log: When merging the floating point type attribute, and reporting an error when things don't match, report which file has them and which one doesn't correctly. Differential Revision: https://reviews.freebsd.org/D2400 Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:49:47 2015 (r282378) +++ head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:51:29 2015 (r282379) @@ -6794,9 +6794,22 @@ elf32_arm_merge_eabi_attributes (bfd *ib out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i; else if (in_attr[Tag_ABI_FP_number_model].i != 0) { + bfd *hasbfd, *hasnotbfd; + + if (in_attr[Tag_ABI_VFP_args].i) + { + hasbfd = ibfd; + hasnotbfd = obfd; + } + else + { + hasbfd = obfd; + hasnotbfd = ibfd; + } + _bfd_error_handler (_("ERROR: %B uses VFP register arguments, %B does not"), - ibfd, obfd); + hasbfd, hasnotbfd); return FALSE; } } From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:51:43 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17DBB4FF; Sun, 3 May 2015 22:51: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 066681611; Sun, 3 May 2015 22:51: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 t43MpgTw071858; Sun, 3 May 2015 22:51:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MpgTl071857; Sun, 3 May 2015 22:51:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505032251.t43MpgTl071857@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 May 2015 22:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282380 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 03 May 2015 22:51:43 -0000 Author: imp Date: Sun May 3 22:51:42 2015 New Revision: 282380 URL: https://svnweb.freebsd.org/changeset/base/282380 Log: For eabi 5 (what FreeBSD uses), be sure to tag all executables and shared libraries as either SOFT or HARD float to comply with the EABI standard. Differential Revision: https://reviews.freebsd.org/D2401 Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:51:29 2015 (r282379) +++ head/contrib/binutils/bfd/elf32-arm.c Sun May 3 22:51:42 2015 (r282380) @@ -9372,6 +9372,16 @@ elf32_arm_post_process_headers (bfd * ab if (globals->byteswap_code) i_ehdrp->e_flags |= EF_ARM_BE8; } + + /* + * For EABI 5, we have to tag dynamic binaries and execs as either + * soft float or hard float. + */ + if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_VER5 && + (i_ehdrp->e_type == ET_DYN || i_ehdrp->e_type == ET_EXEC)) + i_ehdrp->e_flags |= + bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args) ? + EF_ARM_VFP_FLOAT : EF_ARM_SOFT_FLOAT; } static enum elf_reloc_type_class From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:55:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 453BA68F; Sun, 3 May 2015 22:55: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 33B8E163D; Sun, 3 May 2015 22:55: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 t43Mt7ll074314; Sun, 3 May 2015 22:55:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Mt7Jh074313; Sun, 3 May 2015 22:55:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032255.t43Mt7Jh074313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282381 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:55:07 -0000 Author: adrian Date: Sun May 3 22:55:06 2015 New Revision: 282381 URL: https://svnweb.freebsd.org/changeset/base/282381 Log: Turn off led when leaving RUN state. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:51:42 2015 (r282380) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:55:06 2015 (r282381) @@ -1672,13 +1672,15 @@ wpi_newstate(struct ieee80211vap *vap, e ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); - if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + if (vap->iv_state == IEEE80211_S_RUN && nstate < IEEE80211_S_RUN) { if ((error = wpi_set_pslevel(sc, 0, 0, 1)) != 0) { device_printf(sc->sc_dev, "%s: could not set power saving level\n", __func__); return error; } + + wpi_set_led(sc, WPI_LED_LINK, 1, 0); } switch (nstate) { From owner-svn-src-all@FreeBSD.ORG Sun May 3 22:56:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92D89892; Sun, 3 May 2015 22:56: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 812A8165B; Sun, 3 May 2015 22:56: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 t43Mubdd074570; Sun, 3 May 2015 22:56:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43MubkL074567; Sun, 3 May 2015 22:56:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032256.t43MubkL074567@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 22:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282382 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 22:56:37 -0000 Author: adrian Date: Sun May 3 22:56:36 2015 New Revision: 282382 URL: https://svnweb.freebsd.org/changeset/base/282382 Log: Fix active/passive dwell calculation. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:55:06 2015 (r282381) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 22:56:36 2015 (r282382) @@ -3818,7 +3818,7 @@ wpi_get_active_dwell_time(struct wpi_sof } /* - * Limit the total dwell time to 85% of the beacon interval. + * Limit the total dwell time. * * Returns the dwell time in milliseconds. */ @@ -3843,11 +3843,11 @@ wpi_limit_dwell(struct wpi_softc *sc, ui if (bintval > 0) { DPRINTF(sc, WPI_DEBUG_SCAN, "%s: bintval=%d\n", __func__, bintval); - return (MIN(WPI_PASSIVE_DWELL_BASE, ((bintval * 85) / 100))); + return (MIN(dwell_time, bintval - WPI_CHANNEL_TUNE_TIME * 2)); } /* No association context? Default. */ - return (WPI_PASSIVE_DWELL_BASE); + return dwell_time; } static uint16_t @@ -3882,7 +3882,7 @@ wpi_scan(struct wpi_softc *sc, struct ie struct ieee80211_rateset *rs; uint16_t dwell_active, dwell_passive; uint8_t *buf, *frm; - int buflen, error, i, nssid; + int bgscan, bintval, buflen, error, i, nssid; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3893,10 +3893,16 @@ wpi_scan(struct wpi_softc *sc, struct ie if (callout_pending(&sc->scan_timeout)) { device_printf(sc->sc_dev, "%s: called whilst scanning!\n", __func__); + error = EAGAIN; + goto fail; + } - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END_ERR, __func__); - - return (EAGAIN); + bgscan = wpi_check_bss_filter(sc); + bintval = vap->iv_bss->ni_intval; + if (bgscan != 0 && + bintval < WPI_QUIET_TIME_DEFAULT + WPI_CHANNEL_TUNE_TIME * 2) { + error = EOPNOTSUPP; + goto fail; } buf = malloc(WPI_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -3913,8 +3919,8 @@ wpi_scan(struct wpi_softc *sc, struct ie * Move to the next channel if no packets are received within 10 msecs * after sending the probe request. */ - hdr->quiet_time = htole16(10); /* timeout in milliseconds */ - hdr->quiet_threshold = htole16(1); /* min # of packets */ + hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT); + hdr->quiet_threshold = htole16(1); /* * Max needs to be greater than active and passive and quiet! * It's also in microseconds! @@ -4003,8 +4009,8 @@ wpi_scan(struct wpi_softc *sc, struct ie dwell_passive = wpi_get_passive_dwell_time(sc, c); /* Make sure they're valid. */ - if (dwell_passive <= dwell_active) - dwell_passive = dwell_active + 1; + if (dwell_active > dwell_passive) + dwell_active = dwell_passive; chan->active = htole16(dwell_active); chan->passive = htole16(dwell_passive); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 22:55:06 2015 (r282381) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 22:56:36 2015 (r282382) @@ -611,8 +611,10 @@ struct wpi_scan_hdr { uint16_t len; uint8_t reserved1; uint8_t nchan; - uint16_t quiet_time; - uint16_t quiet_threshold; + uint16_t quiet_time; /* timeout in milliseconds */ +#define WPI_QUIET_TIME_DEFAULT 10 + + uint16_t quiet_threshold; /* min # of packets */ uint16_t crc_threshold; uint16_t reserved2; uint32_t max_svc; /* background scans */ @@ -652,6 +654,7 @@ struct wpi_scan_chan { #define WPI_PASSIVE_DWELL_TIME_2GHZ ( 20) #define WPI_PASSIVE_DWELL_TIME_5GHZ ( 10) #define WPI_PASSIVE_DWELL_BASE (100) +#define WPI_CHANNEL_TUNE_TIME ( 6) /* Structure for command WPI_CMD_TXPOWER. */ struct wpi_cmd_txpower { From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:03:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53DDDA8A; Sun, 3 May 2015 23:03: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 286831730; Sun, 3 May 2015 23:03: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 t43N377i079135; Sun, 3 May 2015 23:03:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N36rW079133; Sun, 3 May 2015 23:03:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032303.t43N36rW079133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282383 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:03:07 -0000 Author: adrian Date: Sun May 3 23:03:06 2015 New Revision: 282383 URL: https://svnweb.freebsd.org/changeset/base/282383 Log: Fix pause scan time calculation (the remainder must be less than beacon interval). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 22:56:36 2015 (r282382) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:03:06 2015 (r282383) @@ -228,6 +228,7 @@ static uint16_t wpi_get_active_dwell_tim static uint16_t wpi_limit_dwell(struct wpi_softc *, uint16_t); static uint16_t wpi_get_passive_dwell_time(struct wpi_softc *, struct ieee80211_channel *); +static uint32_t wpi_get_scan_pause_time(uint32_t, uint16_t); static int wpi_scan(struct wpi_softc *, struct ieee80211_channel *); static int wpi_auth(struct wpi_softc *, struct ieee80211vap *); static int wpi_config_beacon(struct wpi_vap *); @@ -3864,6 +3865,18 @@ wpi_get_passive_dwell_time(struct wpi_so return (wpi_limit_dwell(sc, passive)); } +static uint32_t +wpi_get_scan_pause_time(uint32_t time, uint16_t bintval) +{ + uint32_t mod = (time % bintval) * IEEE80211_DUR_TU; + uint32_t nbeacons = time / bintval; + + if (mod > WPI_PAUSE_MAX_TIME) + mod = WPI_PAUSE_MAX_TIME; + + return WPI_PAUSE_SCAN(nbeacons, mod); +} + /* * Send a scan request to the firmware. */ @@ -3921,13 +3934,17 @@ wpi_scan(struct wpi_softc *sc, struct ie */ hdr->quiet_time = htole16(WPI_QUIET_TIME_DEFAULT); hdr->quiet_threshold = htole16(1); - /* - * Max needs to be greater than active and passive and quiet! - * It's also in microseconds! - */ - hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); - hdr->pause_svc = htole32((4 << 24) | - (100 * IEEE80211_DUR_TU)); /* Hardcode for now */ + + if (bgscan != 0) { + /* + * Max needs to be greater than active and passive and quiet! + * It's also in microseconds! + */ + hdr->max_svc = htole32(250 * IEEE80211_DUR_TU); + hdr->pause_svc = htole32(wpi_get_scan_pause_time(100, + bintval)); + } + hdr->filter = htole32(WPI_FILTER_MULTICAST | WPI_FILTER_BEACON); tx = (struct wpi_cmd_data *)(hdr + 1); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 22:56:36 2015 (r282382) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 23:03:06 2015 (r282383) @@ -619,6 +619,9 @@ struct wpi_scan_hdr { uint16_t reserved2; uint32_t max_svc; /* background scans */ uint32_t pause_svc; /* background scans */ +#define WPI_PAUSE_MAX_TIME ((1 << 20) - 1) +#define WPI_PAUSE_SCAN(nbeacons, time) ((nbeacons << 24) | time) + uint32_t flags; uint32_t filter; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:06:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 569E9C5B; Sun, 3 May 2015 23:06: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 44CE4174D; Sun, 3 May 2015 23:06: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 t43N6KBQ079633; Sun, 3 May 2015 23:06:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N6K1Z079632; Sun, 3 May 2015 23:06:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032306.t43N6K1Z079632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282384 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:06:20 -0000 Author: adrian Date: Sun May 3 23:06:19 2015 New Revision: 282384 URL: https://svnweb.freebsd.org/changeset/base/282384 Log: Do not disable beacon notifications (unbreaks scanning on passive channels). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:03:06 2015 (r282383) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:06:19 2015 (r282384) @@ -3716,7 +3716,6 @@ wpi_config(struct wpi_softc *sc) struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_channel *c = ic->ic_curchan; - uint32_t flags; int error; DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -3789,15 +3788,6 @@ wpi_config(struct wpi_softc *sc) return error; } - /* Disable beacon notifications (unused). */ - flags = WPI_STATISTICS_BEACON_DISABLE; - error = wpi_cmd(sc, WPI_CMD_GET_STATISTICS, &flags, sizeof flags, 1); - if (error != 0) { - device_printf(sc->sc_dev, - "could not disable beacon statistics, error %d\n", error); - return error; - } - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); return 0; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:08:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6F4FE07; Sun, 3 May 2015 23:08: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 B553F1763; Sun, 3 May 2015 23:08: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 t43N8QTD079959; Sun, 3 May 2015 23:08:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N8Qiv079958; Sun, 3 May 2015 23:08:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032308.t43N8Qiv079958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282385 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:08:26 -0000 Author: adrian Date: Sun May 3 23:08:25 2015 New Revision: 282385 URL: https://svnweb.freebsd.org/changeset/base/282385 Log: Check channels which are passed in IBSS mode. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:06:19 2015 (r282384) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:08:25 2015 (r282385) @@ -3775,6 +3775,14 @@ wpi_config(struct wpi_softc *sc) sc->rxon.cck_mask = 0x0f; /* not yet negotiated */ sc->rxon.ofdm_mask = 0xff; /* not yet negotiated */ + /* XXX Current configuration may be unusable. */ + if (IEEE80211_IS_CHAN_NOADHOC(c) && sc->rxon.mode == WPI_MODE_IBSS) { + device_printf(sc->sc_dev, + "%s: invalid channel (%d) selected for IBSS mode\n", + __func__, ieee80211_chan2ieee(ic, c)); + return EINVAL; + } + if ((error = wpi_send_rxon(sc, 0, 0)) != 0) { device_printf(sc->sc_dev, "%s: could not send RXON\n", __func__); From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:09:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 185E2F6D; Sun, 3 May 2015 23:09: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 075AC176F; Sun, 3 May 2015 23:09: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 t43N9lgk080188; Sun, 3 May 2015 23:09:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43N9leE080187; Sun, 3 May 2015 23:09:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032309.t43N9leE080187@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282386 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:09:48 -0000 Author: adrian Date: Sun May 3 23:09:47 2015 New Revision: 282386 URL: https://svnweb.freebsd.org/changeset/base/282386 Log: Unbreak scanning after RUN -> SCAN state transition. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:08:25 2015 (r282385) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:09:47 2015 (r282386) @@ -1687,8 +1687,7 @@ wpi_newstate(struct ieee80211vap *vap, e switch (nstate) { case IEEE80211_S_SCAN: WPI_RXON_LOCK(sc); - if (wpi_check_bss_filter(sc) != 0 && - vap->iv_opmode != IEEE80211_M_STA) { + if (wpi_check_bss_filter(sc) != 0) { sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { device_printf(sc->sc_dev, From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:18:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E09CA212; Sun, 3 May 2015 23:18: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 CEEEB1869; Sun, 3 May 2015 23:18: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 t43NITqf084991; Sun, 3 May 2015 23:18:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NITpY084987; Sun, 3 May 2015 23:18:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032318.t43NITpY084987@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282387 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:18:30 -0000 Author: adrian Date: Sun May 3 23:18:28 2015 New Revision: 282387 URL: https://svnweb.freebsd.org/changeset/base/282387 Log: Create another debug category for WPI_BEACON_MISSED notification. Differential Revision: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:09:47 2015 (r282386) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:18:28 2015 (r282387) @@ -2121,7 +2121,7 @@ wpi_notif_intr(struct wpi_softc *sc) BUS_DMASYNC_POSTREAD); misses = le32toh(miss->consecutive); - DPRINTF(sc, WPI_DEBUG_STATE, + DPRINTF(sc, WPI_DEBUG_BMISS, "%s: beacons missed %d/%d\n", __func__, misses, le32toh(miss->total)); Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:09:47 2015 (r282386) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:18:28 2015 (r282387) @@ -43,6 +43,7 @@ enum { WPI_DEBUG_KEY = 0x00020000, /* node key management */ WPI_DEBUG_EDCA = 0x00040000, /* WME info */ WPI_DEBUG_REGISTER = 0x00080000, /* print chipset register */ + WPI_DEBUG_BMISS = 0x00100000, /* print number of missed beacons */ WPI_DEBUG_ANY = 0xffffffff }; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:21:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EA66366; Sun, 3 May 2015 23:21: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 8D1B91915; Sun, 3 May 2015 23:21:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43NLHTP087082; Sun, 3 May 2015 23:21:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NLHeC087081; Sun, 3 May 2015 23:21:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032321.t43NLHeC087081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282388 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:21:17 -0000 Author: adrian Date: Sun May 3 23:21:16 2015 New Revision: 282388 URL: https://svnweb.freebsd.org/changeset/base/282388 Log: Improve beacon miss detection. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:18:28 2015 (r282387) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:21:16 2015 (r282388) @@ -2115,11 +2115,14 @@ wpi_notif_intr(struct wpi_softc *sc) { struct wpi_beacon_missed *miss = (struct wpi_beacon_missed *)(desc + 1); - uint32_t misses; + uint32_t expected, misses, received; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); + misses = le32toh(miss->consecutive); + expected = le32toh(miss->expected); + received = le32toh(miss->received); DPRINTF(sc, WPI_DEBUG_BMISS, "%s: beacons missed %d/%d\n", __func__, misses, @@ -2127,7 +2130,9 @@ wpi_notif_intr(struct wpi_softc *sc) if (vap->iv_state == IEEE80211_S_RUN && (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - misses >= vap->iv_bmissthreshold) + (misses >= vap->iv_bmissthreshold || + (received == 0 && + expected >= vap->iv_bmissthreshold))) ieee80211_beacon_miss(ic); break; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:24:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A3FB4E2; Sun, 3 May 2015 23:24: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 188E4192C; Sun, 3 May 2015 23:24: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 t43NOKLI089441; Sun, 3 May 2015 23:24:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NOKHt089440; Sun, 3 May 2015 23:24:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032324.t43NOKHt089440@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282389 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:24:21 -0000 Author: adrian Date: Sun May 3 23:24:20 2015 New Revision: 282389 URL: https://svnweb.freebsd.org/changeset/base/282389 Log: Limit minimum threshold of missed beacons. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:21:16 2015 (r282388) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:24:20 2015 (r282389) @@ -2115,7 +2115,7 @@ wpi_notif_intr(struct wpi_softc *sc) { struct wpi_beacon_missed *miss = (struct wpi_beacon_missed *)(desc + 1); - uint32_t expected, misses, received; + uint32_t expected, misses, received, threshold; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); @@ -2123,6 +2123,7 @@ wpi_notif_intr(struct wpi_softc *sc) misses = le32toh(miss->consecutive); expected = le32toh(miss->expected); received = le32toh(miss->received); + threshold = MAX(2, vap->iv_bmissthreshold); DPRINTF(sc, WPI_DEBUG_BMISS, "%s: beacons missed %d/%d\n", __func__, misses, @@ -2130,9 +2131,8 @@ wpi_notif_intr(struct wpi_softc *sc) if (vap->iv_state == IEEE80211_S_RUN && (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - (misses >= vap->iv_bmissthreshold || - (received == 0 && - expected >= vap->iv_bmissthreshold))) + (misses >= threshold || + (received == 0 && expected >= threshold))) ieee80211_beacon_miss(ic); break; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:25:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8954E645; Sun, 3 May 2015 23:25: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 780131936; Sun, 3 May 2015 23:25: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 t43NPY1T089677; Sun, 3 May 2015 23:25:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NPYmd089676; Sun, 3 May 2015 23:25:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032325.t43NPYmd089676@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282390 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:25:34 -0000 Author: adrian Date: Sun May 3 23:25:33 2015 New Revision: 282390 URL: https://svnweb.freebsd.org/changeset/base/282390 Log: Display more information for beacon miss debugging. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:24:20 2015 (r282389) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:25:33 2015 (r282390) @@ -2126,8 +2126,9 @@ wpi_notif_intr(struct wpi_softc *sc) threshold = MAX(2, vap->iv_bmissthreshold); DPRINTF(sc, WPI_DEBUG_BMISS, - "%s: beacons missed %d/%d\n", __func__, misses, - le32toh(miss->total)); + "%s: beacons missed %u(%u) (received %u/%u)\n", + __func__, misses, le32toh(miss->total), received, + expected); if (vap->iv_state == IEEE80211_S_RUN && (ic->ic_flags & IEEE80211_F_SCAN) == 0 && From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:27:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C2D47B7; Sun, 3 May 2015 23:27: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 604C61949; Sun, 3 May 2015 23:27: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 t43NRbl4090003; Sun, 3 May 2015 23:27:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NRbq7090002; Sun, 3 May 2015 23:27:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032327.t43NRbq7090002@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282391 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:27:37 -0000 Author: adrian Date: Sun May 3 23:27:36 2015 New Revision: 282391 URL: https://svnweb.freebsd.org/changeset/base/282391 Log: Add comment about AUTH -> AUTH state transition + fix some style issues. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:25:33 2015 (r282390) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:27:36 2015 (r282391) @@ -1703,6 +1703,11 @@ wpi_newstate(struct ieee80211vap *vap, e /* FALLTHROUGH */ case IEEE80211_S_AUTH: /* + * NB: do not optimize AUTH -> AUTH state transmission - + * this will break powersave with non-QoS AP! + */ + + /* * The node must be registered in the firmware before auth. * Also the associd must be cleared on RUN -> ASSOC * transitions. @@ -2609,7 +2614,7 @@ wpi_tx_data(struct wpi_softc *sc, struct /* Select EDCA Access Category and TX ring for this frame. */ if (IEEE80211_QOS_HAS_SEQ(wh)) { - qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; + qos = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; tid = qos & IEEE80211_QOS_TID; } else { qos = 0; @@ -3764,7 +3769,6 @@ wpi_config(struct wpi_softc *sc) sc->rxon.filter |= WPI_FILTER_ASSOC | WPI_FILTER_PROMISC; break; case IEEE80211_M_AHDEMO: - /* XXX workaround for passive channels selection */ sc->rxon.mode = WPI_MODE_HOSTAP; break; case IEEE80211_M_MONITOR: @@ -4664,7 +4668,7 @@ wpi_post_alive(struct wpi_softc *sc) /* NB: Runtime firmware must be up and running. */ if (!(wpi_prph_read(sc, WPI_APMG_RFKILL) & 1)) { - device_printf(sc->sc_dev, + device_printf(sc->sc_dev, "RF switch: radio disabled (%s)\n", __func__); wpi_nic_unlock(sc); return EPERM; /* :-) */ @@ -4988,7 +4992,7 @@ wpi_apm_stop_master(struct wpi_softc *sc /* Stop busmaster DMA activity. */ WPI_SETBITS(sc, WPI_RESET, WPI_RESET_STOP_MASTER); - + if ((WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_PS_MASK) == WPI_GP_CNTRL_MAC_PS) return; /* Already asleep. */ From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:28:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CC2B920; Sun, 3 May 2015 23:28:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F72A1956; Sun, 3 May 2015 23:28:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t43NStMX090229; Sun, 3 May 2015 23:28:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NSsiF090226; Sun, 3 May 2015 23:28:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032328.t43NSsiF090226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282392 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:28:55 -0000 Author: adrian Date: Sun May 3 23:28:54 2015 New Revision: 282392 URL: https://svnweb.freebsd.org/changeset/base/282392 Log: Try to fix passive scanning hang on beacon miss. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:27:36 2015 (r282391) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:28:54 2015 (r282392) @@ -2135,11 +2135,18 @@ wpi_notif_intr(struct wpi_softc *sc) __func__, misses, le32toh(miss->total), received, expected); - if (vap->iv_state == IEEE80211_S_RUN && - (ic->ic_flags & IEEE80211_F_SCAN) == 0 && - (misses >= threshold || - (received == 0 && expected >= threshold))) - ieee80211_beacon_miss(ic); + if (misses >= threshold || + (received == 0 && expected >= threshold)) { + WPI_RXON_LOCK(sc); + if (callout_pending(&sc->scan_timeout)) { + wpi_cmd(sc, WPI_CMD_SCAN_ABORT, NULL, + 0, 1); + } + WPI_RXON_UNLOCK(sc); + if (vap->iv_state == IEEE80211_S_RUN && + (ic->ic_flags & IEEE80211_F_SCAN) == 0) + ieee80211_beacon_miss(ic); + } break; } @@ -2202,17 +2209,21 @@ wpi_notif_intr(struct wpi_softc *sc) { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef WPI_DEBUG + struct wpi_stop_scan *scan = (struct wpi_stop_scan *)(desc + 1); + DPRINTF(sc, WPI_DEBUG_SCAN, "scan finished nchan=%d status=%d chan=%d\n", scan->nchan, scan->status, scan->chan); -#endif + WPI_RXON_LOCK(sc); callout_stop(&sc->scan_timeout); WPI_RXON_UNLOCK(sc); - ieee80211_scan_next(vap); + if (scan->status == WPI_SCAN_ABORTED) + ieee80211_cancel_scan(vap); + else + ieee80211_scan_next(vap); break; } } Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:27:36 2015 (r282391) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:28:54 2015 (r282392) @@ -86,6 +86,7 @@ static const char *wpi_cmd_str(int cmd) WPI_DESC(WPI_CMD_SET_LED); WPI_DESC(WPI_CMD_SET_POWER_MODE); WPI_DESC(WPI_CMD_SCAN); + WPI_DESC(WPI_CMD_SCAN_ABORT); WPI_DESC(WPI_CMD_SET_BEACON); WPI_DESC(WPI_CMD_TXPOWER); WPI_DESC(WPI_CMD_BT_COEX); Modified: head/sys/dev/wpi/if_wpireg.h ============================================================================== --- head/sys/dev/wpi/if_wpireg.h Sun May 3 23:27:36 2015 (r282391) +++ head/sys/dev/wpi/if_wpireg.h Sun May 3 23:28:54 2015 (r282392) @@ -352,6 +352,7 @@ struct wpi_tx_cmd { #define WPI_CMD_SET_LED 72 #define WPI_CMD_SET_POWER_MODE 119 #define WPI_CMD_SCAN 128 +#define WPI_CMD_SCAN_ABORT 129 #define WPI_CMD_SET_BEACON 145 #define WPI_CMD_TXPOWER 151 #define WPI_CMD_BT_COEX 155 @@ -725,6 +726,9 @@ struct wpi_start_scan { struct wpi_stop_scan { uint8_t nchan; uint8_t status; +#define WPI_SCAN_COMPLETED 1 +#define WPI_SCAN_ABORTED 2 + uint8_t reserved; uint8_t chan; uint64_t tsf; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:30:05 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD3F9B0B; Sun, 3 May 2015 23:30: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 BBCAA1975; Sun, 3 May 2015 23:30: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 t43NU5an090620; Sun, 3 May 2015 23:30:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NU5o4090619; Sun, 3 May 2015 23:30:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032330.t43NU5o4090619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282393 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:30:05 -0000 Author: adrian Date: Sun May 3 23:30:04 2015 New Revision: 282393 URL: https://svnweb.freebsd.org/changeset/base/282393 Log: Add debug output for WPI_BEACON_SENT event. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:28:54 2015 (r282392) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:30:04 2015 (r282393) @@ -2150,6 +2150,27 @@ wpi_notif_intr(struct wpi_softc *sc) break; } +#ifdef WPI_DEBUG + case WPI_BEACON_SENT: + { + struct wpi_tx_stat *stat = + (struct wpi_tx_stat *)(desc + 1); + uint64_t *tsf = (uint64_t *)(stat + 1); + uint32_t *mode = (uint32_t *)(tsf + 1); + + bus_dmamap_sync(sc->rxq.data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + + DPRINTF(sc, WPI_DEBUG_BEACON, + "beacon sent: rts %u, ack %u, btkill %u, rate %u, " + "duration %u, status %x, tsf %ju, mode %x\n", + stat->rtsfailcnt, stat->ackfailcnt, + stat->btkillcnt, stat->rate, le32toh(stat->duration), + le32toh(stat->status), *tsf, *mode); + + break; + } +#endif case WPI_UC_READY: { struct wpi_ucode_info *uc = From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:34:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2E5ECE4; Sun, 3 May 2015 23:34: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 A14C71A34; Sun, 3 May 2015 23:34: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 t43NYPWg094793; Sun, 3 May 2015 23:34:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NYPVp094792; Sun, 3 May 2015 23:34:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032334.t43NYPVp094792@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282394 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:34:25 -0000 Author: adrian Date: Sun May 3 23:34:24 2015 New Revision: 282394 URL: https://svnweb.freebsd.org/changeset/base/282394 Log: Fix sequence number generation for beacon frames. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:30:04 2015 (r282393) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:34:24 2015 (r282394) @@ -609,7 +609,12 @@ wpi_init_beacon(struct wpi_vap *wvp) cmd->ofdm_mask = 0xff; cmd->cck_mask = 0x0f; cmd->lifetime = htole32(WPI_LIFETIME_INFINITE); - cmd->flags = htole32(WPI_TX_AUTO_SEQ | WPI_TX_INSERT_TSTAMP); + + /* + * XXX WPI_TX_AUTO_SEQ seems to be ignored - workaround this issue + * XXX by using WPI_TX_NEED_ACK instead (with some side effects). + */ + cmd->flags = htole32(WPI_TX_NEED_ACK | WPI_TX_INSERT_TSTAMP); bcn->code = WPI_CMD_SET_BEACON; bcn->ac = WPI_CMD_QUEUE_NUM; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:35:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98BA8E43; Sun, 3 May 2015 23: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 871211A3C; Sun, 3 May 2015 23: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 t43NZCTT094994; Sun, 3 May 2015 23:35:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NZCe9094993; Sun, 3 May 2015 23:35:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032335.t43NZCe9094993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282395 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:35:12 -0000 Author: adrian Date: Sun May 3 23:35:11 2015 New Revision: 282395 URL: https://svnweb.freebsd.org/changeset/base/282395 Log: Do not include WPI_START_SCAN event processing into non-debug builds. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:34:24 2015 (r282394) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:11 2015 (r282395) @@ -2218,19 +2218,21 @@ wpi_notif_intr(struct wpi_softc *sc) } break; } +#ifdef WPI_DEBUG case WPI_START_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef WPI_DEBUG + struct wpi_start_scan *scan = (struct wpi_start_scan *)(desc + 1); DPRINTF(sc, WPI_DEBUG_SCAN, "%s: scanning channel %d status %x\n", __func__, scan->chan, le32toh(scan->status)); -#endif + break; } +#endif case WPI_STOP_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:35:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55E29F86; Sun, 3 May 2015 23:35: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 2A2911A41; Sun, 3 May 2015 23:35: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 t43NZjGu095130; Sun, 3 May 2015 23:35:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NZjUS095129; Sun, 3 May 2015 23:35:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032335.t43NZjUS095129@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282396 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:35:45 -0000 Author: adrian Date: Sun May 3 23:35:44 2015 New Revision: 282396 URL: https://svnweb.freebsd.org/changeset/base/282396 Log: Use nitems() for counting elements in arrays. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:11 2015 (r282395) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:44 2015 (r282396) @@ -2301,7 +2301,6 @@ wpi_wakeup_intr(struct wpi_softc *sc) static void wpi_debug_registers(struct wpi_softc *sc) { -#define COUNTOF(array) (sizeof(array) / sizeof(array[0])) int i; static const uint32_t csr_tbl[] = { WPI_HW_IF_CONFIG, @@ -2329,7 +2328,7 @@ wpi_debug_registers(struct wpi_softc *sc DPRINTF(sc, WPI_DEBUG_REGISTER,"%s","\n"); - for (i = 0; i < COUNTOF(csr_tbl); i++) { + for (i = 0; i < nitems(csr_tbl); i++) { DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", wpi_get_csr_string(csr_tbl[i]), WPI_READ(sc, csr_tbl[i])); @@ -2339,7 +2338,7 @@ wpi_debug_registers(struct wpi_softc *sc DPRINTF(sc, WPI_DEBUG_REGISTER, "\n\n"); if (wpi_nic_lock(sc) == 0) { - for (i = 0; i < COUNTOF(prph_tbl); i++) { + for (i = 0; i < nitems(prph_tbl); i++) { DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", wpi_get_prph_string(prph_tbl[i]), wpi_prph_read(sc, prph_tbl[i])); @@ -2353,7 +2352,6 @@ wpi_debug_registers(struct wpi_softc *sc DPRINTF(sc, WPI_DEBUG_REGISTER, "Cannot access internal registers.\n"); } -#undef COUNTOF } #endif @@ -2367,8 +2365,6 @@ wpi_fatal_intr(struct wpi_softc *sc) { struct wpi_fw_dump dump; uint32_t i, offset, count; - const uint32_t size_errmsg = - (sizeof (wpi_fw_errmsg) / sizeof ((wpi_fw_errmsg)[0])); /* Check that the error log address is valid. */ if (sc->errptr < WPI_FW_DATA_BASE || @@ -2398,7 +2394,7 @@ wpi_fatal_intr(struct wpi_softc *sc) sizeof (dump) / sizeof (uint32_t)); printf(" error type = \"%s\" (0x%08X)\n", - (dump.desc < size_errmsg) ? + (dump.desc < nitems(wpi_fw_errmsg)) ? wpi_fw_errmsg[dump.desc] : "UNKNOWN", dump.desc); printf(" error data = 0x%08X\n", From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:36:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C90317F; Sun, 3 May 2015 23:36: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 1AD571A53; Sun, 3 May 2015 23:36: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 t43NaPE3095315; Sun, 3 May 2015 23:36:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NaPLu095314; Sun, 3 May 2015 23:36:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032336.t43NaPLu095314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282397 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:36:26 -0000 Author: adrian Date: Sun May 3 23:36:25 2015 New Revision: 282397 URL: https://svnweb.freebsd.org/changeset/base/282397 Log: [iwn?] Fix memory leak in wpi_reset_tx_ring(). PR: kern/197143 Differential Revision: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:35:44 2015 (r282396) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:36:25 2015 (r282397) @@ -1279,6 +1279,10 @@ wpi_reset_tx_ring(struct wpi_softc *sc, m_freem(data->m); data->m = NULL; } + if (data->ni != NULL) { + ieee80211_free_node(data->ni); + data->ni = NULL; + } } /* Clear TX descriptors. */ memset(ring->desc, 0, ring->desc_dma.size); From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:37:14 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD8062DF; Sun, 3 May 2015 23:37: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 9EB941A5F; Sun, 3 May 2015 23:37: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 t43NbEnl095490; Sun, 3 May 2015 23:37:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NbE60095487; Sun, 3 May 2015 23:37:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032337.t43NbE60095487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282398 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:37:14 -0000 Author: adrian Date: Sun May 3 23:37:13 2015 New Revision: 282398 URL: https://svnweb.freebsd.org/changeset/base/282398 Log: Fix warning about comparison of integers of different signs. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpi_debug.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:36:25 2015 (r282397) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:37:13 2015 (r282398) @@ -2080,7 +2080,7 @@ wpi_notif_intr(struct wpi_softc *sc) bus_dmamap_sync(sc->shared_dma.tag, sc->shared_dma.map, BUS_DMASYNC_POSTREAD); - hw = le32toh(sc->shared->next); + hw = le32toh(sc->shared->next) & 0xfff; hw = (hw == 0) ? WPI_RX_RING_COUNT - 1 : hw - 1; while (sc->rxq.cur != hw) { @@ -2305,7 +2305,7 @@ wpi_wakeup_intr(struct wpi_softc *sc) static void wpi_debug_registers(struct wpi_softc *sc) { - int i; + size_t i; static const uint32_t csr_tbl[] = { WPI_HW_IF_CONFIG, WPI_INT, Modified: head/sys/dev/wpi/if_wpi_debug.h ============================================================================== --- head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:36:25 2015 (r282397) +++ head/sys/dev/wpi/if_wpi_debug.h Sun May 3 23:37:13 2015 (r282398) @@ -99,7 +99,7 @@ static const char *wpi_cmd_str(int cmd) /* * Translate CSR code to string */ -static const char *wpi_get_csr_string(int csr) +static const char *wpi_get_csr_string(size_t csr) { switch (csr) { WPI_DESC(WPI_HW_IF_CONFIG); @@ -123,7 +123,7 @@ static const char *wpi_get_csr_string(in } } -static const char *wpi_get_prph_string(int prph) +static const char *wpi_get_prph_string(size_t prph) { switch (prph) { WPI_DESC(WPI_APMG_CLK_CTRL); From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:38:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23DB4453; Sun, 3 May 2015 23:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 124181A6D; Sun, 3 May 2015 23:38: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 t43NcWFc095726; Sun, 3 May 2015 23:38:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NcWNC095725; Sun, 3 May 2015 23:38:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032338.t43NcWNC095725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282399 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:38:33 -0000 Author: adrian Date: Sun May 3 23:38:32 2015 New Revision: 282399 URL: https://svnweb.freebsd.org/changeset/base/282399 Log: [iwn?] Use correct sequence numbers with non-QoS STAs. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:37:13 2015 (r282398) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:38:32 2015 (r282399) @@ -2714,6 +2714,8 @@ wpi_tx_data(struct wpi_softc *sc, struct flags |= WPI_TX_NEED_ACK; } + if (!IEEE80211_QOS_HAS_SEQ(wh)) + flags |= WPI_TX_AUTO_SEQ; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) flags |= WPI_TX_MORE_FRAG; /* Cannot happen yet. */ @@ -2818,6 +2820,8 @@ wpi_tx_data_raw(struct wpi_softc *sc, st rate = params->ibp_rate0; flags = 0; + if (!IEEE80211_QOS_HAS_SEQ(wh)) + flags |= WPI_TX_AUTO_SEQ; if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0) flags |= WPI_TX_NEED_ACK; if (params->ibp_flags & IEEE80211_BPF_RTS) From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:39:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F9E7598; Sun, 3 May 2015 23:39: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 2D8AA1A75; Sun, 3 May 2015 23:39: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 t43Nd3pV095865; Sun, 3 May 2015 23:39:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43Nd2G6095862; Sun, 3 May 2015 23:39:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032339.t43Nd2G6095862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282400 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:39:03 -0000 Author: adrian Date: Sun May 3 23:39:02 2015 New Revision: 282400 URL: https://svnweb.freebsd.org/changeset/base/282400 Log: Fix various powersave races + optimize tx/rx pointer update when powersave is off. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:38:32 2015 (r282399) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:02 2015 (r282400) @@ -152,11 +152,14 @@ static int wpi_alloc_fwmem(struct wpi_so static void wpi_free_fwmem(struct wpi_softc *); static int wpi_alloc_rx_ring(struct wpi_softc *); static void wpi_update_rx_ring(struct wpi_softc *); +static void wpi_update_rx_ring_ps(struct wpi_softc *); static void wpi_reset_rx_ring(struct wpi_softc *); static void wpi_free_rx_ring(struct wpi_softc *); static int wpi_alloc_tx_ring(struct wpi_softc *, struct wpi_tx_ring *, int); static void wpi_update_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); +static void wpi_update_tx_ring_ps(struct wpi_softc *, + struct wpi_tx_ring *); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static int wpi_read_eeprom(struct wpi_softc *, @@ -521,6 +524,9 @@ wpi_attach(device_t dev) ic->ic_scan_mindwell = wpi_scan_mindwell; ic->ic_setregdomain = wpi_setregdomain; + sc->sc_update_rx_ring = wpi_update_rx_ring; + sc->sc_update_tx_ring = wpi_update_tx_ring; + wpi_radiotap_attach(sc); callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); @@ -1089,6 +1095,12 @@ fail: wpi_free_rx_ring(sc); static void wpi_update_rx_ring(struct wpi_softc *sc) { + WPI_WRITE(sc, WPI_FH_RX_WPTR, sc->rxq.cur & ~7); +} + +static void +wpi_update_rx_ring_ps(struct wpi_softc *sc) +{ struct wpi_rx_ring *ring = &sc->rxq; if (ring->update != 0) { @@ -1096,14 +1108,15 @@ wpi_update_rx_ring(struct wpi_softc *sc) return; } - if (WPI_READ(sc, WPI_UCODE_GP1) & WPI_UCODE_GP1_MAC_SLEEP) { + WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s: wakeup request\n", __func__); - - WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); ring->update = 1; - } else - WPI_WRITE(sc, WPI_FH_RX_WPTR, ring->cur & ~7); + } else { + wpi_update_rx_ring(sc); + WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + } } static void @@ -1247,19 +1260,27 @@ fail: wpi_free_tx_ring(sc, ring); static void wpi_update_tx_ring(struct wpi_softc *sc, struct wpi_tx_ring *ring) { + WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); +} + +static void +wpi_update_tx_ring_ps(struct wpi_softc *sc, struct wpi_tx_ring *ring) +{ + if (ring->update != 0) { /* Wait for INT_WAKEUP event. */ return; } - if (WPI_READ(sc, WPI_UCODE_GP1) & WPI_UCODE_GP1_MAC_SLEEP) { + WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + if (WPI_READ(sc, WPI_GP_CNTRL) & WPI_GP_CNTRL_SLEEP) { DPRINTF(sc, WPI_DEBUG_PWRSAVE, "%s (%d): requesting wakeup\n", __func__, ring->qid); - - WPI_SETBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); ring->update = 1; - } else - WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); + } else { + wpi_update_tx_ring(sc, ring); + WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + } } static void @@ -2067,6 +2088,18 @@ wpi_cmd_done(struct wpi_softc *sc, struc } wakeup(&ring->cmd[desc->idx]); + + if (desc->type == WPI_CMD_SET_POWER_MODE) { + WPI_TXQ_LOCK(sc); + if (sc->sc_flags & WPI_PS_PATH) { + sc->sc_update_rx_ring = wpi_update_rx_ring_ps; + sc->sc_update_tx_ring = wpi_update_tx_ring_ps; + } else { + sc->sc_update_rx_ring = wpi_update_rx_ring; + sc->sc_update_tx_ring = wpi_update_tx_ring; + } + WPI_TXQ_UNLOCK(sc); + } } static void @@ -2262,7 +2295,7 @@ wpi_notif_intr(struct wpi_softc *sc) if (sc->rxq.cur % 8 == 0) { /* Tell the firmware what we have processed. */ - wpi_update_rx_ring(sc); + sc->sc_update_rx_ring(sc); } } } @@ -2293,9 +2326,8 @@ wpi_wakeup_intr(struct wpi_softc *sc) wpi_update_tx_ring(sc, ring); } } - WPI_TXQ_UNLOCK(sc); - WPI_CLRBITS(sc, WPI_GP_CNTRL, WPI_GP_CNTRL_MAC_ACCESS_REQ); + WPI_TXQ_UNLOCK(sc); } /* @@ -2595,7 +2627,7 @@ wpi_cmd2(struct wpi_softc *sc, struct wp /* Kick TX ring. */ ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; - wpi_update_tx_ring(sc, ring); + sc->sc_update_tx_ring(sc, ring); if (ring->qid < WPI_CMD_QUEUE_NUM) { /* Mark TX ring as full if we reach a certain threshold. */ @@ -3147,7 +3179,7 @@ wpi_cmd(struct wpi_softc *sc, int code, /* Kick command ring. */ ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; - wpi_update_tx_ring(sc, ring); + sc->sc_update_tx_ring(sc, ring); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); @@ -3648,8 +3680,13 @@ wpi_set_pslevel(struct wpi_softc *sc, ui pmgt = &wpi_pmgt[1][level]; memset(&cmd, 0, sizeof cmd); - if (level != 0) /* not CAM */ + WPI_TXQ_LOCK(sc); + if (level != 0) { /* not CAM */ cmd.flags |= htole16(WPI_PS_ALLOW_SLEEP); + sc->sc_flags |= WPI_PS_PATH; + } else + sc->sc_flags &= ~WPI_PS_PATH; + WPI_TXQ_UNLOCK(sc); /* Retrieve PCIe Active State Power Management (ASPM). */ reg = pci_read_config(sc->sc_dev, sc->sc_cap_off + 0x10, 1); if (!(reg & 0x1)) /* L0s Entry disabled. */ Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun May 3 23:38:32 2015 (r282399) +++ head/sys/dev/wpi/if_wpivar.h Sun May 3 23:39:02 2015 (r282400) @@ -164,6 +164,9 @@ struct wpi_softc { struct ifnet *sc_ifp; int sc_debug; + int sc_flags; +#define WPI_PS_PATH (1 << 0) + struct mtx sc_mtx; struct mtx tx_mtx; @@ -210,6 +213,9 @@ struct wpi_softc { struct mtx nt_mtx; void (*sc_node_free)(struct ieee80211_node *); + void (*sc_update_rx_ring)(struct wpi_softc *); + void (*sc_update_tx_ring)(struct wpi_softc *, + struct wpi_tx_ring *); struct wpi_rx_radiotap_header sc_rxtap; struct wpi_tx_radiotap_header sc_txtap; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:39:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6065C718; Sun, 3 May 2015 23:39: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 4E9891A85; Sun, 3 May 2015 23:39: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 t43Ndj4T096024; Sun, 3 May 2015 23:39:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NdiEX096022; Sun, 3 May 2015 23:39:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032339.t43NdiEX096022@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282401 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:39:45 -0000 Author: adrian Date: Sun May 3 23:39:44 2015 New Revision: 282401 URL: https://svnweb.freebsd.org/changeset/base/282401 Log: Handle properly IBSS merges (works with patch from bug 199632). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:02 2015 (r282400) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:44 2015 (r282401) @@ -174,9 +174,13 @@ static int wpi_setregdomain(struct ieee8 struct ieee80211_channel[]); static int wpi_read_eeprom_group(struct wpi_softc *, int); static int wpi_add_node_entry_adhoc(struct wpi_softc *); -static void wpi_node_free(struct ieee80211_node *); static struct ieee80211_node *wpi_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); +static void wpi_node_free(struct ieee80211_node *); +static void wpi_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, + int); +static void wpi_restore_node(void *, struct ieee80211_node *); +static void wpi_restore_node_table(struct wpi_softc *, struct wpi_vap *); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_calib_timeout(void *); static void wpi_rx_done(struct wpi_softc *, struct wpi_rx_desc *, @@ -654,6 +658,8 @@ wpi_vap_create(struct ieee80211com *ic, /* Override with driver methods. */ vap->iv_key_set = wpi_key_set; vap->iv_key_delete = wpi_key_delete; + wvp->wv_recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = wpi_recv_mgmt; wvp->wv_newstate = vap->iv_newstate; vap->iv_newstate = wpi_newstate; vap->iv_update_beacon = wpi_update_beacon; @@ -1685,6 +1691,66 @@ wpi_check_bss_filter(struct wpi_softc *s return (sc->rxon.filter & htole32(WPI_FILTER_BSS)) != 0; } +static void +wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi, + int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct wpi_softc *sc = vap->iv_ic->ic_ifp->if_softc; + struct wpi_vap *wvp = WPI_VAP(vap); + uint64_t ni_tstamp, rx_tstamp; + + wvp->wv_recv_mgmt(ni, m, subtype, rssi, nf); + + if (vap->iv_opmode == IEEE80211_M_IBSS && + vap->iv_state == IEEE80211_S_RUN && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) { + ni_tstamp = le64toh(ni->ni_tstamp.tsf); + rx_tstamp = le64toh(sc->rx_tstamp); + + if (ni_tstamp >= rx_tstamp) { + DPRINTF(sc, WPI_DEBUG_STATE, + "ibss merge, tsf %ju tstamp %ju\n", + (uintmax_t)rx_tstamp, (uintmax_t)ni_tstamp); + (void) ieee80211_ibss_merge(ni); + } + } +} + +static void +wpi_restore_node(void *arg, struct ieee80211_node *ni) +{ + struct wpi_softc *sc = arg; + struct wpi_node *wn = WPI_NODE(ni); + int error; + + WPI_NT_LOCK(sc); + if (wn->id != WPI_ID_UNDEFINED) { + wn->id = WPI_ID_UNDEFINED; + if ((error = wpi_add_ibss_node(sc, ni)) != 0) { + device_printf(sc->sc_dev, + "%s: could not add IBSS node, error %d\n", + __func__, error); + } + } + WPI_NT_UNLOCK(sc); +} + +static void +wpi_restore_node_table(struct wpi_softc *sc, struct wpi_vap *wvp) +{ + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + + /* Set group keys once. */ + WPI_NT_LOCK(sc); + wvp->wv_gtk = 0; + WPI_NT_UNLOCK(sc); + + ieee80211_iterate_nodes(&ic->ic_sta, wpi_restore_node, sc); + ieee80211_crypto_reload_keys(ic); +} + /** * Called by net80211 when ever there is a change to 80211 state machine */ @@ -1751,13 +1817,36 @@ wpi_newstate(struct ieee80211vap *vap, e case IEEE80211_S_RUN: /* - * RUN -> RUN transition; Just restart the timers. + * RUN -> RUN transition: + * STA mode: Just restart the timers. + * IBSS mode: Process IBSS merge. */ if (vap->iv_state == IEEE80211_S_RUN) { - WPI_RXON_LOCK(sc); - wpi_calib_timeout(sc); - WPI_RXON_UNLOCK(sc); - break; + if (vap->iv_opmode != IEEE80211_M_IBSS) { + WPI_RXON_LOCK(sc); + wpi_calib_timeout(sc); + WPI_RXON_UNLOCK(sc); + break; + } else { + /* + * Drop the BSS_FILTER bit + * (there is no another way to change bssid). + */ + WPI_RXON_LOCK(sc); + sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); + if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { + device_printf(sc->sc_dev, + "%s: could not send RXON\n", + __func__); + } + WPI_RXON_UNLOCK(sc); + + /* Restore all what was lost. */ + wpi_restore_node_table(sc, wvp); + + /* XXX set conditionally? */ + wpi_updateedca(ic); + } } /* @@ -1945,6 +2034,7 @@ wpi_rx_done(struct wpi_softc *sc, struct } ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + sc->rx_tstamp = tail->tstamp; if (ieee80211_radiotap_active(ic)) { struct wpi_rx_radiotap_header *tap = &sc->sc_rxtap; Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Sun May 3 23:39:02 2015 (r282400) +++ head/sys/dev/wpi/if_wpivar.h Sun May 3 23:39:44 2015 (r282401) @@ -121,17 +121,19 @@ struct wpi_buf { }; struct wpi_vap { - struct ieee80211vap wv_vap; + struct ieee80211vap wv_vap; - struct wpi_buf wv_bcbuf; - struct ieee80211_beacon_offsets wv_boff; - struct mtx wv_mtx; - - uint32_t wv_gtk; -#define WPI_VAP_KEY(kid) (1 << kid) - - int (*wv_newstate)(struct ieee80211vap *, - enum ieee80211_state, int); + struct wpi_buf wv_bcbuf; + struct ieee80211_beacon_offsets wv_boff; + struct mtx wv_mtx; + + uint32_t wv_gtk; +#define WPI_VAP_KEY(kid) (1 << kid) + + int (*wv_newstate)(struct ieee80211vap *, + enum ieee80211_state, int); + void (*wv_recv_mgmt)(struct ieee80211_node *, + struct mbuf *, int, int, int); }; #define WPI_VAP(vap) ((struct wpi_vap *)(vap)) @@ -180,6 +182,7 @@ struct wpi_softc { uint32_t txq_active; struct wpi_rx_ring rxq; + uint64_t rx_tstamp; /* TX Thermal Callibration. */ struct callout calib_to; From owner-svn-src-all@FreeBSD.ORG Sun May 3 23:40:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE6DD863; Sun, 3 May 2015 23:40: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 9CC2A1B29; Sun, 3 May 2015 23:40: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 t43NeDE1096711; Sun, 3 May 2015 23:40:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t43NeD3E096710; Sun, 3 May 2015 23:40:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505032340.t43NeD3E096710@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 3 May 2015 23:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282402 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 23:40:13 -0000 Author: adrian Date: Sun May 3 23:40:12 2015 New Revision: 282402 URL: https://svnweb.freebsd.org/changeset/base/282402 Log: [iwn] Do not filter control frames in monitor mode. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun May 3 23:39:44 2015 (r282401) +++ head/sys/dev/wpi/if_wpi.c Sun May 3 23:40:12 2015 (r282402) @@ -1972,7 +1972,7 @@ wpi_rx_done(struct wpi_softc *sc, struct goto fail1; } /* Discard frames that are too short. */ - if (len < sizeof (*wh)) { + if (len < sizeof (struct ieee80211_frame_ack)) { DPRINTF(sc, WPI_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); goto fail1; @@ -2033,7 +2033,11 @@ wpi_rx_done(struct wpi_softc *sc, struct m->m_flags |= M_WEP; } - ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + if (len >= sizeof(struct ieee80211_frame_min)) + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + else + ni = NULL; + sc->rx_tstamp = tail->tstamp; if (ieee80211_radiotap_active(ic)) { From owner-svn-src-all@FreeBSD.ORG Mon May 4 00:01:36 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59D59C83; Mon, 4 May 2015 00:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF081D0A; Mon, 4 May 2015 00:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4401a97009717; Mon, 4 May 2015 00:01:36 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4401aRl009716; Mon, 4 May 2015 00:01:36 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505040001.t4401aRl009716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 4 May 2015 00:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282403 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 00:01:36 -0000 Author: loos Date: Mon May 4 00:01:35 2015 New Revision: 282403 URL: https://svnweb.freebsd.org/changeset/base/282403 Log: Fix the voltage and clock levels for cpufreq on RPi 2. Submitted by: Daisuke Aoyama Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Sun May 3 23:40:12 2015 (r282402) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon May 4 00:01:35 2015 (r282403) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2013-2014 Daisuke Aoyama + * Copyright (C) 2013-2015 Daisuke Aoyama * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,21 +60,28 @@ __FBSDID("$FreeBSD$"); #define DPRINTF(fmt, ...) #endif -#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) -#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) -#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) -#define MVOLT2OFFSET(val) (((val) - 1200) / 25) - -#define DEFAULT_ARM_FREQUENCY 700 -#define DEFAULT_CORE_FREQUENCY 250 -#define DEFAULT_SDRAM_FREQUENCY 400 -#define DEFAULT_LOWEST_FREQ 300 -#define TRANSITION_LATENCY 1000 -#define MIN_OVER_VOLTAGE -16 -#define MAX_OVER_VOLTAGE 6 -#define MSG_ERROR -999999999 -#define MHZSTEP 100 -#define HZSTEP (MHZ2HZ(MHZSTEP)) +#define HZ2MHZ(freq) ((freq) / (1000 * 1000)) +#define MHZ2HZ(freq) ((freq) * (1000 * 1000)) + +#ifdef SOC_BCM2836 +#define OFFSET2MVOLT(val) (((val) / 1000)) +#define MVOLT2OFFSET(val) (((val) * 1000)) +#define DEFAULT_ARM_FREQUENCY 600 +#define DEFAULT_LOWEST_FREQ 600 +#else +#define OFFSET2MVOLT(val) (1200 + ((val) * 25)) +#define MVOLT2OFFSET(val) (((val) - 1200) / 25) +#define DEFAULT_ARM_FREQUENCY 700 +#define DEFAULT_LOWEST_FREQ 300 +#endif +#define DEFAULT_CORE_FREQUENCY 250 +#define DEFAULT_SDRAM_FREQUENCY 400 +#define TRANSITION_LATENCY 1000 +#define MIN_OVER_VOLTAGE -16 +#define MAX_OVER_VOLTAGE 6 +#define MSG_ERROR -999999999 +#define MHZSTEP 100 +#define HZSTEP (MHZ2HZ(MHZSTEP)) #define TZ_ZEROC 2732 #define VC_LOCK(sc) do { \ @@ -1740,6 +1747,23 @@ bcm2835_cpufreq_make_freq_list(device_t if (min_freq > cpufreq_lowest_freq) min_freq = cpufreq_lowest_freq; +#ifdef SOC_BCM2836 + /* XXX RPi2 have only 900/600MHz */ + idx = 0; + volts = sc->min_voltage_core; + sets[idx].freq = freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + idx++; + if (freq != min_freq) { + sets[idx].freq = min_freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + idx++; + } +#else /* from freq to min_freq */ for (idx = 0; idx < *count && freq >= min_freq; idx++) { if (freq > sc->arm_min_freq) @@ -1752,7 +1776,8 @@ bcm2835_cpufreq_make_freq_list(device_t sets[idx].dev = dev; freq -= MHZSTEP; } - *count = ++idx; +#endif + *count = idx; return (0); } From owner-svn-src-all@FreeBSD.ORG Mon May 4 00:29:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A3EF93; Mon, 4 May 2015 00:29: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 180741EF3; Mon, 4 May 2015 00:29: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 t440TJ7d021973; Mon, 4 May 2015 00:29:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t440TJp1021972; Mon, 4 May 2015 00:29:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505040029.t440TJp1021972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 May 2015 00:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282404 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 00:29:20 -0000 Author: adrian Date: Mon May 4 00:29:19 2015 New Revision: 282404 URL: https://svnweb.freebsd.org/changeset/base/282404 Log: Add node_clear_keyixmap() and use it in the ieee80211_free_node() / node_reclaim(). PR: kern/199672 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Mon May 4 00:01:35 2015 (r282403) +++ head/sys/net80211/ieee80211_node.c Mon May 4 00:29:19 2015 (r282404) @@ -879,7 +879,7 @@ ieee80211_sta_leave(struct ieee80211_nod void ieee80211_node_deauth(struct ieee80211_node *ni, int reason) { - /* NB: bump the refcnt to be sure temporay nodes are not reclaimed */ + /* NB: bump the refcnt to be sure temporary nodes are not reclaimed */ ieee80211_ref_node(ni); if (ni->ni_associd != 0) IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH, reason); @@ -1757,6 +1757,28 @@ _ieee80211_free_node(struct ieee80211_no ni->ni_ic->ic_node_free(ni); } +/* + * Clear any entry in the unicast key mapping table. + */ +static int +node_clear_keyixmap(struct ieee80211_node_table *nt, struct ieee80211_node *ni) +{ + ieee80211_keyix keyix; + + keyix = ni->ni_ucastkey.wk_rxkeyix; + if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && + nt->nt_keyixmap[keyix] == ni) { + IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, + "%s: %p<%s> clear key map entry %u\n", + __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); + nt->nt_keyixmap[keyix] = NULL; + ieee80211_node_decref(ni); + return 1; + } + + return 0; +} + void #ifdef IEEE80211_DEBUG_REFCNT ieee80211_free_node_debug(struct ieee80211_node *ni, const char *func, int line) @@ -1778,24 +1800,9 @@ ieee80211_free_node(struct ieee80211_nod * Last reference, reclaim state. */ _ieee80211_free_node(ni); - } else if (ieee80211_node_refcnt(ni) == 1 && - nt->nt_keyixmap != NULL) { - ieee80211_keyix keyix; - /* - * Check for a last reference in the key mapping table. - */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, - IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry", __func__, - ni, ether_sprintf(ni->ni_macaddr)); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* XXX needed? */ + } else if (ieee80211_node_refcnt(ni) == 1) + if (node_clear_keyixmap(nt, ni)) _ieee80211_free_node(ni); - } - } IEEE80211_NODE_UNLOCK(nt); } else { if (ieee80211_node_dectestref(ni)) @@ -1863,7 +1870,6 @@ ieee80211_node_delucastkey(struct ieee80 static void node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni) { - ieee80211_keyix keyix; IEEE80211_NODE_LOCK_ASSERT(nt); @@ -1878,15 +1884,7 @@ node_reclaim(struct ieee80211_node_table * table. We cannot depend on the mapping table entry * being cleared because the node may not be free'd. */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry %u\n", - __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* NB: don't need free */ - } + (void)node_clear_keyixmap(nt, ni); if (!ieee80211_node_dectestref(ni)) { /* * Other references are present, just remove the From owner-svn-src-all@FreeBSD.ORG Mon May 4 00:32:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40956234; Mon, 4 May 2015 00:32:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F53C1FBB; Mon, 4 May 2015 00:32:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t440WBlA026041; Mon, 4 May 2015 00:32:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t440WBwD026040; Mon, 4 May 2015 00:32:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505040032.t440WBwD026040@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 May 2015 00:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282405 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 00:32:11 -0000 Author: adrian Date: Mon May 4 00:32:10 2015 New Revision: 282405 URL: https://svnweb.freebsd.org/changeset/base/282405 Log: Use bssid validation for data frames only + add RUN -> RUN state transition However, IBSS merge will be performed only if a driver calls ieee80211_ibss_merge(); so, this applicable to the ath(4) only. Also, this should fix bug 167870. PR: kern/199632 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon May 4 00:29:19 2015 (r282404) +++ head/sys/net80211/ieee80211_adhoc.c Mon May 4 00:32:10 2015 (r282405) @@ -229,6 +229,8 @@ adhoc_newstate(struct ieee80211vap *vap, } #endif break; + case IEEE80211_S_RUN: /* IBSS merge */ + break; default: goto invalid; } @@ -369,7 +371,10 @@ adhoc_input(struct ieee80211_node *ni, s /* * Validate the bssid. */ - if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && + if (!(type == IEEE80211_FC0_TYPE_MGT && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_REQ)) && + !IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && !IEEE80211_ADDR_EQ(bssid, ifp->if_broadcastaddr)) { /* not interested in */ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, @@ -409,7 +414,7 @@ adhoc_input(struct ieee80211_node *ni, s } IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; - if (HAS_SEQ(type)) { + if (HAS_SEQ(type) && IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { uint8_t tid = ieee80211_gettid(wh); if (IEEE80211_QOS_HAS_SEQ(wh) && TID_TO_WME_AC(tid) >= WME_AC_VI) From owner-svn-src-all@FreeBSD.ORG Mon May 4 00:47:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 336546A7; Mon, 4 May 2015 00:47: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 214AA10F6; Mon, 4 May 2015 00:47: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 t440lM84032189; Mon, 4 May 2015 00:47:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t440lMFT032188; Mon, 4 May 2015 00:47:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505040047.t440lMFT032188@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 4 May 2015 00:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282406 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 00:47:23 -0000 Author: adrian Date: Mon May 4 00:47:22 2015 New Revision: 282406 URL: https://svnweb.freebsd.org/changeset/base/282406 Log: Fix string concatenation - "wlan_##name" -> "wlan_" #name PR: kern/197623 Submitted by: Andriy Voskoboinyk Modified: head/sys/net80211/ieee80211_freebsd.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Mon May 4 00:32:10 2015 (r282405) +++ head/sys/net80211/ieee80211_freebsd.h Mon May 4 00:47:22 2015 (r282406) @@ -355,8 +355,8 @@ wlan_##name##_modevent(module_t mod, int case MOD_UNLOAD: \ case MOD_QUIESCE: \ if (nrefs) { \ - printf("wlan_##name: still in use (%u dynamic refs)\n",\ - nrefs); \ + printf("wlan_" #name ": still in use " \ + "(%u dynamic refs)\n", nrefs); \ return EBUSY; \ } \ if (type == MOD_UNLOAD) { \ From owner-svn-src-all@FreeBSD.ORG Mon May 4 04:27:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE924707; Mon, 4 May 2015 04:27: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 BC1D315EE; Mon, 4 May 2015 04:27: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 t444ROe5042645; Mon, 4 May 2015 04:27:24 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t444ROCq042644; Mon, 4 May 2015 04:27:24 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505040427.t444ROCq042644@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Mon, 4 May 2015 04:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282407 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 04:27:24 -0000 Author: neel Date: Mon May 4 04:27:23 2015 New Revision: 282407 URL: https://svnweb.freebsd.org/changeset/base/282407 Log: Emulate the 'CMP r/m8, imm8' instruction encountered when booting a Windows Vista guest. Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 1 week Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Mon May 4 00:47:22 2015 (r282406) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Mon May 4 04:27:23 2015 (r282407) @@ -178,14 +178,20 @@ static const struct vie_op one_byte_opco .op_byte = 0x23, .op_type = VIE_OP_TYPE_AND, }, + [0x80] = { + /* Group 1 extended opcode */ + .op_byte = 0x80, + .op_type = VIE_OP_TYPE_GROUP1, + .op_flags = VIE_OP_F_IMM8, + }, [0x81] = { - /* XXX Group 1 extended opcode */ + /* Group 1 extended opcode */ .op_byte = 0x81, .op_type = VIE_OP_TYPE_GROUP1, .op_flags = VIE_OP_F_IMM, }, [0x83] = { - /* XXX Group 1 extended opcode */ + /* Group 1 extended opcode */ .op_byte = 0x83, .op_type = VIE_OP_TYPE_GROUP1, .op_flags = VIE_OP_F_IMM8, @@ -1066,9 +1072,13 @@ emulate_cmp(void *vm, int vcpuid, uint64 rflags2 = getcc(size, op1, op2); break; + case 0x80: case 0x81: case 0x83: /* + * 80 /7 cmp r/m8, imm8 + * REX + 80 /7 cmp r/m8, imm8 + * * 81 /7 cmp r/m16, imm16 * 81 /7 cmp r/m32, imm32 * REX.W + 81 /7 cmp r/m64, imm32 sign-extended to 64 @@ -1084,6 +1094,8 @@ emulate_cmp(void *vm, int vcpuid, uint64 * the status flags. * */ + if (vie->op.op_byte == 0x80) + size = 1; /* get the first operand */ error = memread(vm, vcpuid, gpa, &op1, size, arg); From owner-svn-src-all@FreeBSD.ORG Mon May 4 04:31:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C9A8879; Mon, 4 May 2015 04:31:15 +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 23DC51605; Mon, 4 May 2015 04:31:14 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id ED5D8754; Sun, 3 May 2015 21:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430713868; bh=fAv6xeDxVs1gICJuKb5KVQD+8R+eNt9bhg3tFOEXMGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C1zMQ7bAg/TbwNT3qFeugU3FDNF5EZpw8VAuAnJvO89mEDTCFfZLR1QLoQ3pYOQTo ulCTGzWMf9cBaOfyYhUy0Z61q/jyEb/lOONoRJCD1Tjq7+IWRHFvhSEPoMCffiHs9i CNxZ0Yi7dh4ziJrP2xP+nvEHRkkaV3b3y7MczmOw= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 21:31:01 -0700 Message-ID: <1897115.Jgl4mMPfrQ@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <201504170639.t3H6dGd7075429@svn.freebsd.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8078899.yJ8FAozkei"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 04:31:15 -0000 --nextPart8078899.yJ8FAozkei Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > Author: glebius > Date: Fri Apr 17 06:39:15 2015 > New Revision: 281643 > URL: https://svnweb.freebsd.org/changeset/base/281643 >=20 > Log: > Bring in if_types.h from projects/ifnet, where types are > defined in enum. >=20 > Modified: > head/sys/net/if_types.h I'm sorry, but this breaks the freebsd.org cluster. 281642 works 281643 fails head with 281643 reverted works IPv6 doesn't work on systems with pf, carp and multiple interfaces. I = have=20 nothing more specific than that. =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 --nextPart8078899.yJ8FAozkei 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 iQEcBAABCAAGBQJVRvYFAAoJEDXWlwnsgJ4EGSEH/RK9c/uutmlMyrqLhHiJ78v9 AUQJtWyGSgXWubRthimrQfAOWJLiv9BCf/bWqjoB+DxiQhi3DwOd48ZX9RFUPsNq +ZAa7YKTKu3p/xYIvTJ7c8tBIFv1fwMrlboaa9wVOT04dAOTKVycETo/RHB9RSKA bA028uu357XzvbiBSZBOMs3PEtLhgLHFwA0Ft6sRnYchaLjHE+0UbNSytwCgZOGs iZrS7x+7FCam3JF2tYMrB3ccgXzbaRmRT5gNvV5TIi+vPVR5avoiXnqTZLIEdEOY jbXlsNdEtrSyWJFimFGYQ/TGKv7pyaApkPfUPjz8Hh0SgzI1yWf26VWAVy9qnc4= =+4Re -----END PGP SIGNATURE----- --nextPart8078899.yJ8FAozkei-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 04:46:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 695FBA9B; Mon, 4 May 2015 04:46: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 542DF1799; Mon, 4 May 2015 04:46: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 t444k1WE052316; Mon, 4 May 2015 04:46:01 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t444k0q4052306; Mon, 4 May 2015 04:46:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201505040446.t444k0q4052306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 4 May 2015 04:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282408 - in head: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys contrib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 04:46:01 -0000 Author: cy Date: Mon May 4 04:45:59 2015 New Revision: 282408 URL: https://svnweb.freebsd.org/changeset/base/282408 Log: MFV ntp 4.2.8p2 (r281348) Reviewed by: delphij (suggested MFC) Approved by: roberto Security: CVE-2015-1798, CVE-2015-1799 Security: VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2 MFC after: 1 month Added: head/contrib/ntp/scripts/update-leap/ - copied from r281348, vendor/ntp/dist/scripts/update-leap/ head/contrib/ntp/sntp/libevent/m4/acx_pthread.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/libevent/m4/acx_pthread.m4 head/contrib/ntp/sntp/m4/ax_c99_struct_init.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/m4/ax_c99_struct_init.m4 head/contrib/ntp/sntp/m4/openldap-thread-check.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/m4/openldap-thread-check.m4 head/contrib/ntp/sntp/m4/openldap.m4 - copied unchanged from r281348, vendor/ntp/dist/sntp/m4/openldap.m4 Deleted: head/contrib/ntp/sntp/libevent/README head/contrib/ntp/sntp/libevent/m4/openldap-thread-check.m4 head/contrib/ntp/sntp/libevent/m4/openldap.m4 head/contrib/ntp/util/jitter.h Modified: head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/Makefile.in head/contrib/ntp/NEWS head/contrib/ntp/aclocal.m4 head/contrib/ntp/adjtimed/Makefile.in head/contrib/ntp/clockstuff/Makefile.in head/contrib/ntp/config.h.in head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/html/build.html head/contrib/ntp/html/miscopt.html head/contrib/ntp/html/sntp.html head/contrib/ntp/include/Makefile.in head/contrib/ntp/include/binio.h head/contrib/ntp/include/isc/Makefile.in head/contrib/ntp/include/mbg_gps166.h head/contrib/ntp/include/ntp.h head/contrib/ntp/include/ntp_calendar.h head/contrib/ntp/include/ntp_fp.h head/contrib/ntp/include/ntp_md5.h head/contrib/ntp/include/ntpd.h head/contrib/ntp/include/parse.h head/contrib/ntp/include/parse_conf.h head/contrib/ntp/kernel/Makefile.in head/contrib/ntp/kernel/sys/Makefile.in head/contrib/ntp/kernel/sys/parsestreams.h head/contrib/ntp/lib/isc/inet_ntop.c head/contrib/ntp/lib/isc/log.c head/contrib/ntp/lib/isc/result.c head/contrib/ntp/lib/isc/unix/file.c head/contrib/ntp/lib/isc/unix/ifiter_getifaddrs.c head/contrib/ntp/lib/isc/unix/ifiter_ioctl.c head/contrib/ntp/lib/isc/unix/net.c head/contrib/ntp/libntp/Makefile.in head/contrib/ntp/libntp/ntp_calendar.c head/contrib/ntp/libntp/work_fork.c head/contrib/ntp/libparse/Makefile.in head/contrib/ntp/libparse/clk_computime.c head/contrib/ntp/libparse/clk_dcf7000.c head/contrib/ntp/libparse/clk_hopf6021.c head/contrib/ntp/libparse/clk_meinberg.c head/contrib/ntp/libparse/clk_rawdcf.c head/contrib/ntp/libparse/clk_rcc8000.c head/contrib/ntp/libparse/clk_schmid.c head/contrib/ntp/libparse/clk_sel240x.c head/contrib/ntp/libparse/clk_trimtaip.c head/contrib/ntp/libparse/clk_trimtsip.c head/contrib/ntp/libparse/clk_varitext.c head/contrib/ntp/libparse/clk_wharton.c head/contrib/ntp/libparse/data_mbg.c head/contrib/ntp/libparse/gpstolfp.c head/contrib/ntp/libparse/parse.c head/contrib/ntp/libparse/parse_conf.c head/contrib/ntp/libparse/parsesolaris.c head/contrib/ntp/libparse/parsestreams.c head/contrib/ntp/libparse/trim_info.c head/contrib/ntp/ntpd/Makefile.in head/contrib/ntp/ntpd/cmd_args.c head/contrib/ntp/ntpd/invoke-ntp.conf.texi head/contrib/ntp/ntpd/invoke-ntp.keys.texi head/contrib/ntp/ntpd/invoke-ntpd.texi head/contrib/ntp/ntpd/keyword-gen-utd head/contrib/ntp/ntpd/keyword-gen.c head/contrib/ntp/ntpd/ntp.conf.5man head/contrib/ntp/ntpd/ntp.conf.5mdoc head/contrib/ntp/ntpd/ntp.conf.def head/contrib/ntp/ntpd/ntp.conf.html head/contrib/ntp/ntpd/ntp.conf.man.in head/contrib/ntp/ntpd/ntp.conf.mdoc.in head/contrib/ntp/ntpd/ntp.keys.5man head/contrib/ntp/ntpd/ntp.keys.5mdoc head/contrib/ntp/ntpd/ntp.keys.html head/contrib/ntp/ntpd/ntp.keys.man.in head/contrib/ntp/ntpd/ntp.keys.mdoc.in head/contrib/ntp/ntpd/ntp_config.c head/contrib/ntp/ntpd/ntp_control.c head/contrib/ntp/ntpd/ntp_crypto.c head/contrib/ntp/ntpd/ntp_keyword.h head/contrib/ntp/ntpd/ntp_leapsec.c head/contrib/ntp/ntpd/ntp_loopfilter.c head/contrib/ntp/ntpd/ntp_parser.c head/contrib/ntp/ntpd/ntp_parser.h head/contrib/ntp/ntpd/ntp_peer.c head/contrib/ntp/ntpd/ntp_proto.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd.1ntpdman head/contrib/ntp/ntpd/ntpd.1ntpdmdoc head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpd.html head/contrib/ntp/ntpd/ntpd.man.in head/contrib/ntp/ntpd/ntpd.mdoc.in head/contrib/ntp/ntpd/ntpdbase-opts.def head/contrib/ntp/ntpd/refclock_palisade.c head/contrib/ntp/ntpd/refclock_palisade.h head/contrib/ntp/ntpd/refclock_parse.c head/contrib/ntp/ntpdate/Makefile.in head/contrib/ntp/ntpdc/Makefile.in head/contrib/ntp/ntpdc/invoke-ntpdc.texi head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc.1ntpdcman head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc head/contrib/ntp/ntpdc/ntpdc.html head/contrib/ntp/ntpdc/ntpdc.man.in head/contrib/ntp/ntpdc/ntpdc.mdoc.in head/contrib/ntp/ntpq/Makefile.in head/contrib/ntp/ntpq/invoke-ntpq.texi head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-subs.c head/contrib/ntp/ntpq/ntpq.1ntpqman head/contrib/ntp/ntpq/ntpq.1ntpqmdoc head/contrib/ntp/ntpq/ntpq.html head/contrib/ntp/ntpq/ntpq.man.in head/contrib/ntp/ntpq/ntpq.mdoc.in head/contrib/ntp/ntpsnmpd/Makefile.in head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc head/contrib/ntp/ntpsnmpd/ntpsnmpd.html head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in head/contrib/ntp/packageinfo.sh head/contrib/ntp/parseutil/Makefile.in head/contrib/ntp/parseutil/dcfd.c head/contrib/ntp/parseutil/testdcf.c head/contrib/ntp/scripts/Makefile.am head/contrib/ntp/scripts/Makefile.in head/contrib/ntp/scripts/build/Makefile.in head/contrib/ntp/scripts/calc_tickadj/Makefile.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi head/contrib/ntp/scripts/invoke-plot_summary.texi head/contrib/ntp/scripts/invoke-summary.texi head/contrib/ntp/scripts/lib/Makefile.in head/contrib/ntp/scripts/lib/NTP/Util.pm head/contrib/ntp/scripts/ntp-wait/Makefile.in head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc head/contrib/ntp/scripts/ntp-wait/ntp-wait.html head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in head/contrib/ntp/scripts/ntpsweep/Makefile.in head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi head/contrib/ntp/scripts/ntpsweep/ntpsweep-opts head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc head/contrib/ntp/scripts/ntpsweep/ntpsweep.html head/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in head/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in head/contrib/ntp/scripts/ntptrace/Makefile.in head/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi head/contrib/ntp/scripts/ntptrace/ntptrace-opts head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc head/contrib/ntp/scripts/ntptrace/ntptrace.html head/contrib/ntp/scripts/ntptrace/ntptrace.man.in head/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in head/contrib/ntp/scripts/plot_summary-opts head/contrib/ntp/scripts/plot_summary.1plot_summaryman head/contrib/ntp/scripts/plot_summary.1plot_summarymdoc head/contrib/ntp/scripts/plot_summary.html head/contrib/ntp/scripts/plot_summary.man.in head/contrib/ntp/scripts/plot_summary.mdoc.in head/contrib/ntp/scripts/summary-opts head/contrib/ntp/scripts/summary.1summaryman head/contrib/ntp/scripts/summary.1summarymdoc head/contrib/ntp/scripts/summary.html head/contrib/ntp/scripts/summary.man.in head/contrib/ntp/scripts/summary.mdoc.in head/contrib/ntp/sntp/Makefile.in head/contrib/ntp/sntp/aclocal.m4 head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/include/Makefile.in head/contrib/ntp/sntp/include/version.def head/contrib/ntp/sntp/include/version.texi head/contrib/ntp/sntp/invoke-sntp.texi head/contrib/ntp/sntp/libevent/ChangeLog head/contrib/ntp/sntp/libevent/Makefile.am head/contrib/ntp/sntp/libevent/Makefile.in head/contrib/ntp/sntp/libevent/WIN32-Code/nmake/event2/event-config.h head/contrib/ntp/sntp/libevent/WIN32-Code/tree.h head/contrib/ntp/sntp/libevent/aclocal.m4 head/contrib/ntp/sntp/libevent/buffer.c head/contrib/ntp/sntp/libevent/bufferevent.c head/contrib/ntp/sntp/libevent/bufferevent_async.c head/contrib/ntp/sntp/libevent/bufferevent_filter.c head/contrib/ntp/sntp/libevent/bufferevent_openssl.c head/contrib/ntp/sntp/libevent/bufferevent_pair.c head/contrib/ntp/sntp/libevent/config.h.in head/contrib/ntp/sntp/libevent/configure head/contrib/ntp/sntp/libevent/configure.ac head/contrib/ntp/sntp/libevent/evbuffer-internal.h head/contrib/ntp/sntp/libevent/evdns.c head/contrib/ntp/sntp/libevent/event.c head/contrib/ntp/sntp/libevent/event_tagging.c head/contrib/ntp/sntp/libevent/evrpc-internal.h head/contrib/ntp/sntp/libevent/evthread-internal.h head/contrib/ntp/sntp/libevent/evthread.c head/contrib/ntp/sntp/libevent/evutil.c head/contrib/ntp/sntp/libevent/evutil_time.c head/contrib/ntp/sntp/libevent/ht-internal.h head/contrib/ntp/sntp/libevent/http-internal.h head/contrib/ntp/sntp/libevent/http.c head/contrib/ntp/sntp/libevent/include/event2/buffer.h head/contrib/ntp/sntp/libevent/include/event2/bufferevent.h head/contrib/ntp/sntp/libevent/include/event2/dns.h head/contrib/ntp/sntp/libevent/include/event2/event.h head/contrib/ntp/sntp/libevent/include/event2/http.h head/contrib/ntp/sntp/libevent/include/event2/listener.h head/contrib/ntp/sntp/libevent/include/event2/util.h head/contrib/ntp/sntp/libevent/kqueue.c head/contrib/ntp/sntp/libevent/listener.c head/contrib/ntp/sntp/libevent/sample/http-server.c head/contrib/ntp/sntp/libevent/sample/https-client.c head/contrib/ntp/sntp/libevent/sample/include.am head/contrib/ntp/sntp/libevent/test/include.am head/contrib/ntp/sntp/libevent/test/regress.c head/contrib/ntp/sntp/libevent/test/regress.h head/contrib/ntp/sntp/libevent/test/regress_buffer.c head/contrib/ntp/sntp/libevent/test/regress_bufferevent.c head/contrib/ntp/sntp/libevent/test/regress_dns.c head/contrib/ntp/sntp/libevent/test/regress_finalize.c head/contrib/ntp/sntp/libevent/test/regress_http.c head/contrib/ntp/sntp/libevent/test/regress_main.c head/contrib/ntp/sntp/libevent/test/regress_minheap.c head/contrib/ntp/sntp/libevent/test/regress_ssl.c head/contrib/ntp/sntp/libevent/test/regress_thread.c head/contrib/ntp/sntp/libevent/test/regress_util.c head/contrib/ntp/sntp/libevent/test/regress_zlib.c head/contrib/ntp/sntp/libevent/test/test-fdleak.c head/contrib/ntp/sntp/libevent/test/test-ratelim.c head/contrib/ntp/sntp/libevent/test/test-time.c head/contrib/ntp/sntp/libevent/test/tinytest.c head/contrib/ntp/sntp/libevent/test/tinytest.h head/contrib/ntp/sntp/libevent/test/tinytest_macros.h head/contrib/ntp/sntp/libevent/time-internal.h head/contrib/ntp/sntp/libevent/util-internal.h head/contrib/ntp/sntp/libevent/whatsnew-2.1.txt head/contrib/ntp/sntp/libopts/Makefile.in head/contrib/ntp/sntp/libopts/m4/libopts.m4 head/contrib/ntp/sntp/loc/darwin head/contrib/ntp/sntp/loc/debian head/contrib/ntp/sntp/loc/freebsd head/contrib/ntp/sntp/loc/legacy head/contrib/ntp/sntp/loc/netbsd head/contrib/ntp/sntp/loc/solaris head/contrib/ntp/sntp/m4/ntp_libntp.m4 head/contrib/ntp/sntp/m4/ntp_locinfo.m4 head/contrib/ntp/sntp/m4/version.m4 head/contrib/ntp/sntp/main.c head/contrib/ntp/sntp/scripts/Makefile.in head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.def head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp.1sntpman head/contrib/ntp/sntp/sntp.1sntpmdoc head/contrib/ntp/sntp/sntp.html head/contrib/ntp/sntp/sntp.man.in head/contrib/ntp/sntp/sntp.mdoc.in head/contrib/ntp/sntp/tests/Makefile.in head/contrib/ntp/tests/Makefile.in head/contrib/ntp/tests/libntp/Makefile.in head/contrib/ntp/tests/ntpd/Makefile.in head/contrib/ntp/util/Makefile.am head/contrib/ntp/util/Makefile.in head/contrib/ntp/util/invoke-ntp-keygen.texi head/contrib/ntp/util/jitter.c head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen.1ntp-keygenman head/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc head/contrib/ntp/util/ntp-keygen.c head/contrib/ntp/util/ntp-keygen.html head/contrib/ntp/util/ntp-keygen.man.in head/contrib/ntp/util/ntp-keygen.mdoc.in head/usr.sbin/ntp/config.h head/usr.sbin/ntp/scripts/mkver Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Mon May 4 04:27:23 2015 (r282407) +++ head/contrib/ntp/ChangeLog Mon May 4 04:45:59 2015 (r282408) @@ -1,4 +1,80 @@ --- +(4.2.8p2) 2015/04/07 Released by Harlan Stenn +(4.2.8p2-RC3) 2015/04/03 Released by Harlan Stenn + +* [Bug 2763] Fix for different thresholds for forward and backward steps. +--- +(4.2.8p2-RC2) 2015/04/03 Released by Harlan Stenn + +* [Bug 2592] FLAG_TSTAMP_PPS cleanup for refclock_parse.c. +* [Bug 2769] New script: update-leap +* [Bug 2769] cleannup for update-leap +* [Bug 2788] New flag -G (force_step_once). +* [Bug 2794] Clean up kernel clock status reports. +* [Bug 2795] Cannot build without OpenSLL (on Win32). + Provided a Win32 specific wrapper around libevent/arc4random.c. + fixed some minor warnings. +* [Bug 2796] ntp-keygen crashes in 'getclock()' on Win32. +* [Bug 2797] ntp-keygen trapped in endless loop for MD5 keys + on big-endian machines. +* [Bug 2798] sntp should decode and display the leap indicator. +* Simple cleanup to html/build.html +--- +(4.2.8p2-RC1) 2015/03/30 Released by Harlan Stenn + +* [Bug 2794] Don't let reports on normal kernel status changes + look like errors. +* [Bug 2788] New flag -G (force_step_once). +* [Bug 2592] Account for PPS sources which can provide an accurate + absolute time stamp, and status information. + Fixed indention and removed trailing whitespace. +* [Bug 1787] DCF77's formerly "antenna" bit is "call bit" since 2003. +* [Bug 1960] setsockopt IPV6_MULTICAST_IF: Invalid argument. +* [Bug 2346] "graceful termination" signals do not do peer cleanup. +* [Bug 2728] See if C99-style structure initialization works. +* [Bug 2747] Upgrade libevent to 2.1.5-beta. +* [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. . +* [Bug 2751] jitter.h has stale copies of l_fp macros. +* [Bug 2756] ntpd hangs in startup with gcc 3.3.5 on ARM. +* [Bug 2757] Quiet compiler warnings. +* [Bug 2759] Expose nonvolatile/clk_wander_threshold to ntpq. +* [Bug 2763] Allow different thresholds for forward and backward steps. +* [Bug 2766] ntp-keygen output files should not be world-readable. +* [Bug 2767] ntp-keygen -M should symlink to ntp.keys. +* [Bug 2771] nonvolatile value is documented in wrong units. +* [Bug 2773] Early leap announcement from Palisade/Thunderbolt +* [Bug 2774] Unreasonably verbose printout - leap pending/warning +* [Bug 2775] ntp-keygen.c fails to compile under Windows. +* [Bug 2777] Fixed loops and decoding of Meinberg GPS satellite info. + Removed non-ASCII characters from some copyright comments. + Removed trailing whitespace. + Updated definitions for Meinberg clocks from current Meinberg header files. + Now use C99 fixed-width types and avoid non-ASCII characters in comments. + Account for updated definitions pulled from Meinberg header files. + Updated comments on Meinberg GPS receivers which are not only called GPS16x. + Replaced some constant numbers by defines from ntp_calendar.h + Modified creation of parse-specific variables for Meinberg devices + in gps16x_message(). + Reworked mk_utcinfo() to avoid printing of ambiguous leap second dates. + Modified mbg_tm_str() which now expexts an additional parameter controlling + if the time status shall be printed. +* [Sec 2779] ntpd accepts unauthenticated packets with symmetric key crypto. +* [Sec 2781] Authentication doesn't protect symmetric associations against + DoS attacks. +* [Bug 2783] Quiet autoconf warnings about missing AC_LANG_SOURCE. +* [Bug 2789] Quiet compiler warnings from libevent. +* [Bug 2790] If ntpd sets the Windows MM timer highest resolution + pause briefly before measuring system clock precision to yield + correct results. +* Comment from Juergen Perlinger in ntp_calendar.c to make the code clearer. +* Use predefined function types for parse driver functions + used to set up function pointers. + Account for changed prototype of parse_inp_fnc_t functions. + Cast parse conversion results to appropriate types to avoid + compiler warnings. + Let ioctl() for Windows accept a (void *) to avoid compiler warnings + when called with pointers to different types. +--- (4.2.8p1) 2015/02/04 Released by Harlan Stenn * Update the NEWS file. @@ -14,7 +90,7 @@ (This should work for all versions of Windows >= W2K) * [Bug 2738] Missing buffer initialization in refclocK_parse.c::parsestate(). * [Bug 2739] Parse driver with PPS enabled occasionally evaluates - PPS timestamp with wrong sign. + PPS timestamp with wrong sign. Removed some German umlauts. * [Bug 2740] Removed some obsolete code from the parse driver. * [Bug 2741] Incorrect buffer check in refclocK_parse.c::parsestatus(). @@ -94,7 +170,7 @@ * [Bug 2678] nmea_control() now checks 'refclock_params()' result. (4.2.7p481) 2014/11/22 Released by Harlan Stenn * [Bug 2314] Only enable PPS if kernel consumer binding succeeds. -* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. +* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition. * Rename pps_enable to hardpps_enable. (4.2.7p480) 2014/11/21 Released by Harlan Stenn * [Bug 2677] PATH_MAX isn't #define'd under Windows. Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Mon May 4 04:27:23 2015 (r282407) +++ head/contrib/ntp/CommitLog Mon May 4 04:45:59 2015 (r282408) @@ -1,3 +1,2569 @@ +ChangeSet@1.3320, 2015-04-07 04:28:16-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2 + TAG: NTP_4_2_8P2 + + ChangeLog@1.1633 +1 -0 + NTP_4_2_8P2 + + ntpd/invoke-ntp.conf.texi@1.182 +1 -1 + NTP_4_2_8P2 + + ntpd/invoke-ntp.keys.texi@1.178 +1 -1 + NTP_4_2_8P2 + + ntpd/invoke-ntpd.texi@1.495 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.conf.5man@1.216 +3 -3 + NTP_4_2_8P2 + + ntpd/ntp.conf.5mdoc@1.216 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.conf.html@1.173 +1 -1 + NTP_4_2_8P2 + + ntpd/ntp.conf.man.in@1.216 +3 -3 + NTP_4_2_8P2 + + ntpd/ntp.conf.mdoc.in@1.216 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.5man@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.5mdoc@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.html@1.174 +1 -1 + NTP_4_2_8P2 + + ntpd/ntp.keys.man.in@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntp.keys.mdoc.in@1.212 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd-opts.c@1.517 +245 -245 + NTP_4_2_8P2 + + ntpd/ntpd-opts.h@1.516 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.1ntpdman@1.324 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.1ntpdmdoc@1.324 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd.html@1.168 +2 -2 + NTP_4_2_8P2 + + ntpd/ntpd.man.in@1.324 +3 -3 + NTP_4_2_8P2 + + ntpd/ntpd.mdoc.in@1.324 +2 -2 + NTP_4_2_8P2 + + ntpdc/invoke-ntpdc.texi@1.492 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc-opts.c@1.510 +107 -107 + NTP_4_2_8P2 + + ntpdc/ntpdc-opts.h@1.509 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.1ntpdcman@1.323 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.1ntpdcmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc.html@1.336 +2 -2 + NTP_4_2_8P2 + + ntpdc/ntpdc.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + ntpdc/ntpdc.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + + ntpq/invoke-ntpq.texi@1.498 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq-opts.c@1.515 +106 -106 + NTP_4_2_8P2 + + ntpq/ntpq-opts.h@1.513 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.1ntpqman@1.326 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.1ntpqmdoc@1.326 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq.html@1.165 +2 -2 + NTP_4_2_8P2 + + ntpq/ntpq.man.in@1.326 +3 -3 + NTP_4_2_8P2 + + ntpq/ntpq.mdoc.in@1.326 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.494 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd-opts.c@1.512 +68 -68 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd-opts.h@1.511 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.323 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.html@1.163 +1 -1 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + + packageinfo.sh@1.509 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.84 +3 -3 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.85 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.html@1.86 +1 -1 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.man.in@1.83 +3 -3 + NTP_4_2_8P2 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.85 +2 -2 + NTP_4_2_8P2 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.88 +1 -1 + NTP_4_2_8P2 + + scripts/invoke-plot_summary.texi@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/invoke-summary.texi@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.315 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait-opts@1.51 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.312 +3 -3 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.313 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.html@1.332 +2 -2 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.man.in@1.312 +3 -3 + NTP_4_2_8P2 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.313 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.91 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.html@1.104 +2 -2 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.man.in@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.92 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/invoke-ntptrace.texi@1.104 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.1ntptraceman@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.92 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.html@1.105 +2 -2 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.man.in@1.91 +3 -3 + NTP_4_2_8P2 + + scripts/ntptrace/ntptrace.mdoc.in@1.93 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.1plot_summaryman@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/plot_summary.1plot_summarymdoc@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.html@1.106 +2 -2 + NTP_4_2_8P2 + + scripts/plot_summary.man.in@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/plot_summary.mdoc.in@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/summary-opts@1.53 +2 -2 + NTP_4_2_8P2 + + scripts/summary.1summaryman@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/summary.1summarymdoc@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/summary.html@1.106 +2 -2 + NTP_4_2_8P2 + + scripts/summary.man.in@1.103 +3 -3 + NTP_4_2_8P2 + + scripts/summary.mdoc.in@1.103 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/invoke-update-leap.texi@1.4 +1 -1 + NTP_4_2_8P2 + + scripts/update-leap/update-leap-opts@1.4 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.1update-leapman@1.4 +3 -3 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.1update-leapmdoc@1.4 +2 -2 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.html@1.4 +1 -1 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.man.in@1.4 +3 -3 + NTP_4_2_8P2 + + scripts/update-leap/update-leap.mdoc.in@1.4 +2 -2 + NTP_4_2_8P2 + + sntp/invoke-sntp.texi@1.492 +2 -2 + NTP_4_2_8P2 + + sntp/sntp-opts.c@1.511 +159 -159 + NTP_4_2_8P2 + + sntp/sntp-opts.h@1.509 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.1sntpman@1.327 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.1sntpmdoc@1.327 +2 -2 + NTP_4_2_8P2 + + sntp/sntp.html@1.507 +2 -2 + NTP_4_2_8P2 + + sntp/sntp.man.in@1.327 +3 -3 + NTP_4_2_8P2 + + sntp/sntp.mdoc.in@1.327 +2 -2 + NTP_4_2_8P2 + + util/invoke-ntp-keygen.texi@1.495 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen-opts.c@1.513 +173 -173 + NTP_4_2_8P2 + + util/ntp-keygen-opts.h@1.511 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.1ntp-keygenman@1.323 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.1ntp-keygenmdoc@1.323 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen.html@1.169 +2 -2 + NTP_4_2_8P2 + + util/ntp-keygen.man.in@1.323 +3 -3 + NTP_4_2_8P2 + + util/ntp-keygen.mdoc.in@1.323 +2 -2 + NTP_4_2_8P2 + +ChangeSet@1.3319, 2015-04-07 04:05:46-04:00, stenn@deacon.udel.edu + ntp-4.2.8p2 + + packageinfo.sh@1.508 +2 -2 + ntp-4.2.8p2 + +ChangeSet@1.3318, 2015-04-07 07:57:32+00:00, stenn@psp-fb1.ntp.org + NEWS update + + NEWS@1.135 +4 -2 + NEWS update + +ChangeSet@1.3314.1.3, 2015-04-03 03:56:38-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC3 + TAG: NTP_4_2_8P2_RC3 + + ChangeLog@1.1629.1.3 +1 -0 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntp.conf.texi@1.181 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntp.keys.texi@1.177 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/invoke-ntpd.texi@1.494 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.5man@1.215 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.5mdoc@1.215 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.html@1.172 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.man.in@1.215 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntp.conf.mdoc.in@1.215 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.5man@1.211 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.5mdoc@1.211 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.html@1.173 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.man.in@1.211 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntp.keys.mdoc.in@1.211 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntpd-opts.c@1.516 +7 -7 + NTP_4_2_8P2_RC3 + + ntpd/ntpd-opts.h@1.515 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.1ntpdman@1.323 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.1ntpdmdoc@1.323 +1 -1 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.html@1.167 +2 -2 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.man.in@1.323 +3 -3 + NTP_4_2_8P2_RC3 + + ntpd/ntpd.mdoc.in@1.323 +1 -1 + NTP_4_2_8P2_RC3 + + ntpdc/invoke-ntpdc.texi@1.491 +2 -2 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc-opts.c@1.509 +7 -7 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.1ntpdcman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.1ntpdcmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.html@1.335 +2 -2 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpdc/ntpdc.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpq/invoke-ntpq.texi@1.497 +2 -2 + NTP_4_2_8P2_RC3 + + ntpq/ntpq-opts.c@1.514 +7 -7 + NTP_4_2_8P2_RC3 + + ntpq/ntpq-opts.h@1.512 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.1ntpqman@1.325 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.1ntpqmdoc@1.325 +1 -1 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.html@1.164 +2 -2 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.man.in@1.325 +3 -3 + NTP_4_2_8P2_RC3 + + ntpq/ntpq.mdoc.in@1.325 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.493 +2 -2 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd-opts.c@1.511 +7 -7 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.html@1.162 +1 -1 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + packageinfo.sh@1.507 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.83 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.84 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.html@1.85 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.man.in@1.82 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.84 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.87 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/invoke-plot_summary.texi@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/invoke-summary.texi@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.314 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait-opts@1.50 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.311 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.312 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.html@1.331 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.man.in@1.311 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.312 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.102 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.90 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.html@1.103 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.man.in@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.91 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/invoke-ntptrace.texi@1.103 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.1ntptraceman@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.91 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.html@1.104 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.man.in@1.90 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/ntptrace/ntptrace.mdoc.in@1.92 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/plot_summary-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.1plot_summaryman@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.1plot_summarymdoc@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.html@1.105 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.man.in@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/plot_summary.mdoc.in@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/summary-opts@1.52 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/summary.1summaryman@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/summary.1summarymdoc@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/summary.html@1.105 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/summary.man.in@1.102 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/summary.mdoc.in@1.102 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/invoke-update-leap.texi@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap-opts@1.3 +2 -2 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.1update-leapman@1.3 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.1update-leapmdoc@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.html@1.3 +6 -5 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.man.in@1.3 +3 -3 + NTP_4_2_8P2_RC3 + + scripts/update-leap/update-leap.mdoc.in@1.3 +1 -1 + NTP_4_2_8P2_RC3 + + sntp/invoke-sntp.texi@1.491 +2 -2 + NTP_4_2_8P2_RC3 + + sntp/sntp-opts.c@1.510 +7 -7 + NTP_4_2_8P2_RC3 + + sntp/sntp-opts.h@1.508 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.1sntpman@1.326 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.1sntpmdoc@1.326 +1 -1 + NTP_4_2_8P2_RC3 + + sntp/sntp.html@1.506 +2 -2 + NTP_4_2_8P2_RC3 + + sntp/sntp.man.in@1.326 +3 -3 + NTP_4_2_8P2_RC3 + + sntp/sntp.mdoc.in@1.326 +1 -1 + NTP_4_2_8P2_RC3 + + util/invoke-ntp-keygen.texi@1.494 +2 -2 + NTP_4_2_8P2_RC3 + + util/ntp-keygen-opts.c@1.512 +7 -7 + NTP_4_2_8P2_RC3 + + util/ntp-keygen-opts.h@1.510 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.1ntp-keygenman@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.1ntp-keygenmdoc@1.322 +1 -1 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.html@1.168 +2 -2 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC3 + + util/ntp-keygen.mdoc.in@1.322 +1 -1 + NTP_4_2_8P2_RC3 + +ChangeSet@1.3314.1.2, 2015-04-03 03:35:54-04:00, stenn@deacon.udel.edu + [Bug 2763] Fix for different thresholds for forward and backward steps + + ChangeLog@1.1629.1.2 +3 -0 + [Bug 2763] Fix for different thresholds for forward and backward steps + + ntpd/ntp_loopfilter.c@1.183 +2 -2 + [Bug 2763] Fix for different thresholds for forward and backward steps + +ChangeSet@1.3314.1.1, 2015-04-03 01:16:34-04:00, stenn@deacon.udel.edu + NTP_4_2_8P2_RC2 + TAG: NTP_4_2_8P2_RC2 + + ChangeLog@1.1629.1.1 +1 -0 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntp.conf.texi@1.180 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntp.keys.texi@1.176 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/invoke-ntpd.texi@1.493 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.5man@1.214 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.5mdoc@1.214 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.html@1.171 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.man.in@1.214 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntp.conf.mdoc.in@1.214 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.5man@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.5mdoc@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.html@1.172 +1 -1 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.man.in@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntp.keys.mdoc.in@1.210 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntpd-opts.c@1.515 +7 -7 + NTP_4_2_8P2_RC2 + + ntpd/ntpd-opts.h@1.514 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.1ntpdman@1.322 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.1ntpdmdoc@1.322 +2 -2 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.html@1.166 +50 -26 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.man.in@1.322 +3 -3 + NTP_4_2_8P2_RC2 + + ntpd/ntpd.mdoc.in@1.322 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/invoke-ntpdc.texi@1.490 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc-opts.c@1.508 +7 -7 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc-opts.h@1.507 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.1ntpdcman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.1ntpdcmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.html@1.334 +2 -2 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpdc/ntpdc.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/invoke-ntpq.texi@1.496 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq-opts.c@1.513 +7 -7 + NTP_4_2_8P2_RC2 + + ntpq/ntpq-opts.h@1.511 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.1ntpqman@1.324 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.1ntpqmdoc@1.324 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.html@1.163 +2 -2 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.man.in@1.324 +3 -3 + NTP_4_2_8P2_RC2 + + ntpq/ntpq.mdoc.in@1.324 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.492 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd-opts.c@1.510 +7 -7 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd-opts.h@1.509 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.html@1.161 +1 -1 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.man.in@1.321 +3 -3 + NTP_4_2_8P2_RC2 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.321 +2 -2 + NTP_4_2_8P2_RC2 + + packageinfo.sh@1.506 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.82 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.83 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.html@1.84 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.man.in@1.81 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.83 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.86 +1 -1 + NTP_4_2_8P2_RC2 + + scripts/invoke-plot_summary.texi@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/invoke-summary.texi@1.103 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.313 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait-opts@1.49 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.310 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.311 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.html@1.330 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.man.in@1.310 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.311 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.101 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep-opts@1.51 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.89 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.html@1.102 +2 -2 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.man.in@1.89 +3 -3 + NTP_4_2_8P2_RC2 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.90 +2 -2 + NTP_4_2_8P2_RC2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 4 04:52:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19E6BC34; Mon, 4 May 2015 04:52:15 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::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 0080A187E; Mon, 4 May 2015 04:52:15 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id CED87763; Sun, 3 May 2015 21:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430715133; bh=TBlsR4SLdyi9A8VYs2CqbLTPVvS2kgeOUt08dFIRPE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kbGqRGmIemn+2TDaKF1+NM70VRh2J0d6oWLgZct5X1gJnk0aY+iIaXMEA+dyjEUVY GNFI5F+oqXISZyp4oO/h3S/otJGMG2bLj2XRW+/S5kH7Zi1jtEkchrBnQ2i0kGhUQh bZ2r7gw7S+wraS9ANDBt/tf32KRt5C5b8a/ZJUv8= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 21:52:08 -0700 Message-ID: <1771261.fW4ZlvR2Pp@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <1897115.Jgl4mMPfrQ@overcee.wemm.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> <1897115.Jgl4mMPfrQ@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart238538607.hU2ZEmULYq"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 04:52:15 -0000 --nextPart238538607.hU2ZEmULYq Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, May 03, 2015 09:31:01 PM Peter Wemm wrote: > On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > > Author: glebius > > Date: Fri Apr 17 06:39:15 2015 > > New Revision: 281643 > > URL: https://svnweb.freebsd.org/changeset/base/281643 > >=20 > > Log: > > Bring in if_types.h from projects/ifnet, where types are > > defined in enum. > >=20 > > Modified: > > head/sys/net/if_types.h >=20 > I'm sorry, but this breaks the freebsd.org cluster. >=20 > 281642 works > 281643 fails > head with 281643 reverted works >=20 > IPv6 doesn't work on systems with pf, carp and multiple interfaces. = I have > nothing more specific than that. The kernel is smaller with the enums: text data bss dec hex =20 11438123 730686 2998048 15166857 0xe76d89 =20 11437787 730686 2998048 15166521 0xe76c39 The first is with the #defines, the second is enums. The enums caused = 336 bytes=20 less code to be generated, so presumably the enums enabled some "optimi= zation"=20 that wasn't expected. =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 --nextPart238538607.hU2ZEmULYq 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 iQEcBAABCAAGBQJVRvr4AAoJEDXWlwnsgJ4E7/kIALIQZG7zBSG4yRgZffm1QeI3 ElTzB7NbbKXscaSLOjLGL9vOC0oZuMXV3YT8Ub3q5ZlH1l9Ds2XtWtCO6o/AZZRy NdxTghzGcgDHV/oPzOdgAT1FgOjBXfECbO+Us72mujijEg0fGyq20dleVauZqs/r AOZIPLlF9So9TQHm9W2Ja1JlRwO+RNTcG4lat20LRSRVuI/i1Z1XzSeGf2JR1qnA 7hmfq+l5X9j71yP8JYgZAKux1bkRg/g8ugRNejxV6wd5sVhrIqUVLNK/hlJQOjVc bofkwNzE5pNc0nRrnO3tAgtjdOvmE4CAQgfsxxvptm2eL1pQWII3JBFkOfB/G7k= =0Fck -----END PGP SIGNATURE----- --nextPart238538607.hU2ZEmULYq-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 05:15:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B7966C; Mon, 4 May 2015 05:15:18 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::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 714A01A3E; Mon, 4 May 2015 05:15:18 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 1B1CE777; Sun, 3 May 2015 22:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430716518; bh=hQO32tgcNvR2LfqFdY3c2D0OGlZzoYcSH/mM/DNONlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=k28lgYeEYH+pbuA7SBufFAbBgUObbUztc5z4W3s7aSvDE9WOQBUHu86toLBvU9ZKo uzYwP80BR1cAlaGz/o4vaztgwjq+sCwtLZeh2pAGJ/4CuR6qeKibMeOcD/J5nxqRCy Yu8N6DgywYweyzAKw77KGUAhjGOHqEkd+KNT64cw= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 22:15:13 -0700 Message-ID: <2092700.7byBvhDAMg@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <1771261.fW4ZlvR2Pp@overcee.wemm.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> <1897115.Jgl4mMPfrQ@overcee.wemm.org> <1771261.fW4ZlvR2Pp@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3072967.PFjSqYtG8m"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 05:15:18 -0000 --nextPart3072967.PFjSqYtG8m Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, May 03, 2015 09:52:08 PM Peter Wemm wrote: > On Sunday, May 03, 2015 09:31:01 PM Peter Wemm wrote: > > On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > > > Author: glebius > > > Date: Fri Apr 17 06:39:15 2015 > > > New Revision: 281643 > > > URL: https://svnweb.freebsd.org/changeset/base/281643 > > >=20 > > > Log: > > > Bring in if_types.h from projects/ifnet, where types are > > > defined in enum. > > >=20 > > > Modified: > > > head/sys/net/if_types.h > >=20 > > I'm sorry, but this breaks the freebsd.org cluster. > >=20 > > 281642 works > > 281643 fails > > head with 281643 reverted works > >=20 > > IPv6 doesn't work on systems with pf, carp and multiple interfaces.= I > > have > > nothing more specific than that. >=20 > The kernel is smaller with the enums: > text data bss dec hex > 11438123 730686 2998048 15166857 0xe76d89 > 11437787 730686 2998048 15166521 0xe76c39 >=20 > The first is with the #defines, the second is enums. The enums cause= d 336 > bytes less code to be generated, so presumably the enums enabled some= > "optimization" that wasn't expected. More data; looking at size *.o in the kernel compile obj directory to s= ee what=20 changes size with enum vs #define: @@ -470,10 +470,10 @@ 1158 124 0 1282 0x502 imgact_shell.o 11617 160 36 11813 0x2e25 in.o 343 0 0 343 0x157 in4_cksum.o =2D 22155 0 0 22155 0x568b in6.o + 22187 0 0 22187 0x56ab in6.o 2084 0 0 2084 0x824 in6_cksum.o 1155 200 0 1355 0x54b in6_gif.o =2D 5208 12 16 5236 0x1474 in6_ifattach.o + 5224 12 16 5252 0x1484 in6_ifattach.o 21933 864 0 22797 0x590d in6_mcast.o 6860 0 0 6860 0x1acc in6_pcb.o 2627 6960 248 9835 0x266b in6_proto.o @@ -750,8 +750,8 @@ 25424 452 0 25876 0x6514 mvs.o 0 24 0 24 0x18 mvs_if.o 5989 268 0 6257 0x1871 mvs_pci.o =2D 17111 388 72 17571 0x44a3 nd6.o =2D 15251 92 48 15391 0x3c1f nd6_nbr.o + 17287 388 72 17747 0x4553 nd6.o + 15366 92 48 15506 0x3c92 nd6_nbr.o 16318 66 16 16400 0x4010 nd6_rtr.o 466 196 8 670 0x29e nehemiah.o 7844 2412 2036 12292 0x3004 netisr.o The size changes are confined to the ipv6 stack. =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 --nextPart3072967.PFjSqYtG8m 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 iQEcBAABCAAGBQJVRwBhAAoJEDXWlwnsgJ4EUwgIAOGXDJRvXPMPr8w1jsULGAHs fKqKASPgx3dEXOuCwxLD7n88Bdgbq53NGjSTIVA2+IVnDXZWN6b1IwrOSnMIhBj7 lO/S+grBIl+Lcu1D/sgKvGXOJJbqlran7ufoAJ4Vp3QKfd4pZBC6jj//fqD2o5jc EMkaiuSogbfu+EBFPS4qEGNFjfboGT28+JkF5vx8Q2T6JT8wUrexOpvliLjD3LnN tBPScju/2PncHlCbN/lKTBACDiHLrFP+I0N4gshHUYf8HEz9fR/urjlGQsRZ+kSR td8N/RJrGD6USZmyL3LTA4AI14TFgr6QwkGYdoB3h9WWQfcy5CA9B91AbEY+2co= =uPbB -----END PGP SIGNATURE----- --nextPart3072967.PFjSqYtG8m-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 05:26:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92BA0276; Mon, 4 May 2015 05:26:25 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::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 70BA21B2A; Mon, 4 May 2015 05:26:25 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 7D34E780; Sun, 3 May 2015 22:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430717184; bh=iWzHafUdWRRjQM+jtj79bqmlnEJwauCoNV3vAktS+Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aU6jVV6+RkxiaUHmzYyeopgin4m5+ZL3C0PhVZQKQzSd3uURr2RTijQXOjahNsmHi 99ppzgI+0lEjrD32fHh3VJSCRVLSWGaIwdCYqx4xgfkqaC2Kcgz4LTMrTxZMffJWQM x0OwnclmdcsHyXRg6KU92A0sZTXnP1UPgCjcU05o= From: Peter Wemm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281643 - head/sys/net Date: Sun, 03 May 2015 22:26:20 -0700 Message-ID: <1668736.kf1P9eBIoh@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <2092700.7byBvhDAMg@overcee.wemm.org> References: <201504170639.t3H6dGd7075429@svn.freebsd.org> <1771261.fW4ZlvR2Pp@overcee.wemm.org> <2092700.7byBvhDAMg@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3110857.r8a3ZQ6AtB"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 05:26:25 -0000 --nextPart3110857.r8a3ZQ6AtB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Sunday, May 03, 2015 10:15:13 PM Peter Wemm wrote: > On Sunday, May 03, 2015 09:52:08 PM Peter Wemm wrote: > > On Sunday, May 03, 2015 09:31:01 PM Peter Wemm wrote: > > > On Friday, April 17, 2015 06:39:16 AM Gleb Smirnoff wrote: > > > > Author: glebius > > > > Date: Fri Apr 17 06:39:15 2015 > > > > New Revision: 281643 > > > > URL: https://svnweb.freebsd.org/changeset/base/281643 > > > >=20 > > > > Log: > > > > Bring in if_types.h from projects/ifnet, where types are > > > > defined in enum. > > > >=20 > > > > Modified: > > > > head/sys/net/if_types.h > > >=20 > > > I'm sorry, but this breaks the freebsd.org cluster. > > >=20 > > > 281642 works > > > 281643 fails > > > head with 281643 reverted works > > >=20 > > > IPv6 doesn't work on systems with pf, carp and multiple interface= s. I > > > have > > > nothing more specific than that. > >=20 > > The kernel is smaller with the enums: > > text data bss dec hex > >=20 > > 11438123 730686 2998048 15166857 0xe76d89 > > 11437787 730686 2998048 15166521 0xe76c39 > >=20 > > The first is with the #defines, the second is enums. The enums cau= sed 336 > > bytes less code to be generated, so presumably the enums enabled so= me > > "optimization" that wasn't expected. >=20 > More data; looking at size *.o in the kernel compile obj directory to= see > what changes size with enum vs #define: > @@ -470,10 +470,10 @@ > 1158 124 0 1282 0x502 imgact_shell.o > 11617 160 36 11813 0x2e25 in.o > 343 0 0 343 0x157 in4_cksum.o > - 22155 0 0 22155 0x568b in6.o > + 22187 0 0 22187 0x56ab in6.o > 2084 0 0 2084 0x824 in6_cksum.o > 1155 200 0 1355 0x54b in6_gif.o > - 5208 12 16 5236 0x1474 in6_ifattach.o > + 5224 12 16 5252 0x1484 in6_ifattach.o > 21933 864 0 22797 0x590d in6_mcast.o > 6860 0 0 6860 0x1acc in6_pcb.o > 2627 6960 248 9835 0x266b in6_proto.o > @@ -750,8 +750,8 @@ > 25424 452 0 25876 0x6514 mvs.o > 0 24 0 24 0x18 mvs_if.o > 5989 268 0 6257 0x1871 mvs_pci.o > - 17111 388 72 17571 0x44a3 nd6.o > - 15251 92 48 15391 0x3c1f nd6_nbr.o > + 17287 388 72 17747 0x4553 nd6.o > + 15366 92 48 15506 0x3c92 nd6_nbr.o > 16318 66 16 16400 0x4010 nd6_rtr.o > 466 196 8 670 0x29e nehemiah.o > 7844 2412 2036 12292 0x3004 netisr.o >=20 > The size changes are confined to the ipv6 stack. I've just been pointed to the #ifdef IFT_* fix for this, at about the s= ame time=20 I was looking at the C code. Sigh, fixed already, I believe. =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 --nextPart3110857.r8a3ZQ6AtB 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 iQEcBAABCAAGBQJVRwL8AAoJEDXWlwnsgJ4Eo68IALMHjqsJdX9Ri2jBmfNuv5xQ Verj51PrijOwkp1EbIac8bt37xVAblAOs7QXiooj2fP/E8AhsH52Q00EAC5rDVVp vyTBo246qcW1Gge16sVH8rPjUwSjJNAdBR0ATAU4dy2MW06jPkI9L9eSa/qiUfhf lnyfcQcXb8GSZQ9bJEh1eid1Ik3a8skAZ8XkdzkoM74RK9lW3T6or3W4LAMpGst/ a4I/Fd4KK49WTNrQUW12xV8PUm+RMcDpUwyz+Qd1ptuJkDHDir3H14gpjKS7cTiv HuJqvMHMuoOP5+YL8u1H0//W6dfQ8t7/eOjP24hStdgHeXtLf1DzDdmQqgBwYkM= =CDkw -----END PGP SIGNATURE----- --nextPart3110857.r8a3ZQ6AtB-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 08:05:14 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CD43D72; Mon, 4 May 2015 08:05: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 6A69E1C05; Mon, 4 May 2015 08:05: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 t4485E62049836; Mon, 4 May 2015 08:05:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4485E4G049835; Mon, 4 May 2015 08:05:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505040805.t4485E4G049835@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 4 May 2015 08:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282409 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 08:05:14 -0000 Author: kib Date: Mon May 4 08:05:13 2015 New Revision: 282409 URL: https://svnweb.freebsd.org/changeset/base/282409 Log: MFC r281763: Remove code to support the top of the stack layout for FreeBSD 1.x/2.x kernel. Modified: stable/10/lib/libc/gen/setproctitle.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/setproctitle.c ============================================================================== --- stable/10/lib/libc/gen/setproctitle.c Mon May 4 04:45:59 2015 (r282408) +++ stable/10/lib/libc/gen/setproctitle.c Mon May 4 08:05:13 2015 (r282409) @@ -42,9 +42,10 @@ __FBSDID("$FreeBSD$"); * 1: old_ps_strings at the very top of the stack. * 2: old_ps_strings at SPARE_USRSPACE below the top of the stack. * 3: ps_strings at the very top of the stack. - * This attempts to support a kernel built in the #2 and #3 era. - */ - + * We only support a kernel providing #3 style ps_strings. + * + * For historical purposes, a definition of the old ps_strings structure + * and location is preserved below: struct old_ps_strings { char *old_ps_argvstr; int old_ps_nargvstr; @@ -53,6 +54,7 @@ struct old_ps_strings { }; #define OLD_PS_STRINGS ((struct old_ps_strings *) \ (USRSTACK - SPARE_USRSPACE - sizeof(struct old_ps_strings))) + */ #include @@ -136,41 +138,38 @@ setproctitle(const char *fmt, ...) ps_strings = (struct ps_strings *)ul_ps_strings; } - /* PS_STRINGS points to zeroed memory on a style #2 kernel */ - if (ps_strings->ps_argvstr) { - /* style #3 */ - if (oargc == -1) { - /* Record our original args */ - oargc = ps_strings->ps_nargvstr; - oargv = ps_strings->ps_argvstr; - for (i = len = 0; i < oargc; i++) { - /* - * The program may have scribbled into its - * argv array, e.g., to remove some arguments. - * If that has happened, break out before - * trying to call strlen on a NULL pointer. - */ - if (oargv[i] == NULL) { - oargc = i; - break; - } - snprintf(obuf + len, SPT_BUFSIZE - len, "%s%s", - len ? " " : "", oargv[i]); - if (len) - len++; - len += strlen(oargv[i]); - if (len >= SPT_BUFSIZE) - break; + /* + * PS_STRINGS points to zeroed memory on a style #2 kernel. + * Should not happen. + */ + if (ps_strings->ps_argvstr == NULL) + return; + + /* style #3 */ + if (oargc == -1) { + /* Record our original args */ + oargc = ps_strings->ps_nargvstr; + oargv = ps_strings->ps_argvstr; + for (i = len = 0; i < oargc; i++) { + /* + * The program may have scribbled into its + * argv array, e.g., to remove some arguments. + * If that has happened, break out before + * trying to call strlen on a NULL pointer. + */ + if (oargv[i] == NULL) { + oargc = i; + break; } + snprintf(obuf + len, SPT_BUFSIZE - len, "%s%s", + len != 0 ? " " : "", oargv[i]); + if (len != 0) + len++; + len += strlen(oargv[i]); + if (len >= SPT_BUFSIZE) + break; } - ps_strings->ps_nargvstr = nargc; - ps_strings->ps_argvstr = nargvp; - } else { - /* style #2 - we can only restore our first arg :-( */ - if (*obuf == '\0') - strncpy(obuf, OLD_PS_STRINGS->old_ps_argvstr, - SPT_BUFSIZE - 1); - OLD_PS_STRINGS->old_ps_nargvstr = 1; - OLD_PS_STRINGS->old_ps_argvstr = nargvp[0]; } + ps_strings->ps_nargvstr = nargc; + ps_strings->ps_argvstr = nargvp; } From owner-svn-src-all@FreeBSD.ORG Mon May 4 08:13:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3385233; Mon, 4 May 2015 08:13: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 771431D31; Mon, 4 May 2015 08:13: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 t448D6JP054680; Mon, 4 May 2015 08:13:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t448D6wM054679; Mon, 4 May 2015 08:13:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505040813.t448D6wM054679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 4 May 2015 08:13: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: r282410 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 08:13:06 -0000 Author: kib Date: Mon May 4 08:13:05 2015 New Revision: 282410 URL: https://svnweb.freebsd.org/changeset/base/282410 Log: MFC r282084: Fix locking for oshmctl() and shmsys(). Modified: stable/10/sys/kern/sysv_shm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sysv_shm.c ============================================================================== --- stable/10/sys/kern/sysv_shm.c Mon May 4 08:05:13 2015 (r282409) +++ stable/10/sys/kern/sysv_shm.c Mon May 4 08:13:05 2015 (r282410) @@ -967,39 +967,39 @@ oshmctl(struct thread *td, struct oshmct if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) return (ENOSYS); + if (uap->cmd != IPC_STAT) { + return (freebsd7_shmctl(td, + (struct freebsd7_shmctl_args *)uap)); + } SYSVSHM_LOCK(); shmseg = shm_find_segment(uap->shmid, true); if (shmseg == NULL) { SYSVSHM_UNLOCK(); return (EINVAL); } - switch (uap->cmd) { - case IPC_STAT: - error = ipcperm(td, &shmseg->u.shm_perm, IPC_R); - if (error != 0) - break; + error = ipcperm(td, &shmseg->u.shm_perm, IPC_R); + if (error != 0) { + SYSVSHM_UNLOCK(); + return (error); + } #ifdef MAC - error = mac_sysvshm_check_shmctl(td->td_ucred, shmseg, - uap->cmd); - if (error != 0) - break; -#endif - ipcperm_new2old(&shmseg->u.shm_perm, &outbuf.shm_perm); - outbuf.shm_segsz = shmseg->u.shm_segsz; - outbuf.shm_cpid = shmseg->u.shm_cpid; - outbuf.shm_lpid = shmseg->u.shm_lpid; - outbuf.shm_nattch = shmseg->u.shm_nattch; - outbuf.shm_atime = shmseg->u.shm_atime; - outbuf.shm_dtime = shmseg->u.shm_dtime; - outbuf.shm_ctime = shmseg->u.shm_ctime; - outbuf.shm_handle = shmseg->object; - error = copyout(&outbuf, uap->ubuf, sizeof(outbuf)); - break; - default: - error = freebsd7_shmctl(td, (struct freebsd7_shmctl_args *)uap); - break; + error = mac_sysvshm_check_shmctl(td->td_ucred, shmseg, uap->cmd); + if (error != 0) { + SYSVSHM_UNLOCK(); + return (error); } +#endif + ipcperm_new2old(&shmseg->u.shm_perm, &outbuf.shm_perm); + outbuf.shm_segsz = shmseg->u.shm_segsz; + outbuf.shm_cpid = shmseg->u.shm_cpid; + outbuf.shm_lpid = shmseg->u.shm_lpid; + outbuf.shm_nattch = shmseg->u.shm_nattch; + outbuf.shm_atime = shmseg->u.shm_atime; + outbuf.shm_dtime = shmseg->u.shm_dtime; + outbuf.shm_ctime = shmseg->u.shm_ctime; + outbuf.shm_handle = shmseg->object; SYSVSHM_UNLOCK(); + error = copyout(&outbuf, uap->ubuf, sizeof(outbuf)); return (error); #else return (EINVAL); @@ -1031,9 +1031,7 @@ sys_shmsys(struct thread *td, struct shm return (ENOSYS); if (uap->which < 0 || uap->which >= nitems(shmcalls)) return (EINVAL); - SYSVSHM_LOCK(); error = (*shmcalls[uap->which])(td, &uap->a2); - SYSVSHM_UNLOCK(); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon May 4 08:16:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61DFB555; Mon, 4 May 2015 08:16:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42DD81D57; Mon, 4 May 2015 08:16: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 t448GXn2055390; Mon, 4 May 2015 08:16:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t448GXr0055389; Mon, 4 May 2015 08:16:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505040816.t448GXr0055389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 4 May 2015 08:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282411 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 08:16:33 -0000 Author: kib Date: Mon May 4 08:16:32 2015 New Revision: 282411 URL: https://svnweb.freebsd.org/changeset/base/282411 Log: MFC r282085: Partially revert r255986: do not call VOP_FSYNC() when helping bufdaemon in getnewbuf(), do use buf_flush(). The difference is that bufdaemon uses TRYLOCK to get buffer locks, which allows calls to getnewbuf() while another buffer is locked. Modified: stable/10/sys/kern/vfs_bio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Mon May 4 08:13:05 2015 (r282410) +++ stable/10/sys/kern/vfs_bio.c Mon May 4 08:16:32 2015 (r282411) @@ -113,8 +113,8 @@ static void vfs_setdirty_locked_object(s static void vfs_vmio_release(struct buf *bp); static int vfs_bio_clcheck(struct vnode *vp, int size, daddr_t lblkno, daddr_t blkno); -static int buf_flush(int); -static int flushbufqueues(int, int); +static int buf_flush(struct vnode *vp, int); +static int flushbufqueues(struct vnode *, int, int); static void buf_daemon(void); static void bremfreel(struct buf *bp); static __inline void bd_wakeup(void); @@ -2065,7 +2065,7 @@ getnewbuf_bufd_help(struct vnode *vp, in { struct thread *td; char *waitmsg; - int cnt, error, flags, norunbuf, wait; + int error, fl, flags, norunbuf; mtx_assert(&bqclean, MA_OWNED); @@ -2087,8 +2087,6 @@ getnewbuf_bufd_help(struct vnode *vp, in return; td = curthread; - cnt = 0; - wait = MNT_NOWAIT; rw_wlock(&nblock); while ((needsbuffer & flags) != 0) { if (vp != NULL && vp->v_type != VCHR && @@ -2102,20 +2100,23 @@ getnewbuf_bufd_help(struct vnode *vp, in * cannot be achieved by the buf_daemon, that * cannot lock the vnode. */ - if (cnt++ > 2) - wait = MNT_WAIT; - ASSERT_VOP_LOCKED(vp, "bufd_helper"); - error = VOP_ISLOCKED(vp) == LK_EXCLUSIVE ? 0 : - vn_lock(vp, LK_TRYUPGRADE); - if (error == 0) { - /* play bufdaemon */ - norunbuf = curthread_pflags_set(TDP_BUFNEED | - TDP_NORUNNINGBUF); - VOP_FSYNC(vp, wait, td); - atomic_add_long(¬bufdflushes, 1); - curthread_pflags_restore(norunbuf); - } + norunbuf = ~(TDP_BUFNEED | TDP_NORUNNINGBUF) | + (td->td_pflags & TDP_NORUNNINGBUF); + + /* + * Play bufdaemon. The getnewbuf() function + * may be called while the thread owns lock + * for another dirty buffer for the same + * vnode, which makes it impossible to use + * VOP_FSYNC() there, due to the buffer lock + * recursion. + */ + td->td_pflags |= TDP_BUFNEED | TDP_NORUNNINGBUF; + fl = buf_flush(vp, flushbufqtarget); + td->td_pflags &= norunbuf; rw_wlock(&nblock); + if (fl != 0) + continue; if ((needsbuffer & flags) == 0) break; } @@ -2534,18 +2535,20 @@ static struct kproc_desc buf_kp = { SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp); static int -buf_flush(int target) +buf_flush(struct vnode *vp, int target) { int flushed; - flushed = flushbufqueues(target, 0); + flushed = flushbufqueues(vp, target, 0); if (flushed == 0) { /* * Could not find any buffers without rollback * dependencies, so just write the first one * in the hopes of eventually making progress. */ - flushed = flushbufqueues(target, 1); + if (vp != NULL && target > 2) + target /= 2; + flushbufqueues(vp, target, 1); } return (flushed); } @@ -2582,7 +2585,7 @@ buf_daemon() * the I/O system. */ while (numdirtybuffers > lodirty) { - if (buf_flush(numdirtybuffers - lodirty) == 0) + if (buf_flush(NULL, numdirtybuffers - lodirty) == 0) break; kern_yield(PRI_USER); } @@ -2637,7 +2640,7 @@ SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps 0, "Number of buffers flushed with dependecies that require rollbacks"); static int -flushbufqueues(int target, int flushdeps) +flushbufqueues(struct vnode *lvp, int target, int flushdeps) { struct buf *sentinel; struct vnode *vp; @@ -2647,6 +2650,7 @@ flushbufqueues(int target, int flushdeps int flushed; int queue; int error; + bool unlock; flushed = 0; queue = QUEUE_DIRTY; @@ -2668,8 +2672,18 @@ flushbufqueues(int target, int flushdeps mtx_unlock(&bqdirty); break; } - KASSERT(bp->b_qindex != QUEUE_SENTINEL, - ("parallel calls to flushbufqueues() bp %p", bp)); + /* + * Skip sentinels inserted by other invocations of the + * flushbufqueues(), taking care to not reorder them. + * + * Only flush the buffers that belong to the + * vnode locked by the curthread. + */ + if (bp->b_qindex == QUEUE_SENTINEL || (lvp != NULL && + bp->b_vp != lvp)) { + mtx_unlock(&bqdirty); + continue; + } error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL); mtx_unlock(&bqdirty); if (error != 0) @@ -2717,16 +2731,37 @@ flushbufqueues(int target, int flushdeps BUF_UNLOCK(bp); continue; } - error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); + if (lvp == NULL) { + unlock = true; + error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); + } else { + ASSERT_VOP_LOCKED(vp, "getbuf"); + unlock = false; + error = VOP_ISLOCKED(vp) == LK_EXCLUSIVE ? 0 : + vn_lock(vp, LK_TRYUPGRADE); + } if (error == 0) { CTR3(KTR_BUF, "flushbufqueue(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); - vfs_bio_awrite(bp); + if (curproc == bufdaemonproc) { + vfs_bio_awrite(bp); + } else { + bremfree(bp); + bwrite(bp); + notbufdflushes++; + } vn_finished_write(mp); - VOP_UNLOCK(vp, 0); + if (unlock) + VOP_UNLOCK(vp, 0); flushwithdeps += hasdeps; flushed++; - if (runningbufspace > hirunningspace) + + /* + * Sleeping on runningbufspace while holding + * vnode lock leads to deadlock. + */ + if (curproc == bufdaemonproc && + runningbufspace > hirunningspace) waitrunningbufspace(); continue; } From owner-svn-src-all@FreeBSD.ORG Mon May 4 08:19:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D66897A6; Mon, 4 May 2015 08:19: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 B72411D70; Mon, 4 May 2015 08:19: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 t448JDbK055893; Mon, 4 May 2015 08:19:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t448JDtr055892; Mon, 4 May 2015 08:19:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505040819.t448JDtr055892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 4 May 2015 08:19: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: r282412 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 08:19:14 -0000 Author: kib Date: Mon May 4 08:19:12 2015 New Revision: 282412 URL: https://svnweb.freebsd.org/changeset/base/282412 Log: MFC r282109: Always do token substitution, do not require -z origin to do it. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Mon May 4 08:16:32 2015 (r282411) +++ stable/10/libexec/rtld-elf/rtld.c Mon May 4 08:19:12 2015 (r282412) @@ -146,8 +146,10 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); -static char *origin_subst_one(char *, const char *, const char *, bool); -static char *origin_subst(char *, const char *); +static char *origin_subst_one(Obj_Entry *, char *, const char *, + const char *, bool); +static char *origin_subst(Obj_Entry *, char *); +static bool obj_resolve_origin(Obj_Entry *obj); static void preinit_main(void); static int rtld_verify_versions(const Objlist *); static int rtld_verify_object_versions(Obj_Entry *); @@ -779,8 +781,8 @@ basename(const char *name) static struct utsname uts; static char * -origin_subst_one(char *real, const char *kw, const char *subst, - bool may_free) +origin_subst_one(Obj_Entry *obj, char *real, const char *kw, + const char *subst, bool may_free) { char *p, *p1, *res, *resp; int subst_len, kw_len, subst_count, old_len, new_len; @@ -799,9 +801,15 @@ origin_subst_one(char *real, const char /* * If the keyword is not found, just return. + * + * Return non-substituted string if resolution failed. We + * cannot do anything more reasonable, the failure mode of the + * caller is unresolved library anyway. */ - if (subst_count == 0) + if (subst_count == 0 || (obj != NULL && !obj_resolve_origin(obj))) return (may_free ? real : xstrdup(real)); + if (obj != NULL) + subst = obj->origin_path; /* * There is indeed something to substitute. Calculate the @@ -838,20 +846,22 @@ origin_subst_one(char *real, const char } static char * -origin_subst(char *real, const char *origin_path) +origin_subst(Obj_Entry *obj, char *real) { char *res1, *res2, *res3, *res4; + if (obj == NULL || !trust) + return (xstrdup(real)); if (uts.sysname[0] == '\0') { if (uname(&uts) != 0) { _rtld_error("utsname failed: %d", errno); return (NULL); } } - res1 = origin_subst_one(real, "$ORIGIN", origin_path, false); - res2 = origin_subst_one(res1, "$OSNAME", uts.sysname, true); - res3 = origin_subst_one(res2, "$OSREL", uts.release, true); - res4 = origin_subst_one(res3, "$PLATFORM", uts.machine, true); + res1 = origin_subst_one(obj, real, "$ORIGIN", NULL, false); + res2 = origin_subst_one(NULL, res1, "$OSNAME", uts.sysname, true); + res3 = origin_subst_one(NULL, res2, "$OSREL", uts.release, true); + res4 = origin_subst_one(NULL, res3, "$PLATFORM", uts.machine, true); return (res4); } @@ -1115,7 +1125,7 @@ digest_dynamic1(Obj_Entry *obj, int earl #endif case DT_FLAGS: - if ((dynp->d_un.d_val & DF_ORIGIN) && trust) + if (dynp->d_un.d_val & DF_ORIGIN) obj->z_origin = true; if (dynp->d_un.d_val & DF_SYMBOLIC) obj->symbolic = true; @@ -1147,7 +1157,7 @@ digest_dynamic1(Obj_Entry *obj, int earl case DT_FLAGS_1: if (dynp->d_un.d_val & DF_1_NOOPEN) obj->z_noopen = true; - if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) + if (dynp->d_un.d_val & DF_1_ORIGIN) obj->z_origin = true; if (dynp->d_un.d_val & DF_1_GLOBAL) obj->z_global = true; @@ -1198,30 +1208,33 @@ digest_dynamic1(Obj_Entry *obj, int earl } } +static bool +obj_resolve_origin(Obj_Entry *obj) +{ + + if (obj->origin_path != NULL) + return (true); + obj->origin_path = xmalloc(PATH_MAX); + return (rtld_dirname_abs(obj->path, obj->origin_path) != -1); +} + static void digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpath, const Elf_Dyn *dyn_soname, const Elf_Dyn *dyn_runpath) { - if (obj->z_origin && obj->origin_path == NULL) { - obj->origin_path = xmalloc(PATH_MAX); - if (rtld_dirname_abs(obj->path, obj->origin_path) == -1) - rtld_die(); - } - - if (dyn_runpath != NULL) { - obj->runpath = (char *)obj->strtab + dyn_runpath->d_un.d_val; - if (obj->z_origin) - obj->runpath = origin_subst(obj->runpath, obj->origin_path); - } - else if (dyn_rpath != NULL) { - obj->rpath = (char *)obj->strtab + dyn_rpath->d_un.d_val; - if (obj->z_origin) - obj->rpath = origin_subst(obj->rpath, obj->origin_path); - } + if (obj->z_origin && !obj_resolve_origin(obj)) + rtld_die(); - if (dyn_soname != NULL) - object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val); + if (dyn_runpath != NULL) { + obj->runpath = (char *)obj->strtab + dyn_runpath->d_un.d_val; + obj->runpath = origin_subst(obj, obj->runpath); + } else if (dyn_rpath != NULL) { + obj->rpath = (char *)obj->strtab + dyn_rpath->d_un.d_val; + obj->rpath = origin_subst(obj, obj->rpath); + } + if (dyn_soname != NULL) + object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val); } static void @@ -1466,12 +1479,8 @@ find_library(const char *xname, const Ob xname); return NULL; } - if (objgiven && refobj->z_origin) { - return (origin_subst(__DECONST(char *, xname), - refobj->origin_path)); - } else { - return (xstrdup(xname)); - } + return (origin_subst(__DECONST(Obj_Entry *, refobj), + __DECONST(char *, xname))); } if (libmap_disable || !objgiven || From owner-svn-src-all@FreeBSD.ORG Mon May 4 12:42:53 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 627ABA7D; Mon, 4 May 2015 12:42: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 37FE419A7; Mon, 4 May 2015 12:42: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 t44CgrtB090710; Mon, 4 May 2015 12:42:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44CgrTd090709; Mon, 4 May 2015 12:42:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201505041242.t44CgrTd090709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 4 May 2015 12:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282415 - head/usr.sbin/ntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 12:42:53 -0000 Author: cy Date: Mon May 4 12:42:52 2015 New Revision: 282415 URL: https://svnweb.freebsd.org/changeset/base/282415 Log: Restore CPU dependent compile time conditionals. MFC after: 1 month (with r281143 and r282408) Modified: head/usr.sbin/ntp/config.h Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Mon May 4 09:33:57 2015 (r282414) +++ head/usr.sbin/ntp/config.h Mon May 4 12:42:52 2015 (r282415) @@ -1469,13 +1469,21 @@ /* #undef SCO5_CLOCK */ /* The size of `char*', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_CHARP 8 +#else +#define SIZEOF_CHARP 4 +#endif /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_LONG 8 +#else +#define SIZEOF_LONG 4 +#endif /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 @@ -1490,7 +1498,11 @@ #define SIZEOF_SIGNED_CHAR 1 /* The size of `time_t', as computed by sizeof. */ +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) #define SIZEOF_TIME_T 8 +#else +#define SIZEOF_TIME_T 4 +#endif /* Does SIOCGIFCONF return size in the buffer? */ /* #undef SIZE_RETURNED_IN_BUFFER */ @@ -1516,7 +1528,15 @@ /* #undef STRERROR_R_CHAR_P */ /* canonical system (cpu-vendor-os) of where we should run */ -#define STR_SYSTEM "amd64-portbld-freebsd10.1" +#if defined(__alpha__) +#define STR_SYSTEM "alpha-undermydesk-freebsd" +#elif defined(__sparc64__) +#define STR_SYSTEM "sparc64-undermydesk-freebsd" +#elif defined(__amd64__) +#define STR_SYSTEM "amd64-undermydesk-freebsd" +#else +#define STR_SYSTEM "i386-undermydesk-freebsd" +#endif /* Does Xettimeofday take 1 arg? */ /* #undef SYSV_TIMEOFDAY */ From owner-svn-src-all@FreeBSD.ORG Mon May 4 13:29:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AF916F5; Mon, 4 May 2015 13:29:38 +0000 (UTC) Received: from relay.mailchannels.net (ar-005-i191.relay.mailchannels.net [162.253.144.73]) by mx1.freebsd.org (Postfix) with ESMTP id AC1231E51; Mon, 4 May 2015 13:29:35 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (ip-10-213-14-133.us-west-2.compute.internal [10.213.14.133]) by relay.mailchannels.net (Postfix) with ESMTPA id CF53E12181A; Mon, 4 May 2015 13:29:27 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (smtp4.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Mon, 04 May 2015 13:29:28 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1430746168194:1522415573 X-MC-Ingress-Time: 1430746168194 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp4.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YpGR3-0000tG-Ts; Mon, 04 May 2015 13:29:26 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t44DTMqP060255; Mon, 4 May 2015 07:29:22 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18ycSAWKQ9f/AqM/LM6F3J/ Message-ID: <1430746162.6170.74.camel@freebsd.org> Subject: Re: svn commit: r282415 - head/usr.sbin/ntp From: Ian Lepore To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 04 May 2015 07:29:22 -0600 In-Reply-To: <201505041242.t44CgrTd090709@svn.freebsd.org> References: <201505041242.t44CgrTd090709@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 13:29:38 -0000 On Mon, 2015-05-04 at 12:42 +0000, Cy Schubert wrote: > Author: cy > Date: Mon May 4 12:42:52 2015 > New Revision: 282415 > URL: https://svnweb.freebsd.org/changeset/base/282415 > > Log: > Restore CPU dependent compile time conditionals. > > MFC after: 1 month (with r281143 and r282408) > > Modified: > head/usr.sbin/ntp/config.h > > Modified: head/usr.sbin/ntp/config.h > ============================================================================== > --- head/usr.sbin/ntp/config.h Mon May 4 09:33:57 2015 (r282414) > +++ head/usr.sbin/ntp/config.h Mon May 4 12:42:52 2015 (r282415) > @@ -1469,13 +1469,21 @@ > /* #undef SCO5_CLOCK */ > > /* The size of `char*', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_CHARP 8 > +#else > +#define SIZEOF_CHARP 4 > +#endif > > /* The size of `int', as computed by sizeof. */ > #define SIZEOF_INT 4 > > /* The size of `long', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_LONG 8 > +#else > +#define SIZEOF_LONG 4 > +#endif > > /* The size of `long long', as computed by sizeof. */ > #define SIZEOF_LONG_LONG 8 > @@ -1490,7 +1498,11 @@ > #define SIZEOF_SIGNED_CHAR 1 > > /* The size of `time_t', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_TIME_T 8 > +#else > +#define SIZEOF_TIME_T 4 > +#endif > > /* Does SIOCGIFCONF return size in the buffer? */ > /* #undef SIZE_RETURNED_IN_BUFFER */ > @@ -1516,7 +1528,15 @@ > /* #undef STRERROR_R_CHAR_P */ > > /* canonical system (cpu-vendor-os) of where we should run */ > -#define STR_SYSTEM "amd64-portbld-freebsd10.1" > +#if defined(__alpha__) > +#define STR_SYSTEM "alpha-undermydesk-freebsd" > +#elif defined(__sparc64__) > +#define STR_SYSTEM "sparc64-undermydesk-freebsd" > +#elif defined(__amd64__) > +#define STR_SYSTEM "amd64-undermydesk-freebsd" > +#else > +#define STR_SYSTEM "i386-undermydesk-freebsd" > +#endif > > /* Does Xettimeofday take 1 arg? */ > /* #undef SYSV_TIMEOFDAY */ > I suspect arm64 should appear in the same places as amd64. arm (all flavors) should also be in the list of 8-byte time_t. Should NTP_KEYSDIR be /usr/etc rather than /usr/local/etc for the base daemon? (/usr/local shows up in a couple places in config.h) I think WORDS_BIGENDIAN needs to be defined on the platforms where that's true. The list of ifdefs for STR_SYSTEM seems a bit beyond its sell-by date. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon May 4 13:34:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB07BAE2; Mon, 4 May 2015 13:34:09 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 422581FEE; Mon, 4 May 2015 13:34:09 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t44DY0Oe060598 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 4 May 2015 16:34:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t44DY0Oe060598 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t44DY0d1060597; Mon, 4 May 2015 16:34:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 May 2015 16:34:00 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282415 - head/usr.sbin/ntp Message-ID: <20150504133400.GH2390@kib.kiev.ua> References: <201505041242.t44CgrTd090709@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201505041242.t44CgrTd090709@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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 13:34:09 -0000 On Mon, May 04, 2015 at 12:42:53PM +0000, Cy Schubert wrote: > Author: cy > Date: Mon May 4 12:42:52 2015 > New Revision: 282415 > URL: https://svnweb.freebsd.org/changeset/base/282415 > > Log: > Restore CPU dependent compile time conditionals. > > MFC after: 1 month (with r281143 and r282408) > > Modified: > head/usr.sbin/ntp/config.h > > Modified: head/usr.sbin/ntp/config.h > ============================================================================== > --- head/usr.sbin/ntp/config.h Mon May 4 09:33:57 2015 (r282414) > +++ head/usr.sbin/ntp/config.h Mon May 4 12:42:52 2015 (r282415) > @@ -1469,13 +1469,21 @@ > /* #undef SCO5_CLOCK */ > > /* The size of `char*', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_CHARP 8 > +#else > +#define SIZEOF_CHARP 4 > +#endif > > /* The size of `int', as computed by sizeof. */ > #define SIZEOF_INT 4 > > /* The size of `long', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_LONG 8 > +#else > +#define SIZEOF_LONG 4 > +#endif > > /* The size of `long long', as computed by sizeof. */ > #define SIZEOF_LONG_LONG 8 > @@ -1490,7 +1498,11 @@ > #define SIZEOF_SIGNED_CHAR 1 > > /* The size of `time_t', as computed by sizeof. */ > +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) > #define SIZEOF_TIME_T 8 > +#else > +#define SIZEOF_TIME_T 4 > +#endif We definitely do not support alpha. What about other 64bit architectures, like mips64 with 64bit ABI, powerpc64, or arm64 ? From owner-svn-src-all@FreeBSD.ORG Mon May 4 14:23:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFD4869B; Mon, 4 May 2015 14:23: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 AE9561507; Mon, 4 May 2015 14:23: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 t44ENWsl040430; Mon, 4 May 2015 14:23:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44ENWgL040429; Mon, 4 May 2015 14:23:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505041423.t44ENWgL040429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 May 2015 14:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282416 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 14:23:32 -0000 Author: jhb Date: Mon May 4 14:23:31 2015 New Revision: 282416 URL: https://svnweb.freebsd.org/changeset/base/282416 Log: Partially revert r255486, the first argument to socketpair() is a socket domain, not a file descriptor. Use 'domain' instead of the original 'd' for this argument to match socket(2). PR: 199491 Reported by: sp55aa@qq.com MFC after: 1 week Modified: head/lib/libc/sys/socketpair.2 Modified: head/lib/libc/sys/socketpair.2 ============================================================================== --- head/lib/libc/sys/socketpair.2 Mon May 4 12:42:52 2015 (r282415) +++ head/lib/libc/sys/socketpair.2 Mon May 4 14:23:31 2015 (r282416) @@ -28,7 +28,7 @@ .\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 11, 2013 +.Dd May 4, 2015 .Dt SOCKETPAIR 2 .Os .Sh NAME @@ -40,13 +40,13 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn socketpair "int fd" "int type" "int protocol" "int *sv" +.Fn socketpair "int domain" "int type" "int protocol" "int *sv" .Sh DESCRIPTION The .Fn socketpair system call creates an unnamed pair of connected sockets in -the specified domain -.Fa fd , +the specified communications +.Fa domain , of the specified .Fa type , and using the optionally specified From owner-svn-src-all@FreeBSD.ORG Mon May 4 14:47:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C106D86; Mon, 4 May 2015 14:47: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 E52B01795; Mon, 4 May 2015 14:47: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 t44El06O050885; Mon, 4 May 2015 14:47:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44El03Y050884; Mon, 4 May 2015 14:47:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505041447.t44El03Y050884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 4 May 2015 14:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282417 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 14:47:01 -0000 Author: jhb Date: Mon May 4 14:47:00 2015 New Revision: 282417 URL: https://svnweb.freebsd.org/changeset/base/282417 Log: Various updates to the ftruncate(2) documentation: - Note that ftruncate(2) can operate on shared memory objects and cross reference shm_open(2). - Note that ftruncate(2) does not change the file position pointer (aka seek pointer) of the file descriptor. - ftruncate(2) will fail with EINVAL for all sorts of other fd types than just sockets, so instead note that it fails for all but regular files and shared memory objects. - Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2). (Or at least the manpage for both appeared in 4.2, I did not check the kernel code itself to see if either predated 4.2.) PR: 199472 (2) Submitted by: andrew@ugh.net.au (2) MFC after: 1 week Modified: head/lib/libc/sys/truncate.2 Modified: head/lib/libc/sys/truncate.2 ============================================================================== --- head/lib/libc/sys/truncate.2 Mon May 4 14:23:31 2015 (r282416) +++ head/lib/libc/sys/truncate.2 Mon May 4 14:47:00 2015 (r282417) @@ -28,7 +28,7 @@ .\" @(#)truncate.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd May 4, 2015 .Dt TRUNCATE 2 .Os .Sh NAME @@ -60,9 +60,18 @@ is lost. If the file was smaller than this size, it will be extended as if by writing bytes with the value zero. -With -.Fn ftruncate , -the file must be open for writing. +.Pp +The +.Fn ftruncate +system call causes the file or shared memory object backing the file descriptor +.Fa fd +to be truncated or extended to +.Fa length +bytes in size. +The file descriptor must be a valid file descriptor open for writing. +The file position pointer associated with the file descriptor +.Fa fd +will not be modified. .Sh RETURN VALUES .Rv -std If the file to be modified is not a directory or @@ -129,7 +138,7 @@ is not a valid descriptor. The .Fa fd argument -references a socket, not a file. +references a file descriptor that is not a regular file or shared memory object. .It Bq Er EINVAL The .Fa fd @@ -138,11 +147,14 @@ is not open for writing. .El .Sh SEE ALSO .Xr chflags 2 , -.Xr open 2 +.Xr open 2 , +.Xr shm_open 2 .Sh HISTORY The .Fn truncate -system call appeared in +and +.Fn ftruncate +system calls appeared in .Bx 4.2 . .Sh BUGS These calls should be generalized to allow ranges From owner-svn-src-all@FreeBSD.ORG Mon May 4 14:55:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B03A41F; Mon, 4 May 2015 14:55:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59A2218CD; Mon, 4 May 2015 14:55:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44EtMxB055655; Mon, 4 May 2015 14:55:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44EtMUc055654; Mon, 4 May 2015 14:55:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505041455.t44EtMUc055654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 4 May 2015 14:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282418 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 14:55:22 -0000 Author: ian Date: Mon May 4 14:55:21 2015 New Revision: 282418 URL: https://svnweb.freebsd.org/changeset/base/282418 Log: On an icache sync by address/len, round the length up if the operation spans a cacheline boundary. PR: 199740 Submitted by: Juergen Weiss Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Mon May 4 14:47:00 2015 (r282417) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Mon May 4 14:55:21 2015 (r282418) @@ -266,6 +266,9 @@ END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_icache_line_size ldr ip, [ip] + sub r3, ip, #1 /* Address need not be aligned, but */ + and r2, r0, r3 /* round length up if op spans line */ + add r1, r1, r2 /* boundary: len += addr & linemask; */ .Larmv7_sync_next: mcr CP15_DCCMVAC(r0) mcr CP15_ICIMVAU(r0) From owner-svn-src-all@FreeBSD.ORG Mon May 4 15:04:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F613942; Mon, 4 May 2015 15:04: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 4E7F819FC; Mon, 4 May 2015 15:04: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 t44F4etd060792; Mon, 4 May 2015 15:04:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44F4ePQ060791; Mon, 4 May 2015 15:04:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505041504.t44F4ePQ060791@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 15:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282419 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 15:04:40 -0000 Author: gjb Date: Mon May 4 15:04:39 2015 New Revision: 282419 URL: https://svnweb.freebsd.org/changeset/base/282419 Log: Add logic to detect if the net/bsdec2-image-upload port needs to be installed. [1] For the cw-ec2-portinstall and ec2ami targets, touch the .TARGET file after completion to prevent duplicate invocations. Add cw-ec2-portinstall and ec2ami to CLEANFILES. Submitted by: cperciva[1] MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Mon May 4 14:55:21 2015 (r282418) +++ head/release/Makefile.ec2 Mon May 4 15:04:39 2015 (r282419) @@ -12,6 +12,15 @@ AMINAMESUFFIX!= date +-%Y-%m-%d PUBLISH= --public .endif +CLEANFILES+= ec2ami + +.if !exists(/usr/local/bin/bsdec2-image-upload) +CW_EC2_PORTINSTALL= cw-ec2-portinstall +CLEANFILES+= ${CW_EC2_PORTINSTALL} +.else +CW_EC2_PORTINSTALL= +.endif + cw-ec2-portinstall: .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile) make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean @@ -21,8 +30,10 @@ cw-ec2-portinstall: . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/bsdec2-image-upload .endif + @touch ${.TARGET} -ec2ami: cw-ec2 cw-ec2-portinstall +ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} + @false .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) @echo "--------------------------------------------------------------" @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation" @@ -46,3 +57,4 @@ ec2ami: cw-ec2 cw-ec2-portinstall "${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX}" \ "${TYPE} ${REVISION}-${BRANCH}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} + @touch ${.TARGET} From owner-svn-src-all@FreeBSD.ORG Mon May 4 15:45:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC659832; Mon, 4 May 2015 15:45: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 875FC1F2A; Mon, 4 May 2015 15:45:09 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 89561B9B0; Mon, 4 May 2015 11:45:08 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Date: Mon, 04 May 2015 09:58:49 -0400 Message-ID: <26088556.xbkUe5VAyp@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150502191000.GE546@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2197979.EUYqekgM4M@ralph.baldwin.cx> <20150502191000.GE546@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 May 2015 11:45:08 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 15:45:09 -0000 On Saturday, May 02, 2015 10:10:00 PM Gleb Smirnoff wrote: > On Fri, May 01, 2015 at 10:47:43AM -0400, John Baldwin wrote: > J> > J> > While you are here, let me remind you about this plan: > J> > J> > > J> > J> > https://lists.freebsd.org/pipermail/svn-src-head/2014-October/063575.html > J> > J> > > J> > J> > We can prototype the API to userland now, write down a utility that uses > J> > J> > it, or add the functionality to an existing utility. And start with Intel > J> > J> > drivers, that seem to be most interested in extra stats. > J> > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > J> > J> We well need more explicitly knowledge of queues outside of drivers > J> > J> and in the stack itself to support a generic framework for per-queue > J> > J> stats. > J> > > J> > This depends on how generic we want the API to be. Of course, we can add > J> > an extra argument to if_get_counter(). > J> > > J> > However, if we don't expect the number of queues to exceed a reasonable > J> > number of 255 :), we can fit the functionality into existing API. > J> > We can keep the queue number in the highest 8 bits of the ift_counter > J> > parameter. > J> > > J> > #define IFCOUNTER_MASK 0x00ffffff > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > J> > J> I'd prefer that expose queues more directly and figure out how to handle > J> per-queue stats then (e.g. do we have some sort of driver-independent > J> structure that each ifnet has 1 or more of that maps to a queue and has > J> driver provided methods, etc. If so you could have a driver method for > J> queue stats). Note that I did use if_get_counter to report the > J> per-interface stats instead of adding a new sysctl. > > What do you prefer: an extra argument to the if_get_counter() or a extra > ifop? As I said, I'd prefer we expose queues to the stack more directly complete with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though probably more like the old if_start). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:28:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 209DF6BC; Mon, 4 May 2015 16:28: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 0D17F13D7; Mon, 4 May 2015 16:28: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 t44GSvwX002379; Mon, 4 May 2015 16:28:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44GStT1002366; Mon, 4 May 2015 16:28:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041628.t44GStT1002366@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 16:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282420 - in head: . etc/mtree lib/libevent lib/libucl share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:28:58 -0000 Author: bapt Date: Mon May 4 16:28:54 2015 New Revision: 282420 URL: https://svnweb.freebsd.org/changeset/base/282420 Log: Rework PRIVATELIB Now when a lib is marked as PRIVATELIB it is renamed into libprivate$foo instead of being installed in /usr/lib/private and playing with rpath. Also allow to install headers for PRIVATELIBS in that case the headers will be installed in /usr/include/private/$foo Keep the headers under a private namespace to prevent third party build system to easily find them to ensure they are only used on purpose. This allows for non base applications to statically link against a library in base which is linked to a privatelib Treating PRIVATELIBS as regular libraries allows to push them into our current compatX packages if needed. While here finish promotion of libevent as PRIVATELIB Install header for bsdstat and libucl Differential Revision: https://reviews.freebsd.org/D2365 Reviewed by: brooks, des Discussed with: imp Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist head/lib/libevent/Makefile head/lib/libucl/Makefile head/share/mk/atf.test.mk head/share/mk/bsd.incs.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/share/mk/src.libnames.mk Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 4 15:04:39 2015 (r282419) +++ head/ObsoleteFiles.inc Mon May 4 16:28:54 2015 (r282420) @@ -38,6 +38,29 @@ # xargs -n1 | sort | uniq -d; # done +# 20150504 +OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 +OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 +OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 +OLD_LIBS+=usr/lib32/private/libsqlite3.so.0 +OLD_LIBS+=usr/lib32/private/libunbound.so.5 +OLD_LIBS+=usr/lib32/private/libatf-c.so.1 +OLD_LIBS+=usr/lib32/private/libheimipcc.so.11 +OLD_LIBS+=usr/lib32/private/libldns.so.5 +OLD_LIBS+=usr/lib32/private/libssh.so.5 +OLD_LIBS+=usr/lib32/private/libucl.so.1 +OLD_DIRS+=usr/lib32/private +OLD_LIBS+=usr/lib/private/libatf-c++.so.2 +OLD_LIBS+=usr/lib/private/libbsdstat.so.1 +OLD_LIBS+=usr/lib/private/libheimipcs.so.11 +OLD_LIBS+=usr/lib/private/libsqlite3.so.0 +OLD_LIBS+=usr/lib/private/libunbound.so.5 +OLD_LIBS+=usr/lib/private/libatf-c.so.1 +OLD_LIBS+=usr/lib/private/libheimipcc.so.11 +OLD_LIBS+=usr/lib/private/libldns.so.5 +OLD_LIBS+=usr/lib/private/libssh.so.5 +OLD_LIBS+=usr/lib/private/libucl.so.1 +OLD_DIRS+=usr/lib/private # 20150501 OLD_FILES+=usr/bin/soeliminate OLD_FILES+=usr/share/man/man1/soeliminate.1.gz Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon May 4 15:04:39 2015 (r282419) +++ head/etc/mtree/BSD.usr.dist Mon May 4 16:28:54 2015 (r282420) @@ -8,6 +8,12 @@ bin .. include + private + bsdstat + .. + ucl + .. + .. .. lib aout @@ -32,16 +38,12 @@ .. i18n .. - private - .. .. lib32 dtrace .. i18n .. - private - .. .. libdata gcc Modified: head/lib/libevent/Makefile ============================================================================== --- head/lib/libevent/Makefile Mon May 4 15:04:39 2015 (r282419) +++ head/lib/libevent/Makefile Mon May 4 16:28:54 2015 (r282420) @@ -7,7 +7,6 @@ LIB= event SHLIB_MAJOR= 1 PRIVATELIB= -INTERNALLIB= SRCS= buffer.c evbuffer.c event.c kqueue.c log.c poll.c select.c signal.c HDRS= event.h Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Mon May 4 15:04:39 2015 (r282419) +++ head/lib/libucl/Makefile Mon May 4 16:28:54 2015 (r282420) @@ -14,8 +14,10 @@ SRCS= ucl_emitter_streamline.c \ ucl_util.c \ xxhash.c -.PATH: ${LIBUCL}/src +.PATH: ${LIBUCL}/src \ + ${LIBUCL}/include +INCS= ucl.h LIBADD= m WARNS= 1 Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/atf.test.mk Mon May 4 16:28:54 2015 (r282420) @@ -72,11 +72,10 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}.c DPADD.${_T}+= ${LIBATF_C} .if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static) -LDADD.${_T}+= ${LDATF_C} +LDADD.${_T}+= ${LDADD_atf_c} .else LDADD.${_T}+= ${LIBATF_C} .endif -USEPRIVATELIB+= atf-c TEST_INTERFACE.${_T}= atf .endfor .endif @@ -90,11 +89,10 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc} DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static) -LDADD.${_T}+= ${LDATF_CXX} ${LDATF_C} +LDADD.${_T}+= ${LDADD_atf_cxx} ${LDADD_atf_c} .else LDADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .endif -USEPRIVATELIB+= atf-c++ TEST_INTERFACE.${_T}= atf .endfor .endif Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/bsd.incs.mk Mon May 4 16:28:54 2015 (r282420) @@ -23,7 +23,7 @@ all: buildincludes ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} -${group}DIR?= ${INCLUDEDIR} +${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}} _${group}INCS= .for header in ${${group}} Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/bsd.lib.mk Mon May 4 16:28:54 2015 (r282420) @@ -11,6 +11,7 @@ _LD= ${CXX} _LD= ${CC} .endif +LIB_PRIVATE= ${PRIVATELIB:Dprivate} # Set up the variables controlling shared libraries. After this section, # SHLIB_NAME will be defined only if we are to create a shared library. # SHLIB_LINK will be defined only if we are to create a link to it. @@ -23,7 +24,7 @@ _LD= ${CC} SHLIB= ${LIB} .endif .if !defined(SHLIB_NAME) && defined(SHLIB) && defined(SHLIB_MAJOR) -SHLIB_NAME= lib${SHLIB}.so.${SHLIB_MAJOR} +SHLIB_NAME= lib${LIB_PRIVATE}${SHLIB}.so.${SHLIB_MAJOR} .endif .if defined(SHLIB_NAME) && !empty(SHLIB_NAME:M*.so.*) SHLIB_LINK?= ${SHLIB_NAME:R} @@ -128,13 +129,8 @@ PO_FLAG=-pg all: beforebuild .WAIT beforebuild: objwarn -.if defined(PRIVATELIB) -_LIBDIR:=${LIBPRIVATEDIR} -_SHLIBDIR:=${LIBPRIVATEDIR} -.else _LIBDIR:=${LIBDIR} _SHLIBDIR:=${SHLIBDIR} -.endif .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" @@ -162,19 +158,15 @@ ${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -rpath ${LIBPRIVATEDIR} -.endif - .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:R:S/$/.o/} NOPATH_FILES+= ${OBJS} .endif .if defined(LIB) && !empty(LIB) -_LIBS= lib${LIB}.a +_LIBS= lib${LIB_PRIVATE}${LIB}.a -lib${LIB}.a: ${OBJS} ${STATICOBJS} +lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} @@ -184,11 +176,11 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .if !defined(INTERNALLIB) .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) -_LIBS+= lib${LIB}_p.a +_LIBS+= lib${LIB_PRIVATE}${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} NOPATH_FILES+= ${POBJS} -lib${LIB}_p.a: ${POBJS} +lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} @@ -243,9 +235,9 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} .endif #defined(SHLIB_NAME) .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" -_LIBS+= lib${LIB}_pic.a +_LIBS+= lib${LIB_PRIVATE}${LIB}_pic.a -lib${LIB}_pic.a: ${SOBJS} +lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} @@ -305,13 +297,13 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${i realinstall: _libinstall .ORDER: beforeinstall _libinstall _libinstall: -.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" && !defined(PRIVATELIB) +.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR} .endif -.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) && !defined(PRIVATELIB) +.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR} .endif .if defined(SHLIB_NAME) ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -325,7 +317,7 @@ _libinstall: ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} .endif -.if defined(SHLIB_LINK) && !defined(PRIVATELIB) +.if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory # prefix where shared objects will be installed by the install target. @@ -366,7 +358,7 @@ _libinstall: .endif # SHLIB_LDSCRIPT .endif # SHLIB_LINK .endif # SHIB_NAME -.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" && !defined(PRIVATELIB) +.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR} .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/bsd.prog.mk Mon May 4 16:28:54 2015 (r282420) @@ -51,10 +51,6 @@ STRIP?= -s LDFLAGS+= -static .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR} -.endif - .if ${MK_DEBUG_FILES} != "no" PROG_FULL=${PROG}.full # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon May 4 15:04:39 2015 (r282419) +++ head/share/mk/src.libnames.mk Mon May 4 16:28:54 2015 (r282420) @@ -15,6 +15,7 @@ _PRIVATELIBS= \ atf_c \ atf_cxx \ bsdstat \ + event \ heimipcc \ heimipcs \ ldns \ @@ -28,7 +29,6 @@ _INTERNALIBS= \ bsnmptools \ cron \ elftc \ - event \ fifolog \ ipf \ lpr \ @@ -233,18 +233,25 @@ _DP_vmmapi= util # Define spacial cases LDADD_supcplusplus= -lsupc++ -LDADD_atf_c= -L${LIBATF_CDIR} -latf-c -LDADD_atf_cxx= -L${LIBATF_CXXDIR} -latf-c++ +LIBATF_C= $(DESTDIR)$(LIBDIR)/libprivateatf-c.a +LIBATF_CXX= $(DESTDIR)$(LIBDIR)/libprivateatf-c++.a +LDADD_atf_c= -lprivateatf-c +LDADD_atf_cxx= -lprivateatf-c++ + +.for _l in ${_PRIVATELIBS} +LIB${_l:tu}?= ${DESTDIR}${LIBDIR}/libprivate${_l}.a +.endfor .for _l in ${_LIBRARIES} -.if ${_PRIVATELIBS:M${_l}} -LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} -.endif .if ${_INTERNALIBS:M${_l}} LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} .endif DPADD_${_l}?= ${LIB${_l:tu}} +.if ${_PRIVATELIBS:M${_l}} +LDADD_${_l}?= -lprivate${_l} +.else LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l} +.endif .if defined(_DP_${_l}) && defined(NO_SHARED) .for _d in ${_DP_${_l}} DPADD_${_l}+= ${DPADD_${_d}} @@ -253,12 +260,12 @@ LDADD_${_l}+= ${LDADD_${_d}} .endif .endfor -DPADD_sqlite3+= ${DPADD_pthread} -LDADD_sqlite3+= ${LDADD_pthread} - DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} +DPADD_sqlite3+= ${DPADD_pthread} +LDADD_sqlite3+= ${LDADD_pthread} + DPADD_fifolog+= ${DPADD_z} LDADD_fifolog+= ${LDADD_z} @@ -290,55 +297,15 @@ LDADD+= ${LDADD_${_l}} .error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif -.if defined(USEPRIVATELIB) -LDFLAGS+= -rpath ${LIBPRIVATEDIR} -.endif - -LIBATF_CDIR= ${ROOTOBJDIR}/lib/atf/libatf-c -LDATF_C?= ${LIBATF_CDIR}/libatf-c.so -LIBATF_C?= ${LIBATF_CDIR}/libatf-c.a - -LIBATF_CXXDIR= ${ROOTOBJDIR}/lib/atf/libatf-c++ -LDATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.so -LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.a - -LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat -LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a - LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc -LDELFTC?= ${LIBELFTCDIR}/libelftc.a LIBELFTC?= ${LIBELFTCDIR}/libelftc.a -LIBEVENTDIR= ${ROOTOBJDIR}/lib/libevent -LIBEVENT?= ${LIBEVENTDIR}/libevent.a - -LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc -LIBHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.a - -LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs -LIBHEIMIPCS?= ${LIBHEIMIPCSDIR}/libheimipcs.a - -LIBLDNSDIR= ${ROOTOBJDIR}/lib/libldns -LIBLDNS?= ${LIBLDNSDIR}/libldns.a - -LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh -LIBSSH?= ${LIBSSHDIR}/libssh.a - -LIBUNBOUNDDIR= ${ROOTOBJDIR}/lib/libunbound -LIBUNBOUND?= ${LIBUNBOUNDDIR}/libunbound.a - -LIBUCLDIR= ${ROOTOBJDIR}/lib/libucl -LIBUCL?= ${LIBUCLDIR}/libucl.a - LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash LIBOHASH?= ${LIBOHASHDIR}/libohash.a -LIBSQLITE3DIR= ${ROOTOBJDIR}/lib/libsqlite3 -LIBSQLITE3?= ${LIBSQLITE3DIR}/libsqlite3.a - LIBMANDOCDIR= ${ROOTOBJDIR}/lib/libmandoc LIBMANDOC?= ${LIBMANDOCDIR}/libmandoc.a From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:34:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84E758A6; Mon, 4 May 2015 16:34: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 734DA1509; Mon, 4 May 2015 16:34: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 t44GY9X1006743; Mon, 4 May 2015 16:34:09 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44GY9OV006741; Mon, 4 May 2015 16:34:09 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041634.t44GY9OV006741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 16:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282421 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 16:34:09 -0000 Author: bapt Date: Mon May 4 16:34:08 2015 New Revision: 282421 URL: https://svnweb.freebsd.org/changeset/base/282421 Log: Remove now unneeded libmap32.conf Deleted: head/etc/libmap32.conf Modified: head/ObsoleteFiles.inc head/etc/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 4 16:28:54 2015 (r282420) +++ head/ObsoleteFiles.inc Mon May 4 16:34:08 2015 (r282421) @@ -39,6 +39,7 @@ # done # 20150504 +OLD_FILES+=etc/libmap32.conf OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon May 4 16:28:54 2015 (r282420) +++ head/etc/Makefile Mon May 4 16:34:08 2015 (r282421) @@ -54,10 +54,6 @@ BIN1= crontab \ syslog.conf \ termcap.small -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -BIN1+= libmap32.conf -.endif - .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:39:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 322BBA66 for ; Mon, 4 May 2015 16:39:07 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFFC1562 for ; Mon, 4 May 2015 16:39:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44Gd6cG089514 for ; Mon, 4 May 2015 16:39:06 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44Gd6AM089511 for svn-src-all@freebsd.org; Mon, 4 May 2015 16:39:06 GMT (envelope-from bdrewery) Received: (qmail 91156 invoked from network); 4 May 2015 11:39:04 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 11:39:04 -0500 Message-ID: <5547A0AE.4040809@FreeBSD.org> Date: Mon, 04 May 2015 11:39:10 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282318 - in head: . gnu/usr.bin/groff/src/preproc tools/build/mk usr.bin usr.bin/soelim usr.bin/soeliminate References: <201505012008.t41K8QUk048909@svn.freebsd.org> In-Reply-To: <201505012008.t41K8QUk048909@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8vwModu9k2RPcaivpnM4vG8AppfWwKwkU" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 16:39:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8vwModu9k2RPcaivpnM4vG8AppfWwKwkU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/1/2015 3:08 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Fri May 1 20:08:25 2015 > New Revision: 282318 > URL: https://svnweb.freebsd.org/changeset/base/282318 >=20 > Log: > Replace groff's soelim by soeliminate(1) renamed soelim(1) >=20 > Added: > head/usr.bin/soelim/ > - copied from r281993, head/usr.bin/soeliminate/ > head/usr.bin/soelim/soelim.1 > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.1 > head/usr.bin/soelim/soelim.c > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.c > Deleted: > head/usr.bin/soelim/soeliminate.1 > head/usr.bin/soelim/soeliminate.c > head/usr.bin/soeliminate/ > Modified: > head/Makefile.inc1 > head/ObsoleteFiles.inc > head/gnu/usr.bin/groff/src/preproc/Makefile > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.bin/Makefile > head/usr.bin/soelim/Makefile >=20 Can you point me to some ports that failed due to this? It is relevant for my arch@ idea about checksumming jails for rebuild. I had not planned to add soelim(1) and related tools but may need to now. --=20 Regards, Bryan Drewery --8vwModu9k2RPcaivpnM4vG8AppfWwKwkU 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 iQEcBAEBAgAGBQJVR6CyAAoJEDXXcbtuRpfPuG4H/2I5n38Vqo/3seOgJ0hM+v2G UzBzEkH70LU1JT36C4NqwTL/e/co2XYfJgbpJzP6xD9OuKOpw1y8AJh5c9EDrESs SdV/8LqFXem5nVzSDxRChZOOBy0Rvnx16+pwe6ZKCzQOWPgjgbaeUUvc9G8WL4iS I+haJ/ANzkFOoWOReXUrTDTOL0DM5x43tcoJNYLY055c2bs1OrvjNaDUHnyqKhDW L3Os10cpkBFdkmPg47kuP7iGUkpmdcPJVMcO6rtqX2PU2KsLs2Gc7qIUdy4YhYuf ReBBTUvyrpXECWnhTVcBaReLvfxLUCtMBRqwaT8znfqvIXQDfUItE5JVr1jvzYE= =zLcA -----END PGP SIGNATURE----- --8vwModu9k2RPcaivpnM4vG8AppfWwKwkU-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:41:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 134A2C88; Mon, 4 May 2015 16:41:49 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A330E1639; Mon, 4 May 2015 16:41:48 +0000 (UTC) Received: by wgyo15 with SMTP id o15so156199394wgy.2; Mon, 04 May 2015 09:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=PpPRTM7JmmcFTFvELa1UT+C6nEIuf5tfltrkzaJWQBs=; b=w2c9m0+BkeppTyR51wyke9E56DL7WtlRr1UgmlxuY8UWAwcUevsWSVohBPLW5leplX suvo4yZEwaLHIq63D7zvLqeP2wt4ORyqdHPLBaNuXW2PMxnPo9Iy2e7dcb3Sm7x9QjNg xPjNk9iTKeIPqj93b6yhwvw8F+f+n6Bd+yEyQsBhvFMs6EB2Rg0bSNYfuHwn46fY8RIE sWsKohqPD9yWMUWzGIKqG3gG5K1BFECregQxV+73T46D8y88MVcJNhkvFX/WYZKhcJQ7 0CbWOlJIRuADl02DeBEwUYmqVcVZUAbRwKatFzmRre5VSIoJ9G4Q/Vy55YOa0BayW1ti YJew== X-Received: by 10.194.248.132 with SMTP id ym4mr44652404wjc.74.1430757707020; Mon, 04 May 2015 09:41:47 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id o5sm11864787wia.0.2015.05.04.09.41.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 09:41:45 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 4 May 2015 18:41:44 +0200 From: Baptiste Daroussin To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282318 - in head: . gnu/usr.bin/groff/src/preproc tools/build/mk usr.bin usr.bin/soelim usr.bin/soeliminate Message-ID: <20150504164144.GC80213@ivaldir.etoilebsd.net> References: <201505012008.t41K8QUk048909@svn.freebsd.org> <5547A0AE.4040809@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JWEK1jqKZ6MHAcjA" Content-Disposition: inline In-Reply-To: <5547A0AE.4040809@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:41:49 -0000 --JWEK1jqKZ6MHAcjA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 04, 2015 at 11:39:10AM -0500, Bryan Drewery wrote: > On 5/1/2015 3:08 PM, Baptiste Daroussin wrote: > > Author: bapt > > Date: Fri May 1 20:08:25 2015 > > New Revision: 282318 > > URL: https://svnweb.freebsd.org/changeset/base/282318 > >=20 > > Log: > > Replace groff's soelim by soeliminate(1) renamed soelim(1) > >=20 > > Added: > > head/usr.bin/soelim/ > > - copied from r281993, head/usr.bin/soeliminate/ > > head/usr.bin/soelim/soelim.1 > > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.1 > > head/usr.bin/soelim/soelim.c > > - copied, changed from r281993, head/usr.bin/soeliminate/soelimina= te.c > > Deleted: > > head/usr.bin/soelim/soeliminate.1 > > head/usr.bin/soelim/soeliminate.c > > head/usr.bin/soeliminate/ > > Modified: > > head/Makefile.inc1 > > head/ObsoleteFiles.inc > > head/gnu/usr.bin/groff/src/preproc/Makefile > > head/tools/build/mk/OptionalObsoleteFiles.inc > > head/usr.bin/Makefile > > head/usr.bin/soelim/Makefile > >=20 >=20 > Can you point me to some ports that failed due to this? It is relevant > for my arch@ idea about checksumming jails for rebuild. I had not > planned to add soelim(1) and related tools but may need to now. >=20 >=20 > --=20 > Regards, > Bryan Drewery >=20 Only openldap to my knowledge Bapt --JWEK1jqKZ6MHAcjA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlVHoUgACgkQ8kTtMUmk6EzA1QCfaMkkXsKNk9AXwPTgptRMEWMg hrMAnR/pzUuquKg4L2hCktbDoAG+3WeX =LuNK -----END PGP SIGNATURE----- --JWEK1jqKZ6MHAcjA-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:42:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13638DDA for ; Mon, 4 May 2015 16:42:21 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D25111644 for ; Mon, 4 May 2015 16:42:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44GgKhI092716 for ; Mon, 4 May 2015 16:42:20 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44GgKCt092711 for svn-src-all@freebsd.org; Mon, 4 May 2015 16:42:20 GMT (envelope-from bdrewery) Received: (qmail 31105 invoked from network); 4 May 2015 11:42:19 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 11:42:19 -0500 Message-ID: <5547A175.2010408@FreeBSD.org> Date: Mon, 04 May 2015 11:42:29 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282420 - in head: . etc/mtree lib/libevent lib/libucl share/mk References: <201505041628.t44GStT1002366@svn.freebsd.org> In-Reply-To: <201505041628.t44GStT1002366@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 16:42:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/4/2015 11:28 AM, Baptiste Daroussin wrote: > +LIBATF_C=3D $(DESTDIR)$(LIBDIR)/libprivateatf-c.a > +LIBATF_CXX=3D $(DESTDIR)$(LIBDIR)/libprivateatf-c++.a > +LDADD_atf_c=3D -lprivateatf-c > +LDADD_atf_cxx=3D -lprivateatf-c++ > + > +.for _l in ${_PRIVATELIBS} > +LIB${_l:tu}?=3D ${DESTDIR}${LIBDIR}/libprivate${_l}.a Style-wise I see bugs here. Let's stick to () or {}. --=20 Regards, Bryan Drewery --fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS 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 iQEcBAEBAgAGBQJVR6F1AAoJEDXXcbtuRpfPdjEIAJVsaWfnzzA1g3UUOZumaPfQ WiviRx/UvfxmlzaDx+xM44X+S3f3Pg65MtIeN7uo/WjINj/xEk/+ZcBDUVv80Z2x FgqB2roLKnMN5SL4LZEbsfaAvEWkgXJZFeVh2mUj+PY6mwd4Bt/R8M0MYjBLyoS0 NXd9f6DeRQpsu8hcz8mcfFJst/UOMsvPTTmmyNlAW7HjKMZT4bQIrvWq4drpqkG/ wqRwHhVDZ2GrrI5iRNjJOM4RNisytMvDWqXXgrckiXPOstmuD8pGuhixFCEwdHwS UHl/F/h+I+iX9tuMXYh3WBIwlQ8iOuwuLPR7DarxiG3sP1SjCGCaq2CD6EFOiFM= =QZwC -----END PGP SIGNATURE----- --fvAxgqvlVQVn51XhMWfgxrPPrLOkIfARS-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:51:05 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F8E73A2 for ; Mon, 4 May 2015 16:51:05 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB821761 for ; Mon, 4 May 2015 16:51:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44Gp4uM093149 for ; Mon, 4 May 2015 16:51:04 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44Gp4wI093144 for svn-src-all@freebsd.org; Mon, 4 May 2015 16:51:04 GMT (envelope-from bdrewery) Received: (qmail 40321 invoked from network); 4 May 2015 11:51:03 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 11:51:03 -0500 Message-ID: <5547A382.6070707@FreeBSD.org> Date: Mon, 04 May 2015 11:51:14 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282421 - in head: . etc References: <201505041634.t44GY9OV006741@svn.freebsd.org> In-Reply-To: <201505041634.t44GY9OV006741@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 16:51:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/4/2015 11:34 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon May 4 16:34:08 2015 > New Revision: 282421 > URL: https://svnweb.freebsd.org/changeset/base/282421 >=20 > Log: > Remove now unneeded libmap32.conf This doesn't explain why; the commit message is useless. "Because r282420 ..." >=20 > Deleted: > head/etc/libmap32.conf > Modified: > head/ObsoleteFiles.inc > head/etc/Makefile >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc Mon May 4 16:28:54 2015 (r282420) > +++ head/ObsoleteFiles.inc Mon May 4 16:34:08 2015 (r282421) > @@ -39,6 +39,7 @@ > # done > =20 > # 20150504 > +OLD_FILES+=3Detc/libmap32.conf This seems dangerous. I think only files no longer useful in any context should be added here. A user may have their own libmap32.conf that this would remove. Mergemaster/etcupdate might handle this case fine without delete-old. There are several other bugs with libmap32.conf: There's no manpage. There's no default /usr/local/etc/libmap32.d dir or entry. --=20 Regards, Bryan Drewery --vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs 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 iQEcBAEBAgAGBQJVR6OCAAoJEDXXcbtuRpfPG+IIAKR287GRU5N+dUK2puz/LYjR l3c/+FSP5SkdO9nj8+cJGHsyWiNSB/xIVUOKAM2aQ9YOFKXVsOrIBGo0Q+/C8RXL kICMsIy24hs8NIpZ7htVDVnZVm5JNViKzppZmiglOJm/En047vzVVJCQjIE9TVfY zlbzD+i2B7AGT6qBS7z1UMw36mQiv7GPzfnn82ppIRHXCIKwSLcMxO8PajYTSD4W 55t18pLccI8pm4H9T9BPqracWNGJ5NlilztpogpLNdX5bnR0RRb82oMqnA0VJZzQ otFXfATfpaB614CJJ3dklwWwCrMc+xUo/2KaLF/0XkN9bjEL2TsDcVKugBF2U4Q= =NRBv -----END PGP SIGNATURE----- --vf1Id4nejvtQlOW8hphsu1POdTKX3Q3vs-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 16:59:10 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C28CB98C; Mon, 4 May 2015 16:59: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 B0F4A17ED; Mon, 4 May 2015 16:59: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 t44GxAkH017529; Mon, 4 May 2015 16:59:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44GxAQO017528; Mon, 4 May 2015 16:59:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041659.t44GxAQO017528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 16:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282422 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 16:59:10 -0000 Author: bapt Date: Mon May 4 16:59:09 2015 New Revision: 282422 URL: https://svnweb.freebsd.org/changeset/base/282422 Log: Style fix Reported by: bdrewery Modified: head/share/mk/src.libnames.mk Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon May 4 16:34:08 2015 (r282421) +++ head/share/mk/src.libnames.mk Mon May 4 16:59:09 2015 (r282422) @@ -233,8 +233,8 @@ _DP_vmmapi= util # Define spacial cases LDADD_supcplusplus= -lsupc++ -LIBATF_C= $(DESTDIR)$(LIBDIR)/libprivateatf-c.a -LIBATF_CXX= $(DESTDIR)$(LIBDIR)/libprivateatf-c++.a +LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a +LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a LDADD_atf_c= -lprivateatf-c LDADD_atf_cxx= -lprivateatf-c++ From owner-svn-src-all@FreeBSD.ORG Mon May 4 17:01:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27DA5B18; Mon, 4 May 2015 17: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 16A8018B5; Mon, 4 May 2015 17:01: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 t44H1pg8021605; Mon, 4 May 2015 17:01:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44H1p9O021604; Mon, 4 May 2015 17:01:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041701.t44H1p9O021604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 17:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282423 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 17:01:52 -0000 Author: bapt Date: Mon May 4 17:01:51 2015 New Revision: 282423 URL: https://svnweb.freebsd.org/changeset/base/282423 Log: Do not remove libmap32.conf in make delete-old as it may remove user modified version by mistake Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 4 16:59:09 2015 (r282422) +++ head/ObsoleteFiles.inc Mon May 4 17:01:51 2015 (r282423) @@ -39,7 +39,6 @@ # done # 20150504 -OLD_FILES+=etc/libmap32.conf OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 OLD_LIBS+=usr/lib32/private/libbsdstat.so.1 OLD_LIBS+=usr/lib32/private/libheimipcs.so.11 From owner-svn-src-all@FreeBSD.ORG Mon May 4 17:14:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09A0DE39; Mon, 4 May 2015 17:14:38 +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 D8D6019D1; Mon, 4 May 2015 17:14:37 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 04467B915; Mon, 4 May 2015 13:14:36 -0400 (EDT) From: John Baldwin To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282423 - head Date: Mon, 04 May 2015 13:14:34 -0400 Message-ID: <1807112.SEIqP93pFp@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201505041701.t44H1p9O021604@svn.freebsd.org> References: <201505041701.t44H1p9O021604@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 May 2015 13:14:36 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 17:14:38 -0000 On Monday, May 04, 2015 05:01:51 PM Baptiste Daroussin wrote: > Author: bapt > Date: Mon May 4 17:01:51 2015 > New Revision: 282423 > URL: https://svnweb.freebsd.org/changeset/base/282423 > > Log: > Do not remove libmap32.conf in make delete-old as it may remove user modified > version by mistake I think etcupdate at least will DTRT and remove it IFF it matches the originally installed version (if it has been modified it will emit a warning but leave the file in place). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 4 17:24:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3C44383 for ; Mon, 4 May 2015 17:24:32 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 803C51AF5 for ; Mon, 4 May 2015 17:24:32 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t44HOWuc007579 for ; Mon, 4 May 2015 17:24:32 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t44HOWJV007577 for svn-src-all@freebsd.org; Mon, 4 May 2015 17:24:32 GMT (envelope-from bdrewery) Received: (qmail 98287 invoked from network); 4 May 2015 12:24:27 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 4 May 2015 12:24:27 -0500 Message-ID: <5547AB55.2090404@FreeBSD.org> Date: Mon, 04 May 2015 12:24:37 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282423 - head References: <201505041701.t44H1p9O021604@svn.freebsd.org> In-Reply-To: <201505041701.t44H1p9O021604@svn.freebsd.org> OpenPGP: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 17:24:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/4/2015 12:01 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon May 4 17:01:51 2015 > New Revision: 282423 > URL: https://svnweb.freebsd.org/changeset/base/282423 >=20 > Log: > Do not remove libmap32.conf in make delete-old as it may remove user = modified > version by mistake >=20 > Modified: > head/ObsoleteFiles.inc >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc Mon May 4 16:59:09 2015 (r282422) > +++ head/ObsoleteFiles.inc Mon May 4 17:01:51 2015 (r282423) > @@ -39,7 +39,6 @@ > # done > =20 > # 20150504 > -OLD_FILES+=3Detc/libmap32.conf > OLD_LIBS+=3Dusr/lib32/private/libatf-c++.so.2 > OLD_LIBS+=3Dusr/lib32/private/libbsdstat.so.1 > OLD_LIBS+=3Dusr/lib32/private/libheimipcs.so.11 >=20 Thanks. If only we had @sample type behavior here ;) --=20 Regards, Bryan Drewery --1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW 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 iQEcBAEBAgAGBQJVR6tVAAoJEDXXcbtuRpfP5w0IAMtMRAarg4eSiWJU9qC6s6Ja tbvlaKYBZ5gE/UpKZ4pCjAZgNi5DTWuNRzQ8GqE9mEJWUE33U3UTPdF0vaUODJk4 27GvFfyWwPHKeCYhxBn0WKgs8dEs7fNfgb0HhyEh8TQsoaC5lHPYsv7gaVJSaSLn l7bteG+kr7SiNj2JPuxXd0ubcPRPEvAR4xU+gf/3CtuLU63wEPUX2WTFyDM6elV3 W8quGGoFWpJNgQ1eLp1zuOLBINn3HjIpV0eFrAIpK6fdpsr0d2/EqCv/POf5GNxp kR9KrFm9YyLtSdGUskGooR1wbebOOnaYTsVTyzKjmA1BDw9hqm4FTLRaaUbQ45o= =26Q1 -----END PGP SIGNATURE----- --1X7e5dNpGt8Wpl45Sk6XsT52FDGUm95lW-- From owner-svn-src-all@FreeBSD.ORG Mon May 4 17:59:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C470A257; Mon, 4 May 2015 17: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 B239C1EDC; Mon, 4 May 2015 17: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 t44HxehO047808; Mon, 4 May 2015 17:59:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44Hxdu3047805; Mon, 4 May 2015 17:59:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505041759.t44Hxdu3047805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 4 May 2015 17:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282424 - in head/sys: dev/usb/serial kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 17:59:40 -0000 Author: ian Date: Mon May 4 17:59:39 2015 New Revision: 282424 URL: https://svnweb.freebsd.org/changeset/base/282424 Log: Implement a mechanism for making changes in the kernel<->driver PPS interface without breaking ABI or API compatibility with existing drivers. The existing data structures used to communicate between the kernel and driver portions of PPS processing contain no spare/padding fields and no flags field or other straightforward mechanism for communicating changes in the structures or behaviors of the code. This makes it difficult to MFC new features added to the PPS facility. ABI compatibility is important; out-of-tree drivers in module form are known to exist. (Note that the existing api_version field in the pps_params structure must contain the value mandated by RFC 2783 and any RFCs that come along after.) These changes introduce a pair of abi-version fields which are filled in by the driver and the kernel respectively to indicate the interface version. The driver sets its version field before calling the new pps_init_abi() function. That lets the kernel know how much of the pps_state structure is understood by the driver and it can avoid using newer fields at the end of the structure that it knows about if the driver is a lower version. The kernel fills in its version field during the init call, letting the driver know what features and data the kernel supports. To implement the new version information in a way that is backwards compatible with code from before these changes, the high bit of the lightly-used 'kcmode' field is repurposed as a flag bit that indicates the driver is aware of the abi versioning scheme. Basically if this bit is clear that indicates a "version 0" driver and if it is set the driver_abi field indicates the version. These changes also move the recently-added 'mtx' field of pps_state from the middle to the end of the structure, and make the kernel code that uses this field conditional on the driver being abi version 1 or higher. It changes the only driver currently supplying the mtx field, usb_serial, to use pps_init_abi(). Reviewed by: hselasky@ Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/kern/kern_tc.c head/sys/sys/timepps.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon May 4 17:01:51 2015 (r282423) +++ head/sys/dev/usb/serial/usb_serial.c Mon May 4 17:59:39 2015 (r282424) @@ -415,8 +415,9 @@ ucom_attach_tty(struct ucom_super_softc sc->sc_tty = tp; sc->sc_pps.ppscap = PPS_CAPTUREBOTH; - sc->sc_pps.mtx = sc->sc_mtx; - pps_init(&sc->sc_pps); + sc->sc_pps.driver_abi = PPS_ABI_VERSION; + sc->sc_pps.driver_mtx = sc->sc_mtx; + pps_init_abi(&sc->sc_pps); DPRINTF("ttycreate: %s\n", buf); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon May 4 17:01:51 2015 (r282423) +++ head/sys/kern/kern_tc.c Mon May 4 17:59:39 2015 (r282424) @@ -1468,6 +1468,17 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, * RFC 2783 PPS-API implementation. */ +/* + * Return true if the driver is aware of the abi version extensions in the + * pps_state structure, and it supports at least the given abi version number. + */ +static inline int +abi_aware(struct pps_state *pps, int vers) +{ + + return ((pps->kcmode & KCMODE_ABIFLAG) && pps->driver_abi >= vers); +} + static int pps_fetch(struct pps_fetch_args *fapi, struct pps_state *pps) { @@ -1497,10 +1508,17 @@ pps_fetch(struct pps_fetch_args *fapi, s cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - if (pps->mtx != NULL) - err = msleep(pps, pps->mtx, PCATCH, "ppsfch", timo); - else + if (abi_aware(pps, 1) && pps->driver_mtx != NULL) { + if (pps->flags & PPSFLAG_MTX_SPIN) { + err = msleep_spin(pps, pps->driver_mtx, + "ppsfch", timo); + } else { + err = msleep(pps, pps->driver_mtx, PCATCH, + "ppsfch", timo); + } + } else { err = tsleep(pps, PCATCH, "ppsfch", timo); + } if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { @@ -1590,7 +1608,8 @@ pps_ioctl(u_long cmd, caddr_t data, stru return (EINVAL); if (kapi->edge & ~pps->ppscap) return (EINVAL); - pps->kcmode = kapi->edge; + pps->kcmode = (kapi->edge & KCMODE_EDGEMASK) | + (pps->kcmode & KCMODE_ABIFLAG); return (0); #else return (EOPNOTSUPP); @@ -1611,6 +1630,18 @@ pps_init(struct pps_state *pps) #ifdef FFCLOCK pps->ppscap |= PPS_TSCLK_MASK; #endif + pps->kcmode &= ~KCMODE_ABIFLAG; +} + +void +pps_init_abi(struct pps_state *pps) +{ + + pps_init(pps); + if (pps->driver_abi > 0) { + pps->kcmode |= KCMODE_ABIFLAG; + pps->kernel_abi = PPS_ABI_VERSION; + } } void Modified: head/sys/sys/timepps.h ============================================================================== --- head/sys/sys/timepps.h Mon May 4 17:01:51 2015 (r282423) +++ head/sys/sys/timepps.h Mon May 4 17:59:39 2015 (r282424) @@ -135,6 +135,13 @@ struct pps_kcbind_args { struct mtx; +#define KCMODE_EDGEMASK 0x03 +#define KCMODE_ABIFLAG 0x80000000 /* Internal use: abi-aware driver. */ + +#define PPS_ABI_VERSION 1 + +#define PPSFLAG_MTX_SPIN 0x01 /* Driver mtx is MTX_SPIN type. */ + struct pps_state { /* Capture information. */ struct timehands *capth; @@ -142,9 +149,6 @@ struct pps_state { unsigned capgen; unsigned capcount; - /* pointer to mutex protecting this state, if any */ - struct mtx *mtx; - /* State information. */ pps_params_t ppsparam; pps_info_t ppsinfo; @@ -153,11 +157,19 @@ struct pps_state { int ppscap; struct timecounter *ppstc; unsigned ppscount[3]; + /* + * The following fields are valid if the driver calls pps_init_abi(). + */ + uint16_t driver_abi; /* Driver sets before pps_init_abi(). */ + uint16_t kernel_abi; /* Kernel sets during pps_init_abi(). */ + struct mtx *driver_mtx; /* Optional, valid if non-NULL. */ + uint32_t flags; }; void pps_capture(struct pps_state *pps); void pps_event(struct pps_state *pps, int event); void pps_init(struct pps_state *pps); +void pps_init_abi(struct pps_state *pps); int pps_ioctl(unsigned long cmd, caddr_t data, struct pps_state *pps); void hardpps(struct timespec *tsp, long nsec); From owner-svn-src-all@FreeBSD.ORG Mon May 4 18:20:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B5D998; Mon, 4 May 2015 18:20:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040F1119A; Mon, 4 May 2015 18:20: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 t44IKWYP061216; Mon, 4 May 2015 18:20:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44IKVxp061208; Mon, 4 May 2015 18:20:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505041820.t44IKVxp061208@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 18:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282425 - in head/usr.bin/soelim: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:20:33 -0000 Author: bapt Date: Mon May 4 18:20:31 2015 New Revision: 282425 URL: https://svnweb.freebsd.org/changeset/base/282425 Log: Parse filename until first space then print the rest of the line after file inclusion This is the same behaviour of heirloom's soelim Added: head/usr.bin/soelim/tests/basic-with-space.in (contents, props changed) head/usr.bin/soelim/tests/basic-with-space.out (contents, props changed) Modified: head/usr.bin/soelim/soelim.c head/usr.bin/soelim/tests/Makefile head/usr.bin/soelim/tests/soelim.sh Modified: head/usr.bin/soelim/soelim.c ============================================================================== --- head/usr.bin/soelim/soelim.c Mon May 4 17:59:39 2015 (r282424) +++ head/usr.bin/soelim/soelim.c Mon May 4 18:20:31 2015 (r282425) @@ -108,11 +108,12 @@ soelim_file(FILE *f, int flag) while (isspace(*walk)) walk++; - cp = walk + strlen(walk) - 1; - while (cp > walk && isspace(*cp)) { - *cp = 0; - cp--; - } + cp = walk; + while (*cp != '\0' && !isspace(*cp)) + cp++; + *cp = 0; + if (cp < line + linelen) + cp++; if (*walk == '\0') { printf("%s", line); @@ -122,6 +123,8 @@ soelim_file(FILE *f, int flag) free(line); return (1); } + if (*cp != '\0') + printf("%s", cp); } free(line); Modified: head/usr.bin/soelim/tests/Makefile ============================================================================== --- head/usr.bin/soelim/tests/Makefile Mon May 4 17:59:39 2015 (r282424) +++ head/usr.bin/soelim/tests/Makefile Mon May 4 18:20:31 2015 (r282425) @@ -7,7 +7,9 @@ ATF_TESTS_SH= soelim FILES= nonexisting.in \ basic.in \ basic \ - basic.out + basic.out \ + basic-with-space.in \ + basic-with-space.out FILESDIR= ${TESTSDIR} .include Added: head/usr.bin/soelim/tests/basic-with-space.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soelim/tests/basic-with-space.in Mon May 4 18:20:31 2015 (r282425) @@ -0,0 +1,3 @@ +This is a test +.so basic something +end Added: head/usr.bin/soelim/tests/basic-with-space.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/soelim/tests/basic-with-space.out Mon May 4 18:20:31 2015 (r282425) @@ -0,0 +1,4 @@ +This is a test +basic has been included +something +end Modified: head/usr.bin/soelim/tests/soelim.sh ============================================================================== --- head/usr.bin/soelim/tests/soelim.sh Mon May 4 17:59:39 2015 (r282424) +++ head/usr.bin/soelim/tests/soelim.sh Mon May 4 18:20:31 2015 (r282425) @@ -87,6 +87,13 @@ files_body() -e empty \ -s exit:0 \ soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in + + atf_check \ + -o file:$(atf_get_srcdir)/basic-with-space.out \ + -e empty \ + -s exit:0 \ + soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic-with-space.in + } atf_init_test_cases() From owner-svn-src-all@FreeBSD.ORG Mon May 4 18:49:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E61A338A; Mon, 4 May 2015 18:49: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 D43581537; Mon, 4 May 2015 18:49: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 t44InPvB073255; Mon, 4 May 2015 18:49:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44InPxC073254; Mon, 4 May 2015 18:49:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505041849.t44InPxC073254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 4 May 2015 18:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282426 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:49:26 -0000 Author: glebius Date: Mon May 4 18:49:25 2015 New Revision: 282426 URL: https://svnweb.freebsd.org/changeset/base/282426 Log: Fix arithmetical bug in vnode_pager_haspage(). The check against object size should be done not with the number of pages in the first block, but with the overall number of pages. While here, add KASSERT that makes sure that BMAP doesn't return completely irrelevant blocks. Reviewed by: kib Tested by: pho Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Mon May 4 18:20:31 2015 (r282425) +++ head/sys/vm/vnode_pager.c Mon May 4 18:49:25 2015 (r282426) @@ -340,16 +340,21 @@ vnode_pager_haspage(vm_object_t object, *before += poff; } if (after) { - int numafter; + /* + * The BMAP vop can report a partial block in the + * 'after', but must not count blocks after EOF. + * Assert the latter, and truncate 'after' in case + * of the former. + */ + KASSERT(reqblock + *after <= + object->size * pagesperblock, + ("%s: reqblock %jd after %d size %ju", __func__, + (intmax_t )reqblock, *after, + (uintmax_t )object->size)); *after *= pagesperblock; - numafter = pagesperblock - (poff + 1); - if (IDX_TO_OFF(pindex + numafter) > - object->un_pager.vnp.vnp_size) { - numafter = - OFF_TO_IDX(object->un_pager.vnp.vnp_size) - - pindex; - } - *after += numafter; + *after += pagesperblock - (poff + 1); + if (pindex + *after >= object->size) + *after = object->size - 1 - pindex; } } else { if (before) { From owner-svn-src-all@FreeBSD.ORG Mon May 4 18:51:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E873505; Mon, 4 May 2015 18:51:29 +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 CC8261610; Mon, 4 May 2015 18:51:27 +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 t44IpPdi044355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 4 May 2015 21:51:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t44IpPoi044354; Mon, 4 May 2015 21:51:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 4 May 2015 21:51:25 +0300 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150504185125.GL34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2197979.EUYqekgM4M@ralph.baldwin.cx> <20150502191000.GE546@FreeBSD.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26088556.xbkUe5VAyp@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 18:51:29 -0000 John, On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: J> > J> > J> So the importaing thing here is that if_get_counter() is still doing J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. J> > J> > J> We well need more explicitly knowledge of queues outside of drivers J> > J> > J> and in the stack itself to support a generic framework for per-queue J> > J> > J> stats. J> > J> > J> > J> > This depends on how generic we want the API to be. Of course, we can add J> > J> > an extra argument to if_get_counter(). J> > J> > J> > J> > However, if we don't expect the number of queues to exceed a reasonable J> > J> > number of 255 :), we can fit the functionality into existing API. J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter J> > J> > parameter. J> > J> > J> > J> > #define IFCOUNTER_MASK 0x00ffffff J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) J> > J> J> > J> I'd prefer that expose queues more directly and figure out how to handle J> > J> per-queue stats then (e.g. do we have some sort of driver-independent J> > J> structure that each ifnet has 1 or more of that maps to a queue and has J> > J> driver provided methods, etc. If so you could have a driver method for J> > J> queue stats). Note that I did use if_get_counter to report the J> > J> per-interface stats instead of adding a new sysctl. J> > J> > What do you prefer: an extra argument to the if_get_counter() or a extra J> > ifop? J> J> As I said, I'd prefer we expose queues to the stack more directly complete J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though J> probably more like the old if_start). Your answer seems quite orthogonal to my question. I reread it couple of times, but still can't figure out how exactly do you prefet to fetch per-queue stats. Can you please explain in more detail? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon May 4 19:33:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 606B2E00; Mon, 4 May 2015 19:33: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 4E8721BAF; Mon, 4 May 2015 19:33: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 t44JXqsQ097994; Mon, 4 May 2015 19:33:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44JXqZG097993; Mon, 4 May 2015 19:33:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505041933.t44JXqZG097993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 4 May 2015 19:33: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: r282427 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 19:33:52 -0000 Author: mav Date: Mon May 4 19:33:51 2015 New Revision: 282427 URL: https://svnweb.freebsd.org/changeset/base/282427 Log: MFC r281765: Activate write-only optimization if bpf device opened with O_WRONLY. dhclient opens bpf as write-only to send packets. It never reads received packets from that descriptor, but processing them in kernel takes time. Especially much time takes packet timestamping on systems with expensive timecounter, such as bhyve guest, where network speed dropped in half. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/net/bpf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/bpf.c ============================================================================== --- stable/10/sys/net/bpf.c Mon May 4 18:49:25 2015 (r282426) +++ stable/10/sys/net/bpf.c Mon May 4 19:33:51 2015 (r282427) @@ -600,7 +600,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ * Save sysctl value to protect from sysctl change * between reads */ - op_w = V_bpf_optimize_writers; + op_w = V_bpf_optimize_writers || d->bd_writer; if (d->bd_bif != NULL) bpf_detachd_locked(d); @@ -802,6 +802,8 @@ bpfopen(struct cdev *dev, int flags, int * particular buffer method. */ bpf_buffer_init(d); + if ((flags & FREAD) == 0) + d->bd_writer = 2; d->bd_hbuf_in_use = 0; d->bd_bufmode = BPF_BUFMODE_BUFFER; d->bd_sig = SIGIO; From owner-svn-src-all@FreeBSD.ORG Mon May 4 19:35:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71F9EF4E; Mon, 4 May 2015 19:35: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 5FF851BBC; Mon, 4 May 2015 19:35: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 t44JZ0RH098334; Mon, 4 May 2015 19:35:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44JZ0J5098333; Mon, 4 May 2015 19:35:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505041935.t44JZ0J5098333@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 4 May 2015 19:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282428 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 19:35:00 -0000 Author: mav Date: Mon May 4 19:34:59 2015 New Revision: 282428 URL: https://svnweb.freebsd.org/changeset/base/282428 Log: MFC r281765: Activate write-only optimization if bpf device opened with O_WRONLY. dhclient opens bpf as write-only to send packets. It never reads received packets from that descriptor, but processing them in kernel takes time. Especially much time takes packet timestamping on systems with expensive timecounter, such as bhyve guest, where network speed dropped in half. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/net/bpf.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/bpf.c ============================================================================== --- stable/9/sys/net/bpf.c Mon May 4 19:33:51 2015 (r282427) +++ stable/9/sys/net/bpf.c Mon May 4 19:34:59 2015 (r282428) @@ -617,7 +617,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ * Save sysctl value to protect from sysctl change * between reads */ - op_w = V_bpf_optimize_writers; + op_w = V_bpf_optimize_writers || d->bd_writer; if (d->bd_bif != NULL) bpf_detachd_locked(d); @@ -880,6 +880,8 @@ bpfopen(struct cdev *dev, int flags, int * particular buffer method. */ bpf_buffer_init(d); + if ((flags & FREAD) == 0) + d->bd_writer = 2; d->bd_hbuf_in_use = 0; d->bd_bufmode = BPF_BUFMODE_BUFFER; d->bd_sig = SIGIO; From owner-svn-src-all@FreeBSD.ORG Mon May 4 19:55:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79CCA3C6; Mon, 4 May 2015 19:55: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 4E96D1DBA; Mon, 4 May 2015 19:55: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 t44Jt2HP008534; Mon, 4 May 2015 19:55:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44Jt28d008533; Mon, 4 May 2015 19:55:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505041955.t44Jt28d008533@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 4 May 2015 19:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282429 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 19:55:02 -0000 Author: mav Date: Mon May 4 19:55:01 2015 New Revision: 282429 URL: https://svnweb.freebsd.org/changeset/base/282429 Log: Implement in-order execution of non-NCQ commands. Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. This can be a performance penalization for non-NCQ commands, but it is required for proper error recovery and standard compliance. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:34:59 2015 (r282428) +++ head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:55:01 2015 (r282429) @@ -140,6 +140,7 @@ struct ahci_port { uint8_t err_cfis[20]; uint8_t sense_key; uint8_t asc; + u_int ccs; uint32_t pending; uint32_t clb; @@ -204,6 +205,8 @@ struct pci_ahci_softc { }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) +static void ahci_handle_port(struct ahci_port *p); + static inline void lba_to_msf(uint8_t *buf, int lba) { lba += 150; @@ -406,6 +409,7 @@ ahci_check_stopped(struct ahci_port *p) */ if (!(p->cmd & AHCI_P_CMD_ST)) { if (p->pending == 0) { + p->ccs = 0; p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); p->ci = 0; p->sact = 0; @@ -783,6 +787,8 @@ next: ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); p->pending &= ~(1 << slot); ahci_check_stopped(p); + if (!first) + ahci_handle_port(p); return; } goto next; @@ -1754,20 +1760,21 @@ ahci_handle_slot(struct ahci_port *p, in static void ahci_handle_port(struct ahci_port *p) { - int i; if (!(p->cmd & AHCI_P_CMD_ST)) return; /* * Search for any new commands to issue ignoring those that - * are already in-flight. + * are already in-flight. Stop if device is busy or in error. */ - for (i = 0; (i < 32) && p->ci; i++) { - if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) { + for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) + break; + if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { p->cmd &= ~AHCI_P_CMD_CCS_MASK; - p->cmd |= i << AHCI_P_CMD_CCS_SHIFT; - ahci_handle_slot(p, i); + p->cmd |= p->ccs << AHCI_P_CMD_CCS_SHIFT; + ahci_handle_slot(p, p->ccs); } } } @@ -1844,6 +1851,7 @@ ata_ioreq_cb(struct blockif_req *br, int p->pending &= ~(1 << slot); ahci_check_stopped(p); + ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); @@ -1905,6 +1913,7 @@ atapi_ioreq_cb(struct blockif_req *br, i p->pending &= ~(1 << slot); ahci_check_stopped(p); + ahci_handle_port(p); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); From owner-svn-src-all@FreeBSD.ORG Mon May 4 20:01:38 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC46359B; Mon, 4 May 2015 20:01:38 +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 A60AB1E9B; Mon, 4 May 2015 20:01:38 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9EE72B915; Mon, 4 May 2015 16:01:36 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Date: Mon, 04 May 2015 16:01:28 -0400 Message-ID: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150504185125.GL34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 May 2015 16:01:36 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 20:01:38 -0000 On Monday, May 04, 2015 09:51:25 PM Gleb Smirnoff wrote: > John, > > On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > J> > J> > J> We well need more explicitly knowledge of queues outside of drivers > J> > J> > J> and in the stack itself to support a generic framework for per-queue > J> > J> > J> stats. > J> > J> > > J> > J> > This depends on how generic we want the API to be. Of course, we can add > J> > J> > an extra argument to if_get_counter(). > J> > J> > > J> > J> > However, if we don't expect the number of queues to exceed a reasonable > J> > J> > number of 255 :), we can fit the functionality into existing API. > J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter > J> > J> > parameter. > J> > J> > > J> > J> > #define IFCOUNTER_MASK 0x00ffffff > J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > J> > J> > J> > J> I'd prefer that expose queues more directly and figure out how to handle > J> > J> per-queue stats then (e.g. do we have some sort of driver-independent > J> > J> structure that each ifnet has 1 or more of that maps to a queue and has > J> > J> driver provided methods, etc. If so you could have a driver method for > J> > J> queue stats). Note that I did use if_get_counter to report the > J> > J> per-interface stats instead of adding a new sysctl. > J> > > J> > What do you prefer: an extra argument to the if_get_counter() or a extra > J> > ifop? > J> > J> As I said, I'd prefer we expose queues to the stack more directly complete > J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though > J> probably more like the old if_start). > > Your answer seems quite orthogonal to my question. I reread it couple of times, > but still can't figure out how exactly do you prefet to fetch per-queue stats. > Can you please explain in more detail? struct if_queue { struct ifnet *ifq_parent; void (*ifq_get_counter)(struct if_queue *, ift_counter); ... }; (Pretend that if_queue is a new object type and that each RX or TX queue on a NIC has one.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 4 20:36:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36F66ECC; Mon, 4 May 2015 20:36: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 182721233; Mon, 4 May 2015 20:36: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 t44Ka0K7028519; Mon, 4 May 2015 20:36:00 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44Ka07O028514; Mon, 4 May 2015 20:36:00 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201505042036.t44Ka07O028514@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 May 2015 20:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282430 - in head/sys: conf dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 20:36:01 -0000 Author: jhibbits Date: Mon May 4 20:36:00 2015 New Revision: 282430 URL: https://svnweb.freebsd.org/changeset/base/282430 Log: Implement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100) Summary: This has been tested on the RB800, but should work on the RB333, RB600, and RB1100 as well. It's currently missing ECC support, but read and write are complete. Reviewers: imp Reviewed By: imp Subscribers: imp Differential Revision: https://reviews.freebsd.org/D2223 Added: head/sys/dev/nand/nfc_rb.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 4 19:55:01 2015 (r282429) +++ head/sys/conf/files.powerpc Mon May 4 20:36:00 2015 (r282430) @@ -43,6 +43,7 @@ dev/iicbus/ds1775.c optional ds1775 pow dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc | vt dev/nand/nfc_fsl.c optional nand mpc85xx +dev/nand/nfc_rb.c optional nand mpc85xx # ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. dev/ofw/openfirm.c optional aim dev/ofw/openfirmio.c optional aim Added: head/sys/dev/nand/nfc_rb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nand/nfc_rb.c Mon May 4 20:36:00 2015 (r282430) @@ -0,0 +1,275 @@ +/*- + * Copyright (C) 2015 Justin Hibbits + * 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. + */ + +/* RouterBoard 600/800 NAND controller driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include "nfc_if.h" +#include "gpio_if.h" + +#define RB_NAND_DATA (0x00) + +struct rb_nand_softc { + struct nand_softc nand_dev; + struct resource *sc_mem; + int rid; + device_t sc_gpio; + uint32_t sc_rdy_pin; + uint32_t sc_nce_pin; + uint32_t sc_cle_pin; + uint32_t sc_ale_pin; +}; + +static int rb_nand_attach(device_t); +static int rb_nand_probe(device_t); +static int rb_nand_send_command(device_t, uint8_t); +static int rb_nand_send_address(device_t, uint8_t); +static uint8_t rb_nand_read_byte(device_t); +static void rb_nand_read_buf(device_t, void *, uint32_t); +static void rb_nand_write_buf(device_t, void *, uint32_t); +static int rb_nand_select_cs(device_t, uint8_t); +static int rb_nand_read_rnb(device_t); + +static device_method_t rb_nand_methods[] = { + DEVMETHOD(device_probe, rb_nand_probe), + DEVMETHOD(device_attach, rb_nand_attach), + + DEVMETHOD(nfc_send_command, rb_nand_send_command), + DEVMETHOD(nfc_send_address, rb_nand_send_address), + DEVMETHOD(nfc_read_byte, rb_nand_read_byte), + DEVMETHOD(nfc_read_buf, rb_nand_read_buf), + DEVMETHOD(nfc_write_buf, rb_nand_write_buf), + DEVMETHOD(nfc_select_cs, rb_nand_select_cs), + DEVMETHOD(nfc_read_rnb, rb_nand_read_rnb), + + { 0, 0 }, +}; + +static driver_t rb_nand_driver = { + "nand", + rb_nand_methods, + sizeof(struct rb_nand_softc), +}; + +static devclass_t rb_nand_devclass; +DRIVER_MODULE(rb_nand, ofwbus, rb_nand_driver, rb_nand_devclass, 0, 0); + +#if 0 +static const struct nand_ecc_data rb_ecc = { + .eccsize = 6, + .eccmode = NAND_ECC_SOFT, + .eccbytes = 6, + .eccpositions = { 8, 9, 10, 13, 14, 15 }, +}; +#endif + +static int +rb_nand_probe(device_t dev) +{ + const char *device_type; + + device_type = ofw_bus_get_type(dev); + + if (!device_type || strcmp(device_type, "rb,nand")) + return (ENXIO); + + device_set_desc(dev, "RouterBoard 333/600/800 NAND controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rb_nand_attach(device_t dev) +{ + struct rb_nand_softc *sc; + phandle_t node; + uint32_t ale[2],cle[2],nce[2],rdy[2]; + int err; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + if (OF_getprop(node, "ale", ale, sizeof(ale)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "cle", cle, sizeof(cle)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "nce", nce, sizeof(nce)) <= 0) { + return (ENXIO); + } + if (OF_getprop(node, "rdy", rdy, sizeof(rdy)) <= 0) { + return (ENXIO); + } + + if (ale[0] != cle[0] || ale[0] != nce[0] || ale[0] != rdy[0]) { + device_printf(dev, "GPIO handles for signals must match.\n"); + return (ENXIO); + } + sc->sc_ale_pin = ale[1]; + sc->sc_cle_pin = cle[1]; + sc->sc_nce_pin = nce[1]; + sc->sc_rdy_pin = rdy[1]; + + sc->sc_gpio = OF_device_from_xref(ale[0]); + if (sc->sc_gpio == NULL) { + device_printf(dev, "No GPIO resource found!\n"); + return (ENXIO); + } + + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->sc_mem == NULL) { + device_printf(dev, "could not allocate resources!\n"); + return (ENXIO); + } + + nand_init(&sc->nand_dev, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL); + + err = nandbus_create(dev); + + return (err); +} + +static int +rb_nand_send_command(device_t dev, uint8_t command) +{ + struct rb_nand_softc *sc; + + nand_debug(NDBG_DRV,"rb_nand: send command %x", command); + + sc = device_get_softc(dev); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 1); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 0); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_nce_pin, 0); + bus_write_1(sc->sc_mem, RB_NAND_DATA, command); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 0); + return (0); +} + +static int +rb_nand_send_address(device_t dev, uint8_t addr) +{ + struct rb_nand_softc *sc; + + nand_debug(NDBG_DRV,"rb_nand: send address %x", addr); + + sc = device_get_softc(dev); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_cle_pin, 0); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 1); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_nce_pin, 0); + bus_write_1(sc->sc_mem, RB_NAND_DATA, addr); + GPIO_PIN_SET(sc->sc_gpio, sc->sc_ale_pin, 0); + return (0); +} + +static uint8_t +rb_nand_read_byte(device_t dev) +{ + struct rb_nand_softc *sc; + uint8_t data; + + sc = device_get_softc(dev); + data = bus_read_1(sc->sc_mem, RB_NAND_DATA); + + nand_debug(NDBG_DRV,"rb_nand: read %x", data); + + return (data); +} + +static void +rb_nand_read_buf(device_t dev, void* buf, uint32_t len) +{ + struct rb_nand_softc *sc; + + sc = device_get_softc(dev); + + bus_read_region_1(sc->sc_mem, RB_NAND_DATA, buf, len); +} + +static void +rb_nand_write_buf(device_t dev, void* buf, uint32_t len) +{ + struct rb_nand_softc *sc; + int i; + uint8_t *b = (uint8_t*)buf; + + sc = device_get_softc(dev); + + for (i = 0; i < len; i++) { +#ifdef NAND_DEBUG + if (!(i % 16)) + printf("%s", i == 0 ? "rb_nand:\n" : "\n"); + printf(" %x", b[i]); + if (i == len - 1) + printf("\n"); +#endif + bus_write_1(sc->sc_mem, RB_NAND_DATA, b[i]); + } +} + +static int +rb_nand_select_cs(device_t dev, uint8_t cs) +{ + + if (cs > 0) + return (ENODEV); + + return (0); +} + +static int +rb_nand_read_rnb(device_t dev) +{ + struct rb_nand_softc *sc; + uint32_t rdy_bit; + + sc = device_get_softc(dev); + GPIO_PIN_GET(sc->sc_gpio, sc->sc_rdy_pin, &rdy_bit); + + return (rdy_bit); /* ready */ +} From owner-svn-src-all@FreeBSD.ORG Mon May 4 20:51:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CEFC245; Mon, 4 May 2015 20:51: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 EB271144A; Mon, 4 May 2015 20:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44KpULR037584; Mon, 4 May 2015 20:51:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44KpSDE037568; Mon, 4 May 2015 20:51:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505042051.t44KpSDE037568@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 20:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r282431 - vendor/openresolv/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 20:51:31 -0000 Author: gjb Date: Mon May 4 20:51:27 2015 New Revision: 282431 URL: https://svnweb.freebsd.org/changeset/base/282431 Log: Import openresolv 3.7.0. PR: 199854 Obtained from: http://roy.marples.name/projects/openresolv Sponsored by: The FreeBSD Foundation Added: vendor/openresolv/dist/GNUmakefile vendor/openresolv/dist/config-null.mk (contents, props changed) vendor/openresolv/dist/pdns_recursor.in (contents, props changed) Modified: vendor/openresolv/dist/Makefile vendor/openresolv/dist/configure vendor/openresolv/dist/dnsmasq.in vendor/openresolv/dist/libc.in vendor/openresolv/dist/named.in vendor/openresolv/dist/pdnsd.in vendor/openresolv/dist/resolvconf.8.in vendor/openresolv/dist/resolvconf.conf.5.in vendor/openresolv/dist/resolvconf.in vendor/openresolv/dist/unbound.in Added: vendor/openresolv/dist/GNUmakefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openresolv/dist/GNUmakefile Mon May 4 20:51:27 2015 (r282431) @@ -0,0 +1,4 @@ +# Nasty hack so that make clean works without configure being run +CONFIG_MK?=$(shell test -e config.mk && echo config.mk || echo config-null.mk) + +include Makefile Modified: vendor/openresolv/dist/Makefile ============================================================================== --- vendor/openresolv/dist/Makefile Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/Makefile Mon May 4 20:51:27 2015 (r282431) @@ -1,8 +1,19 @@ -include config.mk +PKG= openresolv +VERSION= 3.7.0 -NAME= openresolv -VERSION= 3.4.4 -PKG= ${NAME}-${VERSION} +# Nasty hack so that make clean works without configure being run +_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk +CONFIG_MK?= ${_CONFIG_MK} +include ${CONFIG_MK} + +SBINDIR?= /sbin +SYSCONFDIR?= /etc +LIBEXECDIR?= /libexec/resolvconf +VARDIR?= /var/run/resolvconf +RCDIR?= /etc/rc.d +RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \ + ${RCDIR}/\1 restart; \ + fi INSTALL?= install SED?= sed @@ -17,31 +28,36 @@ TARGET= ${RESOLVCONF} ${SUBSCRIBERS} SRCS= ${TARGET:C,$,.in,} # pmake SRCS:= ${TARGET:=.in} # gmake -SED_PREFIX= -e 's:@PREFIX@:${PREFIX}:g' +SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g' SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' +DISTPREFIX?= ${PKG}-${VERSION} +DISTFILEGZ?= ${DISTPREFIX}.tar.gz +DISTFILE?= ${DISTPREFIX}.tar.bz2 +FOSSILID?= current + .SUFFIXES: .in all: ${TARGET} .in: - ${SED} ${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ + ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \ $< > $@ clean: - rm -f ${TARGET} openresolv-${VERSION}.tar.bz2 + rm -f ${TARGET} distclean: clean - rm -f config.mk + rm -f config.mk ${DISTFILE} installdirs: -install: ${TARGET} +proginstall: ${TARGET} ${INSTALL} -d ${DESTDIR}${SBINDIR} ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR} ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} @@ -49,18 +65,21 @@ install: ${TARGET} ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR} ${INSTALL} -d ${DESTDIR}${LIBEXECDIR} ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR} + +maninstall: ${INSTALL} -d ${DESTDIR}${MANDIR}/man8 ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8 ${INSTALL} -d ${DESTDIR}${MANDIR}/man5 ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5 +install: proginstall maninstall + import: - rm -rf /tmp/${PKG} - ${INSTALL} -d /tmp/${PKG} - cp README ${SRCS} /tmp/${PKG} - -dist: import - cp configure Makefile resolvconf.conf /tmp/${PKG} - tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} - rm -rf /tmp/${PKG} - ls -l ${PKG}.tar.bz2 + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + cp README ${SRCS} /tmp/${DISPREFIX} + +dist: + fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} + gunzip -c ${DISTFILEGZ} | bzip2 >${DISTFILE} + rm ${DISTFILEGZ} Added: vendor/openresolv/dist/config-null.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openresolv/dist/config-null.mk Mon May 4 20:51:27 2015 (r282431) @@ -0,0 +1 @@ +# This space left intentionally blank Modified: vendor/openresolv/dist/configure ============================================================================== --- vendor/openresolv/dist/configure Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/configure Mon May 4 20:51:27 2015 (r282431) @@ -18,7 +18,7 @@ for x do --debug) DEBUG=$var;; --disable-debug) DEBUG=no;; --enable-debug) DEBUG=yes;; - --prefix) prefix=$var;; + --prefix) PREFIX=$var;; --sysconfdir) SYSCONFDIR=$var;; --bindir|--sbindir) SBINDIR=$var;; --libexecdir) LIBEXECDIR=$var;; @@ -41,68 +41,76 @@ for x do esac done +if [ -z "$LIBEXECDIR" ]; then + printf "Checking for directory /libexec ... " + if [ -d /libexec ]; then + echo "yes" + LIBEXECDIR=$PREFIX/libexec/resolvconf + else + echo "no" + LIBEXECDIR=$PREFIX/lib/resolvconf + fi +fi +if [ -z "$RUNDIR" ]; then + printf "Checking for directory /run ... " + if [ -d /run ]; then + echo "yes" + RUNDIR=/run + else + echo "no" + RUNDIR=/var/run + fi +fi + : ${SED:=sed} -: ${PREFIX:=$prefix} : ${SYSCONFDIR:=$PREFIX/etc} : ${SBINDIR:=$PREFIX/sbin} -: ${LIBEXECDIR:=$PREFIX/libexec} +: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} : ${STATEDIR:=/var} : ${RUNDIR:=$STATEDIR/run} : ${MANDIR:=${PREFIX:-/usr}/share/man} eval SYSCONFDIR="$SYSCONFDIR" eval SBINDIR="$SBINDIR" -eval LIBEXECDIR="$LIBEXECDIR/resolvconf" +eval LIBEXECDIR="$LIBEXECDIR" eval VARDIR="$RUNDIR/resolvconf" eval MANDIR="$MANDIR" CONFIG_MK=config.mk if [ -z "$BUILD" ]; then - BUILD=`uname -m`-`uname -s | tr '[:upper:]' '[:lower:]'` -fi -if [ -z "$HOST" ]; then - [ -z "$TARGET" ] && TARGET=$BUILD - HOST=$TARGET -fi -if [ -z "$TARGET" ]; then - [ -z "$HOST" ] && HOST=$BUILD - TARGET=$HOST -fi - -# Debian and Slackware have linux in different places when dealing with -# autoconf, so we deal with that here. -if [ -z "$OS" ]; then - case "$TARGET" in - *-linux-*|linux-*|*-linux|linux) OS=linux;; - esac + # autoconf target triplet: cpu-vendor-os + BUILD=$(uname -m)-unknown-$(uname -s | tr '[:upper:]' '[:lower:]') fi +: ${HOST:=$BUILD} if [ -z "$OS" ]; then - # Derive OS from cpu-manufacturer-os-kernel - CPU=${TARGET%%-*} - REST=${TARGET#*-} + echo "Deriving operating system from ... $HOST" + # Derive OS from cpu-vendor-[kernel-]os + CPU=${HOST%%-*} + REST=${HOST#*-} if [ "$CPU" != "$REST" ]; then - MANU=${REST%%-*} + VENDOR=${REST%%-*} REST=${REST#*-} - if [ "$MANU" != "$REST" ]; then + if [ "$VENDOR" != "$REST" ]; then + # Use kernel if given, otherwise os OS=${REST%%-*} - REST=${REST#*-} - if [ "$OS" != "$REST" ]; then - KERNEL=${REST%%-*} - else - # 3 tupple - KERNEL=$OS - OS=$MANU - MANU= - fi else # 2 tupple - OS=$MANU - MANU= + OS=$VENDOR + VENDOR= fi fi + + # Work with cpu-kernel-os, ie Debian + case "$VENDOR" in + linux*|kfreebsd*) OS=$VENDOR; VENDOR= ;; + esac + # Special case + case "$OS" in + gnu*) OS=hurd;; # No HURD support as yet + esac fi echo "Configuring openresolv for ... $OS" @@ -118,17 +126,36 @@ for x in SYSCONFDIR SBINDIR LIBEXECDIR V echo "$x=$t $v" >>$CONFIG_MK done -if [ -e /etc/arch-release -a -d /etc/rc.d ]; then - echo "Overriding service status check for Arch Linux" - RCDIR=/etc/rc.d - RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" - echo "yes" +if [ -z "$RESTARTCMD" ]; then + printf "Checking for systemd ... " + if [ -x /bin/systemctl ]; then + RESTARTCMD="/bin/systemctl try-restart \1" + echo "yes" + elif [ -x /usr/bin/systemctl ]; then + RESTARTCMD="/usr/bin/systemctl try-restart \1" + echo "yes" + else + echo "no" + fi +fi + +# Arch upgraded to systemd, so this check has to be just after systemd +# but higher than the others +if [ -z "$RESTARTCMD" ]; then + printf "Checking for Arch ... " + if [ -e /etc/arch-release -a -d /etc/rc.d ]; then + RCDIR=/etc/rc.d + RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" + echo "yes" + else + echo "no" + fi fi if [ -z "$RESTARTCMD" ]; then printf "Checking for OpenRC ... " if [ -x /sbin/rc-service ]; then - RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -- -Ds restart" + RESTARTCMD="if /sbin/rc-service -e \1; then /sbin/rc-service \1 -- -Ds restart; fi" echo "yes" else echo "no" @@ -138,7 +165,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for invoke-rc.d ... " if [ -x /usr/sbin/invoke-rc.d ]; then RCDIR=/etc/init.d - RESTARTCMD="/usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1 \&\& /usr/sbin/invoke-rc.d \1 restart" + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1; then /usr/sbin/invoke-rc.d \1 restart; fi" echo "yes" else echo "no" @@ -148,7 +175,19 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for service ... " if [ -x /sbin/service ]; then RCDIR=/etc/init.d - RESTARTCMD="/sbin/service \1 \&\& /sbin/service \1 restart" + RESTARTCMD="if /sbin/service \1; then /sbin/service \1 restart; fi" + echo "yes" + else + echo "no" + fi +fi +if [ -z "$RESTARTCMD" ]; then + printf "Checking for runit... " + if [ -x /bin/sv ]; then + RESTARTCMD="/bin/sv try-restart \1" + echo "yes" + elif [ -x /usr/bin/sv ]; then + RESTARTCMD="/usr/bin/sv try-restart \1" echo "yes" else echo "no" @@ -159,7 +198,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for $x ... " if [ -d $x ]; then RCDIR=$x - RESTARTCMD="$x/\1 status >/dev/null 2>\&1 \&\& $x/\1 restart" + RESTARTCMD="if $x/\1 status >/dev/null 2>\&1; then $x/\1 restart; fi" echo "yes" break else @@ -169,7 +208,7 @@ if [ -z "$RESTARTCMD" ]; then fi if [ -z "$RESTARTCMD" ]; then - echo "WARNING! No means of interacting with system services detected!" + echo "$0: WARNING: No means of interacting with system services detected!" exit 1 fi Modified: vendor/openresolv/dist/dnsmasq.in ============================================================================== --- vendor/openresolv/dist/dnsmasq.in Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/dnsmasq.in Mon May 4 20:51:27 2015 (r282431) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2011 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -29,12 +29,13 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " : ${dnsmasq_pid:=/var/run/dnsmasq.pid} [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid +[ -s "$dnsmasq_pid" ] || unset dnsmasq_pid : ${dnsmasq_service:=dnsmasq} : ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} newconf="# Generated by resolvconf$NL" @@ -46,21 +47,18 @@ newresolv="$newconf" # so we need to validate a few things first. # Check for DBus support in the binary dbus=false -: ${dbus_pid:=/var/run/dbus/dbus.pid} -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus.pid -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus/pid -if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" ]; then - if dnsmasq --version 2>/dev/null | \ - grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" +dbus_ex=false +dbus_introspect=$(dbus-send --print-reply --system \ + --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq \ + org.freedesktop.DBus.Introspectable.Introspect \ + 2>/dev/null) +if [ $? = 0 ]; then + dbus=true + if printf %s "$dbus_introspect" | \ + grep -q '' then - # Sanity - check that dnsmasq and dbus are running - if kill -0 $(cat "$dbus_pid") 2>/dev/null && \ - kill -0 $(cat "$dnsmasq_pid") 2>/dev/null - then - dbus=true - newconf="$newconf$NL# Domain specific servers will" - newconf="$newconf be sent over dbus${NL}enable-dbus$NL" - fi + dbus_ex=true fi fi @@ -69,35 +67,95 @@ for n in $NAMESERVERS; do done dbusdest= +dbusdest_ex= +conf= for d in $DOMAINS; do dn="${d%%:*}" ns="${d#*:}" while [ -n "$ns" ]; do - if $dbus; then - SIFS=${IFS-y} OIFS=$IFS - IFS=. - set -- ${ns%%,*} - num="0x$(printf %02x $1 $2 $3 $4)" - if [ "$SIFS" = yi ]; then - unset IFS - else - IFS=$OIFS - fi - dbusdest="$dbusdest uint32:$(printf %u $num)" - dbusdest="$dbusdest string:$dn" - else - newconf="${newconf}server=/$dn/${ns%%,*}$NL" + n="${ns%%,*}" + if $dbus && ! $dbus_ex; then + case "$n" in + *.*.*.*) + SIFS=${IFS-y} OIFS=$IFS + IFS=. + set -- $n + num="0x$(printf %02x $1 $2 $3 $4)" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="$dbusdest uint32:$(printf %u $num)" + dbusdest="$dbusdest string:$dn" + ;; + *:*%*) + # This version of dnsmasq won't accept + # scoped IPv6 addresses + dbus=false + ;; + *:*) + SIFS=${IFS-y} OIFS=$IFS bytes= front= back= + empty=false i=0 + IFS=: + set -- $n + while [ -n "$1" -o -n "$2" ]; do + addr="$1" + shift + if [ -z "$addr" ]; then + empty=true + continue + fi + i=$(($i + 1)) + while [ ${#addr} -lt 4 ]; do + addr="0${addr}" + done + byte1="$(printf %d 0x${addr%??})" + byte2="$(printf %d 0x${addr#??})" + if $empty; then + back="$back byte:$byte1 byte:$byte2" + else + front="$front byte:$byte1 byte:$byte2" + fi + done + while [ $i != 8 ]; do + i=$(($i + 1)) + front="$front byte:0 byte:0" + done + front="${front}$back" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="${dbusdest}$front string:$dn" + ;; + *) + if ! $dbus_ex; then + dbus=false + fi + ;; + esac fi + dbusdest_ex="$dbusdest_ex${dbusdest_ex:+,}/$dn/$n" + conf="${conf}server=/$dn/$n$NL" [ "$ns" = "${ns#*,}" ] && break ns="${ns#*,}" done done +if $dbus; then + newconf="$newconf$NL# Domain specific servers will" + newconf="$newconf be sent over dbus${NL}" +else + newconf="$newconf$conf" +fi + # Try to ensure that config dirs exist if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv" else - @PREFIX@/sbin/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" + @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" fi changed=false @@ -110,14 +168,13 @@ if [ -n "$dnsmasq_conf" ]; then fi fi if [ -n "$dnsmasq_resolv" ]; then + # dnsmasq polls this file so no need to set changed=true if [ -f "$dnsmasq_resolv" ]; then if [ "$(cat "$dnsmasq_resolv")" != "$(printf %s "$newresolv")" ] then - changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi else - # dnsmasq polls this file so no need to set changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi fi @@ -126,9 +183,20 @@ if $changed; then eval $dnsmasq_restart fi if $dbus; then - $changed || kill -HUP $(cat "$dnsmasq_pid") + if [ -s "$dnsmasq_pid" ]; then + $changed || kill -HUP $(cat "$dnsmasq_pid") + fi # Send even if empty so old servers are cleared + if $dbus_ex; then + method=SetDomainServers + if [ -n "$dbusdest_ex" ]; then + dbusdest_ex="array:string:$dbusdest_ex" + fi + dbusdest="$dbusdest_ex" + else + method=SetServers + fi dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ - /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \ + /uk/org/thekelleys/dnsmasq uk.org.thekelleys.$method \ $dbusdest fi Modified: vendor/openresolv/dist/libc.in ============================================================================== --- vendor/openresolv/dist/libc.in Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/libc.in Mon May 4 20:51:27 2015 (r282431) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2011 Roy Marples +# Copyright (c) 2007-2014 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -36,18 +36,18 @@ NL=" # sed may not be available, and this is faster on small files key_get_value() { - local key="$1" value= x= line= + local key="$1" x= line= shift if [ $# -eq 0 ]; then - while read line; do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac done else - for x; do - while read line; do + for x do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac @@ -56,6 +56,24 @@ key_get_value() fi } +keys_remove() +{ + local key x line found + + while read -r line; do + found=false + for key do + case "$line" in + "$key"*|"#"*|" "*|" "*|"") found=true;; + esac + $found && break + done + $found || echo "$line" + done +} + +local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" + # Support original resolvconf configuration layout # as well as the openresolv config file if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then @@ -64,12 +82,11 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then - name_servers="$(key_get_value "nameserver " "$base")" - search_domains="$(key_get_value "search " "$base")" - if [ -z "$search_domains" ]; then - search_domains="$(key_get_value "domain " "$base")" - fi + prepend_nameservers="$(key_get_value "nameserver " "$base")" + domain="$(key_get_value "domain " "$base")" + prepend_search="$(key_get_value "search " "$base")" resolv_conf_options="$(key_get_value "options " "$base")" + resolv_conf_sortlist="$(key_get_value "sortlist " "$base")" fi if [ -f "$SYSCONFDIR"/resolv.conf.d/head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)" @@ -81,7 +98,7 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${libc_restart:=@RESTARTCMD ${libc_service}@} -: ${list_resolv:=@PREFIX@/sbin/resolvconf -l} +: ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi @@ -89,6 +106,9 @@ if [ "${resolv_conf_tail-x}" = x -a -f " resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)" fi +backup=true +signature="# Generated by resolvconf" + uniqify() { local result= @@ -104,6 +124,7 @@ uniqify() case "${resolv_conf_passthrough:-NO}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + backup=false newest= for conf in "$IFACEDIR"/*; do if [ -z "$newest" -o "$conf" -nt "$newest" ]; then @@ -113,31 +134,70 @@ case "${resolv_conf_passthrough:-NO}" in [ -z "$newest" ] && exit 0 newconf="$(cat "$newest")$NL" ;; +/dev/null|[Nn][Uu][Ll][Ll]) + : ${resolv_conf_local_only:=NO} + if [ "$local_nameservers" = "127.* 0.0.0.0 255.255.255.255 ::1" ]; then + local_nameservers= + fi + # Need to overwrite our variables. + eval "$(@SBINDIR@/resolvconf -V)" + ;; + +*) + [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" + ;; +esac +case "${resolv_conf_passthrough:-NO}" in +[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; *) - [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" - newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)" + : ${domain:=$DOMAIN} + newsearch="$(uniqify $prepend_search $SEARCH $append_search)" NS="$LOCALNAMESERVERS $NAMESERVERS" - newns="$(uniqify $name_servers $NS $name_servers_append)" + newns= + gotlocal=false + for n in $(uniqify $prepend_nameservers $NS $append_nameservers); do + add=true + islocal=false + for l in $local_nameservers; do + case "$n" in + $l) islocal=true; gotlocal=true; break;; + esac + done + if ! $islocal; then + case "${resolv_conf_local_only:-YES}" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + $gotlocal && add=false;; + esac + fi + $add && newns="$newns $n" + done # Hold our new resolv.conf in a variable to save on temporary files - newconf="# Generated by resolvconf$NL" + newconf="$signature$NL" if [ -n "$resolv_conf_head" ]; then newconf="$newconf$resolv_conf_head$NL" fi - [ -n "$newsearch" ] && newconf="${newconf}search $newsearch$NL" + + [ -n "$domain" ] && newconf="${newconf}domain $domain$NL" + if [ -n "$newsearch" -a "$newsearch" != "$domain" ]; then + newconf="${newconf}search $newsearch$NL" + fi for n in $newns; do newconf="${newconf}nameserver $n$NL" done - # Now get any configured options - opts="$resolv_conf_options${resolv_conf_options:+ }" - opts="$opts$($list_resolv | key_get_value "options ")" - if [ -n "$opts" ]; then - newconf="${newconf}options" - for opt in $(uniqify $opts); do - newconf="${newconf} $opt" - done - newconf="$newconf$NL" + # Now add anything we don't care about such as sortlist and options + stuff="$($list_resolv | keys_remove nameserver domain search)" + if [ -n "$stuff" ]; then + newconf="$newconf$stuff$NL" + fi + + # Append any user defined ones + if [ -n "$resolv_conf_options" ]; then + newconf="${newconf}options $resolv_conf_options$NL" + fi + if [ -n "$resolv_conf_sortlist" ]; then + newconf="${newconf}sortlist $resolv_conf_sortlist$NL" fi if [ -n "$resolv_conf_tail" ]; then @@ -151,6 +211,22 @@ if [ -e "$resolv_conf" ]; then [ "$(cat "$resolv_conf")" = "$(printf %s "$newconf")" ] && exit 0 fi +# Change is good. +# If the old file does not have our signature, back it up. +# If the new file just has our signature, restore the backup. +if $backup; then + if [ "$newconf" = "$signature$NL" ]; then + if [ -e "$resolv_conf.bak" ]; then + newconf="$(cat "$resolv_conf.bak")" + fi + elif [ -e "$resolv_conf" ]; then + read line <"$resolv_conf" + if [ "$line" != "$signature" ]; then + cp "$resolv_conf" "$resolv_conf.bak" + fi + fi +fi + # Create our resolv.conf now (umask 022; printf %s "$newconf" >"$resolv_conf") eval $libc_restart Modified: vendor/openresolv/dist/named.in ============================================================================== --- vendor/openresolv/dist/named.in Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/named.in Mon May 4 20:51:27 2015 (r282431) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2011 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # named subscriber for resolvconf @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$named_zones" -a -z "$named_options" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -40,6 +40,9 @@ then if [ -x "@RCDIR@"/bind9 ]; then # Debian and derivatives named_service=bind9 + elif [ -x "@RCDIR@"/rc.bind ]; then + # Slackware + named_service=rc.bind fi fi : ${named_service:=named} @@ -75,7 +78,7 @@ done if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$named_options" "$named_zones" else - @PREFIX@/sbin/resolvconf -D "$named_options" "$named_zones" + @SBINDIR@/resolvconf -D "$named_options" "$named_zones" fi # No point in changing files or reloading bind if the end result has not Added: vendor/openresolv/dist/pdns_recursor.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openresolv/dist/pdns_recursor.in Mon May 4 20:51:27 2015 (r282431) @@ -0,0 +1,72 @@ +#!/bin/sh +# Copyright (c) 2009-2011 Roy Marples +# All rights reserved + +# PowerDNS Recursor subscriber for resolvconf + +# 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. + +[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 +. "@SYSCONFDIR@/resolvconf.conf" || exit 1 +[ -z "$pdns_zones" ] && exit 0 +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" + +: ${pdns_service:=pdns_recursor} +: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} + +newzones= + +# pds_recursor does not present support global forward servers, which +# does limit it's usefulness somewhat. +# If it did, the below code can be enabled, or something like it. +#for n in $NAMESERVERS; do +# newzones="$newzones${newzones:+,}$n" +#done +#[ -n "$newzones" ] && newzones=".=$newzones$NL" + +for d in $DOMAINS; do + newns= + ns="${d#*:}" + while [ -n "$ns" ]; do + newns="$newns${newns:+,}${ns%%,*}" + [ "$ns" = "${ns#*,}" ] && break + ns="${ns#*,}" + done + [ -n "$newns" ] && newzones="$newzones${d%%:*}=$newns$NL" +done + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_zones" +else + @SBINDIR@/resolvconf -D "$pdnsd_zones" +fi + +if [ ! -f "$pdns_zones" ] || \ + [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] +then + printf %s "$newzones" >"$pdns_zones" + eval $pdns_restart +fi Modified: vendor/openresolv/dist/pdnsd.in ============================================================================== --- vendor/openresolv/dist/pdnsd.in Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/pdnsd.in Mon May 4 20:51:27 2015 (r282431) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010-2011 Roy Marples +# Copyright (c) 2010-2013 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -48,7 +48,7 @@ remove_markers() sed "/^$m1/,/^$m2/d" $@ else for x; do - while read line; do + while read -r line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; @@ -82,19 +82,19 @@ change_file() return 0 } -newresolv="# Generated by resolvconf\n" +newresolv="# Generated by resolvconf$NL" changed=false # Try to ensure that config dirs exist if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$pdnsd_resolv" "$pdnsd_conf" else - @PREFIX@/sbin/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" + @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" fi if [ -n "$pdnsd_resolv" ]; then for n in $NAMESERVERS; do - newresolv="${newresolv}nameserver $n\n" + newresolv="${newresolv}nameserver $n$NL" done fi @@ -146,7 +146,7 @@ if [ -w "$pdnsd_conf" ]; then fi if change_file "$pdnsd_conf" "$cf"; then changed=true - fi + fi fi if [ -n "$pdnsd_resolv" ]; then Modified: vendor/openresolv/dist/resolvconf.8.in ============================================================================== --- vendor/openresolv/dist/resolvconf.8.in Mon May 4 20:36:00 2015 (r282430) +++ vendor/openresolv/dist/resolvconf.8.in Mon May 4 20:51:27 2015 (r282431) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007-2011 Roy Marples +.\" Copyright (c) 2007-2015 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,8 +22,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 13, 2011 -.Dt RESOLVCONF 8 SMM +.Dd April 27, 2014 +.Dt RESOLVCONF 8 .Os .Sh NAME .Nm resolvconf @@ -34,11 +34,14 @@ .Nm .Op Fl m Ar metric .Op Fl p -.Fl a Ar interface No < Ns Pa file +.Op Fl x +.Fl a Ar interface Ns Op Ar .protocol +.No < Ns Pa file .Nm .Op Fl f -.Fl d Ar interface +.Fl d Ar interface Ns Op Ar .protocol .Nm +.Op Fl x .Fl il Ar pattern .Nm .Fl u @@ -63,7 +66,7 @@ file to via .Xr stdin 3 with the argument -.Fl a Ar interface +.Fl a Ar interface Ns Op Ar .protocol instead of the filesystem. .Nm then updates @@ -78,6 +81,20 @@ then will supply files that the resolver should be configured to include. .Pp .Nm +assumes it has a job to do. +In some situations +.Nm +needs to act as a deterrent to writing to +.Pa /etc/resolv.conf . +Where this file cannot be made immutable or you just need to toggle this +behaviour, +.Nm +can be disabled by adding +.Sy resolvconf Ns = Ns NO +to +.Xr resolvconf.conf 5 . +.Pp +.Nm can mark an interfaces .Pa resolv.conf as private. @@ -91,13 +108,21 @@ for how to configure .Nm to use a local name server. .Pp +.Nm +can mark an interfaces +.Pa resolv.conf +as exclusive. +Only the latest exclusive interface is used for processing, otherwise all are. +.Pp When an interface goes down, it should then call .Nm with -.Fl d Ar interface +.Fl d Ar interface.* arguments to delete the .Pa resolv.conf -file for the +file(s) for all the +.Ar protocols +on the .Ar interface . *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 4 20:52:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBDBB381; Mon, 4 May 2015 20:52: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 A245E1457; Mon, 4 May 2015 20:52: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 t44KqLIe037750; Mon, 4 May 2015 20:52:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44KqLcA037748; Mon, 4 May 2015 20:52:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505042052.t44KqLcA037748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 20:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r282432 - vendor/openresolv/3.7.0 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 20:52:21 -0000 Author: gjb Date: Mon May 4 20:52:21 2015 New Revision: 282432 URL: https://svnweb.freebsd.org/changeset/base/282432 Log: Tag openresolv-3.7.0. PR: 199854 Sponsored by: The FreeBSD Foundation Added: vendor/openresolv/3.7.0/ - copied from r282431, vendor/openresolv/dist/ From owner-svn-src-all@FreeBSD.ORG Mon May 4 20:59:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 168EE62A; Mon, 4 May 2015 20:59: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 053C014D2; Mon, 4 May 2015 20:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44KxOaW038738; Mon, 4 May 2015 20:59:24 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44KxNBk038733; Mon, 4 May 2015 20:59:23 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505042059.t44KxNBk038733@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 4 May 2015 20:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282433 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2015 20:59:25 -0000 Author: loos Date: Mon May 4 20:59:23 2015 New Revision: 282433 URL: https://svnweb.freebsd.org/changeset/base/282433 Log: In preparation for the next cycle of official ARM images, add ARM_NEW_PMAP to supported kernels. This is a temporary solution and should be reverted when ARM_NEW_PMAP is enabled by default. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/PANDABOARD head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/BEAGLEBONE Mon May 4 20:59:23 2015 (r282433) @@ -67,6 +67,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/PANDABOARD Mon May 4 20:59:23 2015 (r282433) @@ -64,6 +64,7 @@ options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/RPI-B Mon May 4 20:59:23 2015 (r282433) @@ -57,6 +57,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/RPI2 Mon May 4 20:59:23 2015 (r282433) @@ -57,6 +57,7 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Mon May 4 20:52:21 2015 (r282432) +++ head/sys/arm/conf/ZEDBOARD Mon May 4 20:59:23 2015 (r282433) @@ -56,6 +56,7 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores +options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Mon May 4 21:03:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43F7E7F7; Mon, 4 May 2015 21:03:13 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0F6715D4; Mon, 4 May 2015 21:03:12 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YpNW4-000Ete-9M; Tue, 05 May 2015 00:03:04 +0300 Date: Tue, 5 May 2015 00:03:04 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150504210304.GA1394@zxy.spb.ru> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 21:03:13 -0000 On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: > On Monday, May 04, 2015 09:51:25 PM Gleb Smirnoff wrote: > > John, > > > > On Mon, May 04, 2015 at 09:58:49AM -0400, John Baldwin wrote: > > J> > J> > J> So the importaing thing here is that if_get_counter() is still doing > > J> > J> > J> per-ifnet stats. The stat you underlined above is per-queue instead. > > J> > J> > J> We well need more explicitly knowledge of queues outside of drivers > > J> > J> > J> and in the stack itself to support a generic framework for per-queue > > J> > J> > J> stats. > > J> > J> > > > J> > J> > This depends on how generic we want the API to be. Of course, we can add > > J> > J> > an extra argument to if_get_counter(). > > J> > J> > > > J> > J> > However, if we don't expect the number of queues to exceed a reasonable > > J> > J> > number of 255 :), we can fit the functionality into existing API. > > J> > J> > We can keep the queue number in the highest 8 bits of the ift_counter > > J> > J> > parameter. > > J> > J> > > > J> > J> > #define IFCOUNTER_MASK 0x00ffffff > > J> > J> > #define IFCOUNTER_QUEUE(c) ((c) >> 24) > > J> > J> > > J> > J> I'd prefer that expose queues more directly and figure out how to handle > > J> > J> per-queue stats then (e.g. do we have some sort of driver-independent > > J> > J> structure that each ifnet has 1 or more of that maps to a queue and has > > J> > J> driver provided methods, etc. If so you could have a driver method for > > J> > J> queue stats). Note that I did use if_get_counter to report the > > J> > J> per-interface stats instead of adding a new sysctl. > > J> > > > J> > What do you prefer: an extra argument to the if_get_counter() or a extra > > J> > ifop? > > J> > > J> As I said, I'd prefer we expose queues to the stack more directly complete > > J> with per-queue ops (e.g. I'd like a per-queue if_transmit thing, though > > J> probably more like the old if_start). > > > > Your answer seems quite orthogonal to my question. I reread it couple of times, > > but still can't figure out how exactly do you prefet to fetch per-queue stats. > > Can you please explain in more detail? > > struct if_queue { > struct ifnet *ifq_parent; > void (*ifq_get_counter)(struct if_queue *, ift_counter); > ... > }; > > (Pretend that if_queue is a new object type and that each RX or TX queue on a > NIC has one.) What about bulk get? One request for 1.5K queues stats. From owner-svn-src-all@FreeBSD.ORG Mon May 4 21:07:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42A4F9CF; Mon, 4 May 2015 21:07: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 30432160A; Mon, 4 May 2015 21:07: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 t44L7ODe043481; Mon, 4 May 2015 21:07:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44L7L3I043469; Mon, 4 May 2015 21:07:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505042107.t44L7L3I043469@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 21:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282434 - in head: contrib/openresolv sbin/resolvconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 21:07:24 -0000 Author: gjb Date: Mon May 4 21:07:20 2015 New Revision: 282434 URL: https://svnweb.freebsd.org/changeset/base/282434 Log: MFV r225523, r282431: r225523 (hrs): Import openresolv-3.4.4. r282431: Import openresolv-3.7.0. PR: 199854 Submitted by: yuri@rawbw.com MFC after: 1 week Relnotes: yes Sponsored by: The FreeBSD Foundation Added: head/contrib/openresolv/GNUmakefile - copied unchanged from r282431, vendor/openresolv/dist/GNUmakefile head/contrib/openresolv/config-null.mk - copied unchanged from r282431, vendor/openresolv/dist/config-null.mk head/contrib/openresolv/pdns_recursor.in - copied unchanged from r282431, vendor/openresolv/dist/pdns_recursor.in Modified: head/contrib/openresolv/Makefile head/contrib/openresolv/configure head/contrib/openresolv/dnsmasq.in head/contrib/openresolv/libc.in head/contrib/openresolv/named.in head/contrib/openresolv/pdnsd.in head/contrib/openresolv/resolvconf.8.in head/contrib/openresolv/resolvconf.conf.5.in head/contrib/openresolv/resolvconf.in head/contrib/openresolv/unbound.in head/sbin/resolvconf/Makefile Directory Properties: head/contrib/openresolv/ (props changed) Copied: head/contrib/openresolv/GNUmakefile (from r282431, vendor/openresolv/dist/GNUmakefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openresolv/GNUmakefile Mon May 4 21:07:20 2015 (r282434, copy of r282431, vendor/openresolv/dist/GNUmakefile) @@ -0,0 +1,4 @@ +# Nasty hack so that make clean works without configure being run +CONFIG_MK?=$(shell test -e config.mk && echo config.mk || echo config-null.mk) + +include Makefile Modified: head/contrib/openresolv/Makefile ============================================================================== --- head/contrib/openresolv/Makefile Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/Makefile Mon May 4 21:07:20 2015 (r282434) @@ -1,8 +1,19 @@ -include config.mk +PKG= openresolv +VERSION= 3.7.0 -NAME= openresolv -VERSION= 3.4.1 -PKG= ${NAME}-${VERSION} +# Nasty hack so that make clean works without configure being run +_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk +CONFIG_MK?= ${_CONFIG_MK} +include ${CONFIG_MK} + +SBINDIR?= /sbin +SYSCONFDIR?= /etc +LIBEXECDIR?= /libexec/resolvconf +VARDIR?= /var/run/resolvconf +RCDIR?= /etc/rc.d +RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \ + ${RCDIR}/\1 restart; \ + fi INSTALL?= install SED?= sed @@ -17,31 +28,36 @@ TARGET= ${RESOLVCONF} ${SUBSCRIBERS} SRCS= ${TARGET:C,$,.in,} # pmake SRCS:= ${TARGET:=.in} # gmake -SED_PREFIX= -e 's:@PREFIX@:${PREFIX}:g' +SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g' SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' +DISTPREFIX?= ${PKG}-${VERSION} +DISTFILEGZ?= ${DISTPREFIX}.tar.gz +DISTFILE?= ${DISTPREFIX}.tar.bz2 +FOSSILID?= current + .SUFFIXES: .in all: ${TARGET} .in: - ${SED} ${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ + ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \ $< > $@ clean: - rm -f ${TARGET} openresolv-${VERSION}.tar.bz2 + rm -f ${TARGET} distclean: clean - rm -f config.mk + rm -f config.mk ${DISTFILE} installdirs: -install: ${TARGET} +proginstall: ${TARGET} ${INSTALL} -d ${DESTDIR}${SBINDIR} ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR} ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} @@ -49,18 +65,21 @@ install: ${TARGET} ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR} ${INSTALL} -d ${DESTDIR}${LIBEXECDIR} ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR} + +maninstall: ${INSTALL} -d ${DESTDIR}${MANDIR}/man8 ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8 ${INSTALL} -d ${DESTDIR}${MANDIR}/man5 ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5 +install: proginstall maninstall + import: - rm -rf /tmp/${PKG} - ${INSTALL} -d /tmp/${PKG} - cp README ${SRCS} /tmp/${PKG} - -dist: import - cp configure Makefile resolvconf.conf /tmp/${PKG} - tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} - rm -rf /tmp/${PKG} - ls -l ${PKG}.tar.bz2 + rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + cp README ${SRCS} /tmp/${DISPREFIX} + +dist: + fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} + gunzip -c ${DISTFILEGZ} | bzip2 >${DISTFILE} + rm ${DISTFILEGZ} Copied: head/contrib/openresolv/config-null.mk (from r282431, vendor/openresolv/dist/config-null.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openresolv/config-null.mk Mon May 4 21:07:20 2015 (r282434, copy of r282431, vendor/openresolv/dist/config-null.mk) @@ -0,0 +1 @@ +# This space left intentionally blank Modified: head/contrib/openresolv/configure ============================================================================== --- head/contrib/openresolv/configure Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/configure Mon May 4 21:07:20 2015 (r282434) @@ -9,7 +9,7 @@ TARGET= RESTARTCMD= RCDIR= -for x; do +for x do opt=${x%%=*} var=${x#*=} case "$opt" in @@ -18,7 +18,7 @@ for x; do --debug) DEBUG=$var;; --disable-debug) DEBUG=no;; --enable-debug) DEBUG=yes;; - --prefix) prefix=$var;; + --prefix) PREFIX=$var;; --sysconfdir) SYSCONFDIR=$var;; --bindir|--sbindir) SBINDIR=$var;; --libexecdir) LIBEXECDIR=$var;; @@ -41,68 +41,76 @@ for x; do esac done +if [ -z "$LIBEXECDIR" ]; then + printf "Checking for directory /libexec ... " + if [ -d /libexec ]; then + echo "yes" + LIBEXECDIR=$PREFIX/libexec/resolvconf + else + echo "no" + LIBEXECDIR=$PREFIX/lib/resolvconf + fi +fi +if [ -z "$RUNDIR" ]; then + printf "Checking for directory /run ... " + if [ -d /run ]; then + echo "yes" + RUNDIR=/run + else + echo "no" + RUNDIR=/var/run + fi +fi + : ${SED:=sed} -: ${PREFIX:=$prefix} : ${SYSCONFDIR:=$PREFIX/etc} : ${SBINDIR:=$PREFIX/sbin} -: ${LIBEXECDIR:=$PREFIX/libexec} +: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} : ${STATEDIR:=/var} : ${RUNDIR:=$STATEDIR/run} : ${MANDIR:=${PREFIX:-/usr}/share/man} eval SYSCONFDIR="$SYSCONFDIR" eval SBINDIR="$SBINDIR" -eval LIBEXECDIR="$LIBEXECDIR/resolvconf" +eval LIBEXECDIR="$LIBEXECDIR" eval VARDIR="$RUNDIR/resolvconf" eval MANDIR="$MANDIR" CONFIG_MK=config.mk if [ -z "$BUILD" ]; then - BUILD=`uname -m`-`uname -s | tr '[:upper:]' '[:lower:]'` -fi -if [ -z "$HOST" ]; then - [ -z "$TARGET" ] && TARGET=$BUILD - HOST=$TARGET -fi -if [ -z "$TARGET" ]; then - [ -z "$HOST" ] && HOST=$BUILD - TARGET=$HOST -fi - -# Debian and Slackware have linux in different places when dealing with -# autoconf, so we deal with that here. -if [ -z "$OS" ]; then - case "$TARGET" in - *-linux-*|linux-*|*-linux|linux) OS=linux;; - esac + # autoconf target triplet: cpu-vendor-os + BUILD=$(uname -m)-unknown-$(uname -s | tr '[:upper:]' '[:lower:]') fi +: ${HOST:=$BUILD} if [ -z "$OS" ]; then - # Derive OS from cpu-manufacturer-os-kernel - CPU=${TARGET%%-*} - REST=${TARGET#*-} + echo "Deriving operating system from ... $HOST" + # Derive OS from cpu-vendor-[kernel-]os + CPU=${HOST%%-*} + REST=${HOST#*-} if [ "$CPU" != "$REST" ]; then - MANU=${REST%%-*} + VENDOR=${REST%%-*} REST=${REST#*-} - if [ "$MANU" != "$REST" ]; then + if [ "$VENDOR" != "$REST" ]; then + # Use kernel if given, otherwise os OS=${REST%%-*} - REST=${REST#*-} - if [ "$OS" != "$REST" ]; then - KERNEL=${REST%%-*} - else - # 3 tupple - KERNEL=$OS - OS=$MANU - MANU= - fi else # 2 tupple - OS=$MANU - MANU= + OS=$VENDOR + VENDOR= fi fi + + # Work with cpu-kernel-os, ie Debian + case "$VENDOR" in + linux*|kfreebsd*) OS=$VENDOR; VENDOR= ;; + esac + # Special case + case "$OS" in + gnu*) OS=hurd;; # No HURD support as yet + esac fi echo "Configuring openresolv for ... $OS" @@ -118,17 +126,36 @@ for x in SYSCONFDIR SBINDIR LIBEXECDIR V echo "$x=$t $v" >>$CONFIG_MK done -if [ -e /etc/arch-release -a -d /etc/rc.d ]; then - echo "Overriding service status check for Arch Linux" - RCDIR=/etc/rc.d - RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" - echo "yes" +if [ -z "$RESTARTCMD" ]; then + printf "Checking for systemd ... " + if [ -x /bin/systemctl ]; then + RESTARTCMD="/bin/systemctl try-restart \1" + echo "yes" + elif [ -x /usr/bin/systemctl ]; then + RESTARTCMD="/usr/bin/systemctl try-restart \1" + echo "yes" + else + echo "no" + fi +fi + +# Arch upgraded to systemd, so this check has to be just after systemd +# but higher than the others +if [ -z "$RESTARTCMD" ]; then + printf "Checking for Arch ... " + if [ -e /etc/arch-release -a -d /etc/rc.d ]; then + RCDIR=/etc/rc.d + RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" + echo "yes" + else + echo "no" + fi fi if [ -z "$RESTARTCMD" ]; then printf "Checking for OpenRC ... " if [ -x /sbin/rc-service ]; then - RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -- -Ds restart" + RESTARTCMD="if /sbin/rc-service -e \1; then /sbin/rc-service \1 -- -Ds restart; fi" echo "yes" else echo "no" @@ -138,7 +165,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for invoke-rc.d ... " if [ -x /usr/sbin/invoke-rc.d ]; then RCDIR=/etc/init.d - RESTARTCMD="/usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1 \&\& /usr/sbin/invoke-rc.d \1 restart" + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1; then /usr/sbin/invoke-rc.d \1 restart; fi" echo "yes" else echo "no" @@ -148,7 +175,19 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for service ... " if [ -x /sbin/service ]; then RCDIR=/etc/init.d - RESTARTCMD="/sbin/service \1 \&\& /sbin/service \1 restart" + RESTARTCMD="if /sbin/service \1; then /sbin/service \1 restart; fi" + echo "yes" + else + echo "no" + fi +fi +if [ -z "$RESTARTCMD" ]; then + printf "Checking for runit... " + if [ -x /bin/sv ]; then + RESTARTCMD="/bin/sv try-restart \1" + echo "yes" + elif [ -x /usr/bin/sv ]; then + RESTARTCMD="/usr/bin/sv try-restart \1" echo "yes" else echo "no" @@ -159,7 +198,7 @@ if [ -z "$RESTARTCMD" ]; then printf "Checking for $x ... " if [ -d $x ]; then RCDIR=$x - RESTARTCMD="$x/\1 status >/dev/null 2>\&1 \&\& $x/\1 restart" + RESTARTCMD="if $x/\1 status >/dev/null 2>\&1; then $x/\1 restart; fi" echo "yes" break else @@ -169,7 +208,7 @@ if [ -z "$RESTARTCMD" ]; then fi if [ -z "$RESTARTCMD" ]; then - echo "WARNING! No means of interacting with system services detected!" + echo "$0: WARNING: No means of interacting with system services detected!" exit 1 fi Modified: head/contrib/openresolv/dnsmasq.in ============================================================================== --- head/contrib/openresolv/dnsmasq.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/dnsmasq.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -29,12 +29,13 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " : ${dnsmasq_pid:=/var/run/dnsmasq.pid} [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid +[ -s "$dnsmasq_pid" ] || unset dnsmasq_pid : ${dnsmasq_service:=dnsmasq} : ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} newconf="# Generated by resolvconf$NL" @@ -46,21 +47,18 @@ newresolv="$newconf" # so we need to validate a few things first. # Check for DBus support in the binary dbus=false -: ${dbus_pid:=/var/run/dbus/dbus.pid} -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus.pid -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus/pid -if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" ]; then - if dnsmasq --version 2>/dev/null | \ - grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" +dbus_ex=false +dbus_introspect=$(dbus-send --print-reply --system \ + --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq \ + org.freedesktop.DBus.Introspectable.Introspect \ + 2>/dev/null) +if [ $? = 0 ]; then + dbus=true + if printf %s "$dbus_introspect" | \ + grep -q '' then - # Sanity - check that dnsmasq and dbus are running - if kill -0 $(cat "$dbus_pid") 2>/dev/null && \ - kill -0 $(cat "$dnsmasq_pid") 2>/dev/null - then - dbus=true - newconf="$newconf$NL# Domain specific servers will" - newconf="$newconf be sent over dbus${NL}enable-dbus$NL" - fi + dbus_ex=true fi fi @@ -69,30 +67,97 @@ for n in $NAMESERVERS; do done dbusdest= +dbusdest_ex= +conf= for d in $DOMAINS; do dn="${d%%:*}" ns="${d#*:}" while [ -n "$ns" ]; do - if $dbus; then - SIFS=${IFS-y} OIFS=$IFS - IFS=. - set -- ${ns%%,*} - num="0x$(printf %02x $1 $2 $3 $4)" - if [ "$SIFS" = yi ]; then - unset IFS - else - IFS=$OIFS - fi - dbusdest="$dbusdest uint32:$(printf %u $num)" - dbusdest="$dbusdest string:$dn" - else - newconf="${newconf}server=/$dn/${ns%%,*}$NL" + n="${ns%%,*}" + if $dbus && ! $dbus_ex; then + case "$n" in + *.*.*.*) + SIFS=${IFS-y} OIFS=$IFS + IFS=. + set -- $n + num="0x$(printf %02x $1 $2 $3 $4)" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="$dbusdest uint32:$(printf %u $num)" + dbusdest="$dbusdest string:$dn" + ;; + *:*%*) + # This version of dnsmasq won't accept + # scoped IPv6 addresses + dbus=false + ;; + *:*) + SIFS=${IFS-y} OIFS=$IFS bytes= front= back= + empty=false i=0 + IFS=: + set -- $n + while [ -n "$1" -o -n "$2" ]; do + addr="$1" + shift + if [ -z "$addr" ]; then + empty=true + continue + fi + i=$(($i + 1)) + while [ ${#addr} -lt 4 ]; do + addr="0${addr}" + done + byte1="$(printf %d 0x${addr%??})" + byte2="$(printf %d 0x${addr#??})" + if $empty; then + back="$back byte:$byte1 byte:$byte2" + else + front="$front byte:$byte1 byte:$byte2" + fi + done + while [ $i != 8 ]; do + i=$(($i + 1)) + front="$front byte:0 byte:0" + done + front="${front}$back" + if [ "$SIFS" = y ]; then + unset IFS + else + IFS=$OIFS + fi + dbusdest="${dbusdest}$front string:$dn" + ;; + *) + if ! $dbus_ex; then + dbus=false + fi + ;; + esac fi + dbusdest_ex="$dbusdest_ex${dbusdest_ex:+,}/$dn/$n" + conf="${conf}server=/$dn/$n$NL" [ "$ns" = "${ns#*,}" ] && break ns="${ns#*,}" done done +if $dbus; then + newconf="$newconf$NL# Domain specific servers will" + newconf="$newconf be sent over dbus${NL}" +else + newconf="$newconf$conf" +fi + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv" +else + @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" +fi + changed=false if [ -n "$dnsmasq_conf" ]; then if [ ! -f "$dnsmasq_conf" ] || \ @@ -103,14 +168,13 @@ if [ -n "$dnsmasq_conf" ]; then fi fi if [ -n "$dnsmasq_resolv" ]; then + # dnsmasq polls this file so no need to set changed=true if [ -f "$dnsmasq_resolv" ]; then if [ "$(cat "$dnsmasq_resolv")" != "$(printf %s "$newresolv")" ] then - changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi else - # dnsmasq polls this file so no need to set changed=true printf %s "$newresolv" >"$dnsmasq_resolv" fi fi @@ -119,9 +183,20 @@ if $changed; then eval $dnsmasq_restart fi if $dbus; then - $changed || kill -HUP $(cat "$dnsmasq_pid") + if [ -s "$dnsmasq_pid" ]; then + $changed || kill -HUP $(cat "$dnsmasq_pid") + fi # Send even if empty so old servers are cleared + if $dbus_ex; then + method=SetDomainServers + if [ -n "$dbusdest_ex" ]; then + dbusdest_ex="array:string:$dbusdest_ex" + fi + dbusdest="$dbusdest_ex" + else + method=SetServers + fi dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ - /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \ + /uk/org/thekelleys/dnsmasq uk.org.thekelleys.$method \ $dbusdest fi Modified: head/contrib/openresolv/libc.in ============================================================================== --- head/contrib/openresolv/libc.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/libc.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2014 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -36,18 +36,18 @@ NL=" # sed may not be available, and this is faster on small files key_get_value() { - local key="$1" value= x= line= + local key="$1" x= line= shift if [ $# -eq 0 ]; then - while read line; do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac done else - for x; do - while read line; do + for x do + while read -r line; do case "$line" in "$key"*) echo "${line##$key}";; esac @@ -56,6 +56,24 @@ key_get_value() fi } +keys_remove() +{ + local key x line found + + while read -r line; do + found=false + for key do + case "$line" in + "$key"*|"#"*|" "*|" "*|"") found=true;; + esac + $found && break + done + $found || echo "$line" + done +} + +local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" + # Support original resolvconf configuration layout # as well as the openresolv config file if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then @@ -64,12 +82,11 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then - name_servers="$(key_get_value "nameserver " "$base")" - search_domains="$(key_get_value "search " "$base")" - if [ -z "$search_domains" ]; then - search_domains="$(key_get_value "domain " "$base")" - fi + prepend_nameservers="$(key_get_value "nameserver " "$base")" + domain="$(key_get_value "domain " "$base")" + prepend_search="$(key_get_value "search " "$base")" resolv_conf_options="$(key_get_value "options " "$base")" + resolv_conf_sortlist="$(key_get_value "sortlist " "$base")" fi if [ -f "$SYSCONFDIR"/resolv.conf.d/head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.d/head)" @@ -81,7 +98,7 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${libc_restart:=@RESTARTCMD ${libc_service}@} -: ${list_resolv:=@PREFIX@/sbin/resolvconf -l} +: ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi @@ -89,6 +106,9 @@ if [ "${resolv_conf_tail-x}" = x -a -f " resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)" fi +backup=true +signature="# Generated by resolvconf" + uniqify() { local result= @@ -104,6 +124,7 @@ uniqify() case "${resolv_conf_passthrough:-NO}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + backup=false newest= for conf in "$IFACEDIR"/*; do if [ -z "$newest" -o "$conf" -nt "$newest" ]; then @@ -113,31 +134,70 @@ case "${resolv_conf_passthrough:-NO}" in [ -z "$newest" ] && exit 0 newconf="$(cat "$newest")$NL" ;; +/dev/null|[Nn][Uu][Ll][Ll]) + : ${resolv_conf_local_only:=NO} + if [ "$local_nameservers" = "127.* 0.0.0.0 255.255.255.255 ::1" ]; then + local_nameservers= + fi + # Need to overwrite our variables. + eval "$(@SBINDIR@/resolvconf -V)" + ;; + +*) + [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" + ;; +esac +case "${resolv_conf_passthrough:-NO}" in +[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;; *) - [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" - newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)" + : ${domain:=$DOMAIN} + newsearch="$(uniqify $prepend_search $SEARCH $append_search)" NS="$LOCALNAMESERVERS $NAMESERVERS" - newns="$(uniqify $name_servers $NS $name_servers_append)" + newns= + gotlocal=false + for n in $(uniqify $prepend_nameservers $NS $append_nameservers); do + add=true + islocal=false + for l in $local_nameservers; do + case "$n" in + $l) islocal=true; gotlocal=true; break;; + esac + done + if ! $islocal; then + case "${resolv_conf_local_only:-YES}" in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + $gotlocal && add=false;; + esac + fi + $add && newns="$newns $n" + done # Hold our new resolv.conf in a variable to save on temporary files - newconf="# Generated by resolvconf$NL" + newconf="$signature$NL" if [ -n "$resolv_conf_head" ]; then newconf="$newconf$resolv_conf_head$NL" fi - [ -n "$newsearch" ] && newconf="${newconf}search $newsearch$NL" + + [ -n "$domain" ] && newconf="${newconf}domain $domain$NL" + if [ -n "$newsearch" -a "$newsearch" != "$domain" ]; then + newconf="${newconf}search $newsearch$NL" + fi for n in $newns; do newconf="${newconf}nameserver $n$NL" done - # Now get any configured options - opts="$resolv_conf_options${resolv_conf_options:+ }" - opts="$opts$($list_resolv | key_get_value "options ")" - if [ -n "$opts" ]; then - newconf="${newconf}options" - for opt in $(uniqify $opts); do - newconf="${newconf} $opt" - done - newconf="$newconf$NL" + # Now add anything we don't care about such as sortlist and options + stuff="$($list_resolv | keys_remove nameserver domain search)" + if [ -n "$stuff" ]; then + newconf="$newconf$stuff$NL" + fi + + # Append any user defined ones + if [ -n "$resolv_conf_options" ]; then + newconf="${newconf}options $resolv_conf_options$NL" + fi + if [ -n "$resolv_conf_sortlist" ]; then + newconf="${newconf}sortlist $resolv_conf_sortlist$NL" fi if [ -n "$resolv_conf_tail" ]; then @@ -151,6 +211,22 @@ if [ -e "$resolv_conf" ]; then [ "$(cat "$resolv_conf")" = "$(printf %s "$newconf")" ] && exit 0 fi +# Change is good. +# If the old file does not have our signature, back it up. +# If the new file just has our signature, restore the backup. +if $backup; then + if [ "$newconf" = "$signature$NL" ]; then + if [ -e "$resolv_conf.bak" ]; then + newconf="$(cat "$resolv_conf.bak")" + fi + elif [ -e "$resolv_conf" ]; then + read line <"$resolv_conf" + if [ "$line" != "$signature" ]; then + cp "$resolv_conf" "$resolv_conf.bak" + fi + fi +fi + # Create our resolv.conf now (umask 022; echo "$newconf" >"$resolv_conf") eval $libc_restart @@ -162,7 +238,7 @@ for script in "$LIBEXECDIR"/libc.d/*; do if [ -x "$script" ]; then "$script" "$@" else - (. "$script" "$@") + (. "$script") fi retval=$(($retval + $?)) fi Modified: head/contrib/openresolv/named.in ============================================================================== --- head/contrib/openresolv/named.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/named.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2009 Roy Marples +# Copyright (c) 2007-2012 Roy Marples # All rights reserved # named subscriber for resolvconf @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$named_zones" -a -z "$named_options" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -40,6 +40,9 @@ then if [ -x "@RCDIR@"/bind9 ]; then # Debian and derivatives named_service=bind9 + elif [ -x "@RCDIR@"/rc.bind ]; then + # Slackware + named_service=rc.bind fi fi : ${named_service:=named} @@ -71,6 +74,13 @@ for d in $DOMAINS; do newzones="$newzones };$NL};$NL" done +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$named_options" "$named_zones" +else + @SBINDIR@/resolvconf -D "$named_options" "$named_zones" +fi + # No point in changing files or reloading bind if the end result has not # changed changed=false Copied: head/contrib/openresolv/pdns_recursor.in (from r282431, vendor/openresolv/dist/pdns_recursor.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openresolv/pdns_recursor.in Mon May 4 21:07:20 2015 (r282434, copy of r282431, vendor/openresolv/dist/pdns_recursor.in) @@ -0,0 +1,72 @@ +#!/bin/sh +# Copyright (c) 2009-2011 Roy Marples +# All rights reserved + +# PowerDNS Recursor subscriber for resolvconf + +# 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. + +[ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 +. "@SYSCONFDIR@/resolvconf.conf" || exit 1 +[ -z "$pdns_zones" ] && exit 0 +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" + +: ${pdns_service:=pdns_recursor} +: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} + +newzones= + +# pds_recursor does not present support global forward servers, which +# does limit it's usefulness somewhat. +# If it did, the below code can be enabled, or something like it. +#for n in $NAMESERVERS; do +# newzones="$newzones${newzones:+,}$n" +#done +#[ -n "$newzones" ] && newzones=".=$newzones$NL" + +for d in $DOMAINS; do + newns= + ns="${d#*:}" + while [ -n "$ns" ]; do + newns="$newns${newns:+,}${ns%%,*}" + [ "$ns" = "${ns#*,}" ] && break + ns="${ns#*,}" + done + [ -n "$newns" ] && newzones="$newzones${d%%:*}=$newns$NL" +done + +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_zones" +else + @SBINDIR@/resolvconf -D "$pdnsd_zones" +fi + +if [ ! -f "$pdns_zones" ] || \ + [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] +then + printf %s "$newzones" >"$pdns_zones" + eval $pdns_restart +fi Modified: head/contrib/openresolv/pdnsd.in ============================================================================== --- head/contrib/openresolv/pdnsd.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/pdnsd.in Mon May 4 21:07:20 2015 (r282434) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010 Roy Marples +# Copyright (c) 2010-2013 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -29,7 +29,9 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" +NL=" +" : ${pdnsd_restart:=pdnsd-ctl config $pdnsd_conf} signature="# Generated by resolvconf" @@ -46,7 +48,7 @@ remove_markers() sed "/^$m1/,/^$m2/d" $@ else for x; do - while read line; do + while read -r line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; @@ -80,24 +82,32 @@ change_file() return 0 } -newresolv="# Generated by resolvconf\n" +newresolv="# Generated by resolvconf$NL" changed=false +# Try to ensure that config dirs exist +if type config_mkdirs >/dev/null 2>&1; then + config_mkdirs "$pdnsd_resolv" "$pdnsd_conf" +else + @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" +fi + if [ -n "$pdnsd_resolv" ]; then for n in $NAMESERVERS; do - newresolv="${newresolv}nameserver $n\n" + newresolv="${newresolv}nameserver $n$NL" done fi -if [ -n "$pdnsd_conf" ]; then +# Only modify the configuration if it exists and we can write to it +if [ -w "$pdnsd_conf" ]; then cf="$pdnsd_conf.new" newconf= if [ -z "$pdnsd_resolv" ]; then - newconf="${newconf}server {\n" - newconf="${newconf}\tlabel=resolvconf;\n" + newconf="${newconf}server {$NL" + newconf="${newconf} label=resolvconf;$NL" if [ -n "$NAMESERVERS" ]; then - newconf="${newconf}\tip=" + newconf="${newconf} ip=" first=true for n in $NAMESERVERS; do if $first; then @@ -107,16 +117,16 @@ if [ -n "$pdnsd_conf" ]; then fi newconf="$newconf$n" done - newconf="${newconf};\n" + newconf="${newconf};$NL" fi - newconf="${newconf}}\n" + newconf="${newconf}}$NL" fi for d in $DOMAINS; do - newconf="${newconf}server {\n" - newconf="${newconf}\tinclude=.${d%%:*}.;\n" - newconf="${newconf}\tpolicy=excluded;\n" - newconf="${newconf}\tip=" + newconf="${newconf}server {$NL" + newconf="${newconf} include=.${d%%:*}.;$NL" + newconf="${newconf} policy=excluded;$NL" + newconf="${newconf} ip=" ns="${d#*:}" while [ -n "$ns" ]; do newconf="${newconf}${ns%%,*}" @@ -124,7 +134,7 @@ if [ -n "$pdnsd_conf" ]; then ns="${ns#*,}" newconf="${newconf}," done - newconf="${newconf};\n}\n" + newconf="${newconf};$NL}$NL" done rm -f "$cf" @@ -136,7 +146,7 @@ if [ -n "$pdnsd_conf" ]; then fi if change_file "$pdnsd_conf" "$cf"; then changed=true - fi + fi fi if [ -n "$pdnsd_resolv" ]; then Modified: head/contrib/openresolv/resolvconf.8.in ============================================================================== --- head/contrib/openresolv/resolvconf.8.in Mon May 4 20:59:23 2015 (r282433) +++ head/contrib/openresolv/resolvconf.8.in Mon May 4 21:07:20 2015 (r282434) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007-2009 Roy Marples +.\" Copyright (c) 2007-2015 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,8 +22,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 3, 2009 -.Dt RESOLVCONF 8 SMM *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon May 4 21:34:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA953F89; Mon, 4 May 2015 21:34: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 D968B1948; Mon, 4 May 2015 21:34: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 t44LYJ4W057535; Mon, 4 May 2015 21:34:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44LYJt0057534; Mon, 4 May 2015 21:34:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505042134.t44LYJt0057534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 4 May 2015 21:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282435 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 21:34:20 -0000 Author: gjb Date: Mon May 4 21:34:19 2015 New Revision: 282435 URL: https://svnweb.freebsd.org/changeset/base/282435 Log: Remove a debugging line that snuck in with r282419. Pointyhat: gjb MFC after: 3 days X-MFC-With: r282419 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Mon May 4 21:07:20 2015 (r282434) +++ head/release/Makefile.ec2 Mon May 4 21:34:19 2015 (r282435) @@ -33,7 +33,6 @@ cw-ec2-portinstall: @touch ${.TARGET} ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} - @false .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) @echo "--------------------------------------------------------------" @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation" From owner-svn-src-all@FreeBSD.ORG Mon May 4 21:44:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1CA952A; Mon, 4 May 2015 21:44: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 A40441AB7; Mon, 4 May 2015 21:44: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 t44LiqIj062357; Mon, 4 May 2015 21:44:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44LipTX062354; Mon, 4 May 2015 21:44:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201505042144.t44LipTX062354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 4 May 2015 21:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282436 - in head: contrib/tcpdump sbin/ping usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 21:44:52 -0000 Author: brooks Date: Mon May 4 21:44:51 2015 New Revision: 282436 URL: https://svnweb.freebsd.org/changeset/base/282436 Log: Remove "capability mode sandbox enabled" messages. These messages serve little purpose and break some consumers. PR: 199855 Differential Revision: https://reviews.freebsd.org/D2440 Reviewed by: rwatson Approved by: pjd MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/contrib/tcpdump/tcpdump.c head/sbin/ping/ping.c head/usr.bin/kdump/kdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Mon May 4 21:34:19 2015 (r282435) +++ head/contrib/tcpdump/tcpdump.c Mon May 4 21:44:51 2015 (r282436) @@ -1921,8 +1921,6 @@ main(int argc, char **argv) #endif if (cansandbox && cap_enter() < 0 && errno != ENOSYS) error("unable to enter the capability mode"); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); #endif /* __FreeBSD__ */ do { Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Mon May 4 21:34:19 2015 (r282435) +++ head/sbin/ping/ping.c Mon May 4 21:44:51 2015 (r282436) @@ -737,9 +737,6 @@ main(int argc, char *const *argv) if (cansandbox && cap_enter() < 0 && errno != ENOSYS) err(1, "cap_enter"); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); - cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit srecv"); Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon May 4 21:34:19 2015 (r282435) +++ head/usr.bin/kdump/kdump.c Mon May 4 21:44:51 2015 (r282436) @@ -352,8 +352,6 @@ main(int argc, char *argv[]) limitfd(STDIN_FILENO); limitfd(STDOUT_FILENO); limitfd(STDERR_FILENO); - if (cap_sandboxed()) - fprintf(stderr, "capability mode sandbox enabled\n"); TAILQ_INIT(&trace_procs); drop_logged = 0; From owner-svn-src-all@FreeBSD.ORG Mon May 4 22:05:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46B29917; Mon, 4 May 2015 22:05: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 283FC1CD5; Mon, 4 May 2015 22:05: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 t44M5Dtj072293; Mon, 4 May 2015 22:05:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44M5DPZ072292; Mon, 4 May 2015 22:05:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042205.t44M5DPZ072292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282437 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 22:05:13 -0000 Author: bapt Date: Mon May 4 22:05:12 2015 New Revision: 282437 URL: https://svnweb.freebsd.org/changeset/base/282437 Log: Take from heirloom's doctools version of checknr(1) some cosmetic fixes This helps working on synchronising both tools Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 21:44:51 2015 (r282436) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:05:12 2015 (r282437) @@ -250,7 +250,7 @@ main(int argc, char **argv) nfiles = argc - 1; if (nfiles > 0) { - for (i=1; i=0; i--) { + for (i = stktop; i >= 0; i--) { complain(i); } } @@ -386,7 +386,7 @@ prop(int i) { if (stk[i].pl == 0) printf(".%s", br[stk[i].opno].opbr); - else switch(stk[i].opno) { + else switch (stk[i].opno) { case SZ: printf("\\s%c%d", stk[i].pl, stk[i].parm); break; @@ -395,7 +395,8 @@ prop(int i) break; default: printf("Bug: stk[%d].opno = %d = .%s, .%s", - i, stk[i].opno, br[stk[i].opno].opbr, br[stk[i].opno].clbr); + i, stk[i].opno, br[stk[i].opno].opbr, + br[stk[i].opno].clbr); } } @@ -567,7 +568,9 @@ printf("binsrch(%s) -> %d\n", mac, slot) *loc = strcpy(malloc(3), mac); ncmds++; #ifdef DEBUG -printf("after: %s %s %s %s %s, %d cmds\n", knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], knowncmds[slot+1], knowncmds[slot+2], ncmds); + printf("after: %s %s %s %s %s, %d cmds\n", + knowncmds[slot-2], knowncmds[slot-1], knowncmds[slot], + knowncmds[slot+1], knowncmds[slot+2], ncmds); #endif } @@ -592,12 +595,12 @@ binsrch(const char *mac) if (d == 0) d = p[1] - mac[1]; if (d == 0) - return mid; + return (mid); if (d < 0) bot = mid + 1; else top = mid - 1; } slot = bot; /* place it would have gone */ - return -1; + return (-1); } From owner-svn-src-all@FreeBSD.ORG Mon May 4 22:18:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3072BD78; Mon, 4 May 2015 22:18: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 050AD1E5D; Mon, 4 May 2015 22:18: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 t44MIw66077611; Mon, 4 May 2015 22:18:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44MIwdT077610; Mon, 4 May 2015 22:18:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042218.t44MIwdT077610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282438 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 22:18:59 -0000 Author: bapt Date: Mon May 4 22:18:58 2015 New Revision: 282438 URL: https://svnweb.freebsd.org/changeset/base/282438 Log: Extend the list of known nroff/troff commands Obtained from: heirloom doctools Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 22:05:12 2015 (r282437) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:18:58 2015 (r282438) @@ -165,18 +165,22 @@ static const char *knowncmds[MAXCMDS] = "WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", "[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", "][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", -"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", "cs", -"ct", "cu", "da", "de", "di", "dl", "dn", "ds", "dt", "dw", "dy", "ec", -"ef", "eh", "el", "em", "eo", "ep", "ev", "ex", "fc", "fi", "fl", "fo", -"fp", "ft", "fz", "hc", "he", "hl", "hp", "ht", "hw", "hx", "hy", "i", -"ie", "if", "ig", "in", "ip", "it", "ix", "lc", "lg", "li", "ll", "ln", -"lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", "n1", -"n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", -"of", "oh", "os", "pa", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", -"q", "r", "rb", "rd", "re", "rm", "rn", "ro", "rr", "rs", "rt", "sb", -"sc", "sh", "sk", "so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", -"ti", "tl", "tm", "tp", "tr", "u", "uf", "uh", "ul", "vs", "wh", "xp", -"yr", 0 +"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", +"chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", "ds", +"dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", +"evc", "ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", +"fp", "ft", "ftr", "fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", +"ht", "hw", "hx", "hy", "hylang", "i", "ie", "if", "ig", "in", "ip", +"it", "ix", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lg", +"lhang", "lc_ctype", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", +"m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", +"nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", +"papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", +"r", "rb", "rd", "re", "recursionlimit", "return", "rhang", "rm", +"rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", "so", +"sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +0 }; static int lineno; /* current line number in input file */ From owner-svn-src-all@FreeBSD.ORG Mon May 4 22:29:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B246FB5; Mon, 4 May 2015 22:29:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [8.8.178.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3D51039; Mon, 4 May 2015 22:29:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t44MRupK082248; Mon, 4 May 2015 22:27:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t44MRtXD082246; Mon, 4 May 2015 22:27:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505042227.t44MRtXD082246@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 4 May 2015 22:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282439 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 04 May 2015 22:29:55 -0000 Author: bapt Date: Mon May 4 22:27:55 2015 New Revision: 282439 URL: https://svnweb.freebsd.org/changeset/base/282439 Log: Remove limitation on input lines by using getline(3) Modified: head/usr.bin/checknr/checknr.1 head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.1 ============================================================================== --- head/usr.bin/checknr/checknr.1 Mon May 4 22:18:58 2015 (r282438) +++ head/usr.bin/checknr/checknr.1 Mon May 4 22:27:55 2015 (r282439) @@ -28,7 +28,7 @@ .\" @(#)checknr.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 26, 2005 +.Dd May 5, 2015 .Dt CHECKNR 1 .Os .Sh NAME @@ -157,7 +157,3 @@ There is no way to define a 1 character .Pp Does not correctly recognize certain reasonable constructs, such as conditionals. -.Pp -Input lines are limited to -.Dv LINE_MAX -(2048) bytes in length. Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon May 4 22:18:58 2015 (r282438) +++ head/usr.bin/checknr/checknr.c Mon May 4 22:27:55 2015 (r282439) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); * structured typesetting. */ #include +#define _WITH_GETLINE #include #include #include @@ -284,11 +285,14 @@ process(FILE *f) { int i, n; char mac[5]; /* The current macro or nroff command */ + char *line; + size_t linecap; int pl; - static char line[256]; /* the current line */ + line = NULL; + linecap = 0; stktop = -1; - for (lineno = 1; fgets(line, sizeof line, f); lineno++) { + for (lineno = 1; getline(&line, &linecap, f) > 0; lineno++) { if (line[0] == '.') { /* * find and isolate the macro/command name. @@ -367,6 +371,7 @@ process(FILE *f) } } } + free(line); /* * We've hit the end and look at all this stuff that hasn't been * matched yet! Complain, complain. From owner-svn-src-all@FreeBSD.ORG Tue May 5 00:19:05 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B34894F9; Tue, 5 May 2015 00:19: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 A16DF1B31; Tue, 5 May 2015 00:19: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 t450J5SU035417; Tue, 5 May 2015 00:19:05 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t450J56s035416; Tue, 5 May 2015 00:19:05 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505050019.t450J56s035416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 5 May 2015 00:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282440 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 00:19:05 -0000 Author: loos Date: Tue May 5 00:19:04 2015 New Revision: 282440 URL: https://svnweb.freebsd.org/changeset/base/282440 Log: Fix DMA on RPi 2. BCM2836 has a different base address for peripherals. Obtained from: netbsd Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Mon May 4 22:27:55 2015 (r282439) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h Tue May 5 00:19:04 2015 (r282440) @@ -37,14 +37,20 @@ #define BCM2835_VCBUS_IO_BASE 0x7E000000 #define BCM2835_VCBUS_SDRAM_UNCACHED 0xC0000000 +#ifdef SOC_BCM2836 +#define BCM2835_ARM_IO_BASE 0x3f000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_UNCACHED +#else #define BCM2835_ARM_IO_BASE 0x20000000 -#define BCM2835_ARM_IO_SIZE 0x02000000 +#define BCM2835_VCBUS_SDRAM_BASE BCM2835_VCBUS_SDRAM_CACHED +#endif +#define BCM2835_ARM_IO_SIZE 0x01000000 /* * Convert physical address to VC bus address. Should be used * when submitting address over mailbox interface */ -#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_CACHED) +#define PHYS_TO_VCBUS(pa) ((pa) + BCM2835_VCBUS_SDRAM_BASE) /* Check whether pa bellong top IO window */ #define BCM2835_ARM_IS_IO(pa) (((pa) >= BCM2835_ARM_IO_BASE) && \ @@ -61,6 +67,6 @@ * when address is returned by VC over mailbox interface. e.g. * framebuffer base */ -#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_CACHED) +#define VCBUS_TO_PHYS(vca) ((vca) - BCM2835_VCBUS_SDRAM_BASE) #endif /* _BCM2835_VCBUS_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue May 5 00:27:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8BE6732; Tue, 5 May 2015 00:27: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 976CD1BB7; Tue, 5 May 2015 00:27: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 t450RuLT039994; Tue, 5 May 2015 00:27:56 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t450RuR2039993; Tue, 5 May 2015 00:27:56 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505050027.t450RuR2039993@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 5 May 2015 00:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282441 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 00:27:56 -0000 Author: loos Date: Tue May 5 00:27:55 2015 New Revision: 282441 URL: https://svnweb.freebsd.org/changeset/base/282441 Log: Enable DMA for sdhci on RPi 2 (BCM2836). Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue May 5 00:19:04 2015 (r282440) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue May 5 00:27:55 2015 (r282441) @@ -68,15 +68,8 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif -/* DMA doesn't yet work with the bcm3826 */ -#ifdef SOC_BCM2836 -#define PIO_MODE 1 -#else -#define PIO_MODE 0 -#endif - static int bcm2835_sdhci_hs = 1; -static int bcm2835_sdhci_pio_mode = PIO_MODE; +static int bcm2835_sdhci_pio_mode = 0; TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs); TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode); From owner-svn-src-all@FreeBSD.ORG Tue May 5 01:45:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B296D47F; Tue, 5 May 2015 01:45:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1426137C; Tue, 5 May 2015 01:45:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t451jdXc037630; Tue, 5 May 2015 01:45:39 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t451jdQ9037629; Tue, 5 May 2015 01:45:39 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201505050145.t451jdQ9037629@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 5 May 2015 01:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282442 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 01:45:39 -0000 Author: loos Date: Tue May 5 01:45:38 2015 New Revision: 282442 URL: https://svnweb.freebsd.org/changeset/base/282442 Log: Now that DMA works, enable the audio driver on RPi 2. Modified: head/sys/arm/conf/RPI2 Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Tue May 5 00:27:55 2015 (r282441) +++ head/sys/arm/conf/RPI2 Tue May 5 01:45:38 2015 (r282442) @@ -131,8 +131,8 @@ device smsc device spibus device bcm2835_spi -#device vchiq -#device sound +device vchiq +device sound # Flattened Device Tree options FDT # Configure using FDT/DTB data From owner-svn-src-all@FreeBSD.ORG Tue May 5 02:51:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D8602C7; Tue, 5 May 2015 02:51:39 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A54981B07; Tue, 5 May 2015 02:51:38 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-241-118.lns20.per4.internode.on.net [121.45.241.118]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t452pXUI027825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 4 May 2015 19:51:36 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5548302F.2@freebsd.org> Date: Tue, 05 May 2015 10:51:27 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r282427 - stable/10/sys/net References: <201505041933.t44JXqZG097993@svn.freebsd.org> In-Reply-To: <201505041933.t44JXqZG097993@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 02:51:39 -0000 On 5/5/15 3:33 AM, Alexander Motin wrote: > Author: mav > Date: Mon May 4 19:33:51 2015 > New Revision: 282427 > URL: https://svnweb.freebsd.org/changeset/base/282427 > > Log: > MFC r281765: > Activate write-only optimization if bpf device opened with O_WRONLY. > > dhclient opens bpf as write-only to send packets. It never reads received > packets from that descriptor, but processing them in kernel takes time. > Especially much time takes packet timestamping on systems with expensive > timecounter, such as bhyve guest, where network speed dropped in half. we probably should look at using a less weird way of sending raw packets. using bpf (which is supposed to be a read-only interface) is just wrong.. > > Sponsored by: iXsystems, Inc. > > Modified: > stable/10/sys/net/bpf.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/net/bpf.c > ============================================================================== > --- stable/10/sys/net/bpf.c Mon May 4 18:49:25 2015 (r282426) > +++ stable/10/sys/net/bpf.c Mon May 4 19:33:51 2015 (r282427) > @@ -600,7 +600,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ > * Save sysctl value to protect from sysctl change > * between reads > */ > - op_w = V_bpf_optimize_writers; > + op_w = V_bpf_optimize_writers || d->bd_writer; > > if (d->bd_bif != NULL) > bpf_detachd_locked(d); > @@ -802,6 +802,8 @@ bpfopen(struct cdev *dev, int flags, int > * particular buffer method. > */ > bpf_buffer_init(d); > + if ((flags & FREAD) == 0) > + d->bd_writer = 2; > d->bd_hbuf_in_use = 0; > d->bd_bufmode = BPF_BUFMODE_BUFFER; > d->bd_sig = SIGIO; > > > From owner-svn-src-all@FreeBSD.ORG Tue May 5 03:08:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E47E824; Tue, 5 May 2015 03:08: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 0F6CC1D78; Tue, 5 May 2015 03:08: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 t4538nrH077733; Tue, 5 May 2015 03:08:49 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4538n3j077732; Tue, 5 May 2015 03:08:49 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201505050308.t4538n3j077732@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 5 May 2015 03:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282443 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 03:08:50 -0000 Author: allanjude (doc committer) Date: Tue May 5 03:08:49 2015 New Revision: 282443 URL: https://svnweb.freebsd.org/changeset/base/282443 Log: Add a sanity check to the swap size in zfsboot of bsdinstall Loop until the user enters a valid size (>100mb or 0) Differential Revision: https://reviews.freebsd.org/D2299 Reported By: Shawn Webb Reviewed by: roberto Approved by: brd MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 5 01:45:38 2015 (r282442) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 5 03:08:49 2015 (r282443) @@ -287,10 +287,12 @@ msg_stripe_desc="Stripe - No Redundancy" msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" msg_swap_encrypt="Encrypt Swap?" msg_swap_encrypt_help="Encrypt swap partitions with temporary keys, discarded on reboot" +msg_swap_invalid="The selected swap size (%s) is invalid. Enter a number optionally followed by units. Example: 2G" msg_swap_mirror="Mirror Swap?" msg_swap_mirror_help="Mirror swap partitions for redundancy, breaks crash dumps" msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" +msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a value greater than 100MB or enter 0 for no swap" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." msg_uefi_not_supported="The FreeBSD UEFI loader does not currently support booting root-on-ZFS. Your system will need to boot in legacy (CSM) mode.\nDo you want to continue?" msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" @@ -1557,10 +1559,26 @@ while :; do ;; ?" $msg_swap_size") # Prompt the user to input/change the swap size for each disk - f_dialog_input input \ - "$msg_please_enter_amount_of_swap_space" \ - "$ZFSBOOT_SWAP_SIZE" && - ZFSBOOT_SWAP_SIZE="${input:-0}" + while :; do + f_dialog_input input \ + "$msg_please_enter_amount_of_swap_space" \ + "$ZFSBOOT_SWAP_SIZE" && + ZFSBOOT_SWAP_SIZE="${input:-0}" + if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize + then + if [ $swapsize -ne 0 -a $swapsize -lt 104857600 ]; then + f_show_err "$msg_swap_toosmall" \ + "$ZFSBOOT_SWAP_SIZE" + continue; + else + break; + fi + else + f_show_err "$msg_swap_invalid" \ + "$ZFSBOOT_SWAP_SIZE" + continue; + fi + done ;; ?" $msg_swap_mirror") # Toggle the variable referenced both by the menu and later From owner-svn-src-all@FreeBSD.ORG Tue May 5 03:13:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 502FD9B2; Tue, 5 May 2015 03:13: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 23C2E1E32; Tue, 5 May 2015 03:13: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 t453D3oQ081906; Tue, 5 May 2015 03:13:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t453D3HT081905; Tue, 5 May 2015 03:13:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201505050313.t453D3HT081905@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 5 May 2015 03:13: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: r282444 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 03:13:03 -0000 Author: markj Date: Tue May 5 03:13:02 2015 New Revision: 282444 URL: https://svnweb.freebsd.org/changeset/base/282444 Log: MFC 281701: SDT(9): add a section on SDT providers, mentioning the "sdt" provider. Add examples demonstrating how one can list available providers and the DTrace probes provided by a provider. Modified: stable/10/share/man/man9/SDT.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/SDT.9 ============================================================================== --- stable/10/share/man/man9/SDT.9 Tue May 5 03:08:49 2015 (r282443) +++ stable/10/share/man/man9/SDT.9 Tue May 5 03:13:02 2015 (r282444) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 8, 2015 +.Dd April 18, 2015 .Dt SDT 9 .Os .Sh NAME @@ -194,7 +194,37 @@ macros are used to create trace points. They are meant to be added to executable code and can be used to instrument the code in which they are called. +.Sh PROVIDERS +A number of kernel DTrace providers are available. +In general, these providers define stable interfaces and should be treated as +such: existing D scripts may be broken if a probe is renamed or its arguments +are modified. +However, it is often useful to define ad-hoc +.Nm +probes for debugging a subsystem or driver. +Similarly, a developer may wish to provide a group of +.Nm +probes without committing to their future stability. +Such probes should be added to the +.Ql sdt +provider instead of defining a new provider. .Sh EXAMPLES +The DTrace providers available on the current system can be listed with +.Bd -literal -offset indent +dtrace -l | sed 1d | awk '{print $2}' | sort -u +.Ed +.Pp +A detailed list of the probes offered by a given provider can be obtained by +specifying the provider using the +.Fl P +flag. +For example, to view the probes and argument types for the +.Ql sched +provider, run +.Bd -literal -offset indent +dtrace -lv -P sched +.Ed +.Pp The following probe definition will create a DTrace probe called .Ql icmp:::receive-unreachable , which would hypothetically be triggered when the kernel receives an ICMP packet From owner-svn-src-all@FreeBSD.ORG Tue May 5 03:17:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4A2BB38; Tue, 5 May 2015 03:17:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92AEA1E53; Tue, 5 May 2015 03:17: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 t453HX2p082533; Tue, 5 May 2015 03:17:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t453HXp2082532; Tue, 5 May 2015 03:17:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201505050317.t453HXp2082532@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 5 May 2015 03:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282445 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 03:17:33 -0000 Author: markj Date: Tue May 5 03:17:32 2015 New Revision: 282445 URL: https://svnweb.freebsd.org/changeset/base/282445 Log: MFC r281483: Fix a possible refcount leak in regen_tmpaddr(). Modified: stable/10/sys/netinet6/nd6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Tue May 5 03:13:02 2015 (r282444) +++ stable/10/sys/netinet6/nd6.c Tue May 5 03:17:32 2015 (r282445) @@ -757,11 +757,10 @@ regen_tmpaddr(struct in6_ifaddr *ia6) * address with the prefix. */ if (!IFA6_IS_DEPRECATED(it6)) - public_ifa6 = it6; - - if (public_ifa6 != NULL) - ifa_ref(&public_ifa6->ia_ifa); + public_ifa6 = it6; } + if (public_ifa6 != NULL) + ifa_ref(&public_ifa6->ia_ifa); IF_ADDR_RUNLOCK(ifp); if (public_ifa6 != NULL) { From owner-svn-src-all@FreeBSD.ORG Tue May 5 04:13:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1C70459; Tue, 5 May 2015 04:13: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 9642C13B5; Tue, 5 May 2015 04:13: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 t454Dnei011182; Tue, 5 May 2015 04:13:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t454DnPQ011181; Tue, 5 May 2015 04:13:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505050413.t454DnPQ011181@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 May 2015 04:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282446 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 04:13:49 -0000 Author: imp Date: Tue May 5 04:13:48 2015 New Revision: 282446 URL: https://svnweb.freebsd.org/changeset/base/282446 Log: When dealing with the TI12XX family of parts, we sometimes need to initialize the MFUNC registers. Our old test of assuming that if this register is set at all is not quite right. Many scenarios (including the power-on defaults for chips w/o EEPROMs) land us in trouble. The MFUNC0 pin should be set to signal #INTA and the MFUNC1 pin should be set to signal #INTB of multi-socketed devices. Since my memory recalls issues with blindly clearing the upper bytes of this register, perform the heuristic only when both MFUNC0 and 1 are clear. We won't work well using these pins for GPIO, and the serial interrupts won't save us because we go out of our way to generally disable them. They are needed to support legacy drivers for 16-bit PC Cards that are hard-wired to specific IRQ values. Since FreeBSD never had any of these, we configure the more reliable direct signaling. This was just one small piece of that which had been left out back in the day. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Tue May 5 03:17:32 2015 (r282445) +++ head/sys/dev/pccbb/pccbb_pci.c Tue May 5 04:13:48 2015 (r282446) @@ -502,10 +502,19 @@ cbb_chipinit(struct cbb_softc *sc) * properly initialized. * * The TI125X parts have a different register. + * + * Note: Only the lower two nibbles matter. When set + * to 0, the MFUNC{0,1} pins are GPIO, which isn't + * going to work out too well because we specifically + * program these parts to parallel interrupt signalling + * elsewhere. We preserve the upper bits of this + * register since changing them have subtle side effects + * for different variants of the card and are + * extremely difficult to exaustively test. */ mux = pci_read_config(sc->dev, CBBR_MFUNC, 4); sysctrl = pci_read_config(sc->dev, CBBR_SYSCTRL, 4); - if (mux == 0) { + if ((mux & (CBBM_MFUNC_PIN0 | CBBM_MFUNC_PIN1)) == 0) { mux = (mux & ~CBBM_MFUNC_PIN0) | CBBM_MFUNC_PIN0_INTA; if ((sysctrl & CBBM_SYSCTRL_INTRTIE) == 0) @@ -518,7 +527,8 @@ cbb_chipinit(struct cbb_softc *sc) /* * Disable zoom video. Some machines initialize this * improperly and exerpience has shown that this helps - * prevent strange behavior. + * prevent strange behavior. We don't support zoom + * video anyway, so no harm can come from this. */ pci_write_config(sc->dev, CBBR_MMCTRL, 0, 4); break; From owner-svn-src-all@FreeBSD.ORG Tue May 5 04:23:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC2BF646; Tue, 5 May 2015 04:23: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 BAAD914EA; Tue, 5 May 2015 04:23: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 t454Nufh016085; Tue, 5 May 2015 04:23:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t454NuVH016084; Tue, 5 May 2015 04:23:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201505050423.t454NuVH016084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 5 May 2015 04:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282447 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 04:23:56 -0000 Author: imp Date: Tue May 5 04:23:55 2015 New Revision: 282447 URL: https://svnweb.freebsd.org/changeset/base/282447 Log: Add some data found in TI's application note "SCPA035: PCI1510 Implementation Guide" about default values. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Tue May 5 04:13:48 2015 (r282446) +++ head/sys/dev/pccbb/pccbb_pci.c Tue May 5 04:23:55 2015 (r282447) @@ -511,6 +511,13 @@ cbb_chipinit(struct cbb_softc *sc) * register since changing them have subtle side effects * for different variants of the card and are * extremely difficult to exaustively test. + * + * Also, the TI 1510/1520 changed the default for the MFUNC + * register from 0x0 to 0x1000 to enable IRQSER by default. + * We want to be careful to avoid overriding that, and the + * below test will do that. Should this check prove to be + * too permissive, we should just check against 0 and 0x1000 + * and not touch it otherwise. */ mux = pci_read_config(sc->dev, CBBR_MFUNC, 4); sysctrl = pci_read_config(sc->dev, CBBR_SYSCTRL, 4); From owner-svn-src-all@FreeBSD.ORG Tue May 5 05:14:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 810FBC76; Tue, 5 May 2015 05:14: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 6EA6219B7; Tue, 5 May 2015 05:14: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 t455EDvS040496; Tue, 5 May 2015 05:14:13 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t455EDtt040495; Tue, 5 May 2015 05:14:13 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201505050514.t455EDtt040495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Tue, 5 May 2015 05:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282448 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 05:14:13 -0000 Author: peter Date: Tue May 5 05:14:12 2015 New Revision: 282448 URL: https://svnweb.freebsd.org/changeset/base/282448 Log: Fix an error in r281551, part of the getfsstat() / kern_getfsstat() rework. The number of entries was supposed to be returned to the user, not used as a scratch variable. This broke RELENG_4 jails starting up on current systems. Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue May 5 04:23:55 2015 (r282447) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue May 5 05:14:12 2015 (r282448) @@ -248,7 +248,7 @@ freebsd4_freebsd32_getfsstat(struct thre { struct statfs *buf, *sp; struct statfs32 stat32; - size_t count, size; + size_t count, size, copycount; int error; count = uap->bufsize / sizeof(struct statfs32); @@ -256,12 +256,13 @@ freebsd4_freebsd32_getfsstat(struct thre error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags); if (size > 0) { sp = buf; - while (count > 0 && error == 0) { + copycount = count; + while (copycount > 0 && error == 0) { copy_statfs(sp, &stat32); error = copyout(&stat32, uap->buf, sizeof(stat32)); sp++; uap->buf++; - count--; + copycount--; } free(buf, M_TEMP); } From owner-svn-src-all@FreeBSD.ORG Tue May 5 05:16:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41B9CDD7; Tue, 5 May 2015 05:16:22 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::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 27DBD19D4; Tue, 5 May 2015 05:16:22 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 4440BAD6; Mon, 4 May 2015 22:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1430802981; bh=SPab1frb7XCjYLXj8bwfC7T9RZq1MRAkASUhnrIV3/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T9puZF+OSuKuAbxFk+4CiH5mDtn7RMKX5I2bCEnrS80DL+8n1qU57//P/FZordHDV ISpjID62Ong9G0vJ9Bc7VmmCVgekNhIy5QpUfZNL/e41mhQjp1XEiMEjEWlVuJshVh a3zJ0+oP8c9cagRDCIpbH648dLsBmR6GlIxFtXOQ= From: Peter Wemm To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r281551 - in head/sys: compat/freebsd32 compat/linprocfs kern sys Date: Mon, 04 May 2015 22:16:15 -0700 Message-ID: <1801676.lkz3AbOCeE@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <201504150913.t3F9DBxe052815@svn.freebsd.org> References: <201504150913.t3F9DBxe052815@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9141800.SoBmtebVJ0"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 05:16:22 -0000 --nextPart9141800.SoBmtebVJ0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Wednesday, April 15, 2015 09:13:11 AM Edward Tomasz Napierala wrote:= > Author: trasz > Date: Wed Apr 15 09:13:11 2015 > New Revision: 281551 > URL: https://svnweb.freebsd.org/changeset/base/281551 >=20 > Log: > Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). Th= is > adds missing jail and MAC checks. >=20 > Differential Revision:=09https://reviews.freebsd.org/D2193 > Reviewed by:=09kib@ > MFC after:=091 month Please don't MFC this without taking care of of the follow-up bug fix. = =20 Something like r282448 is needed to keep old binaries (and old jails) w= orking. =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 --nextPart9141800.SoBmtebVJ0 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 iQEcBAABCAAGBQJVSFIfAAoJEDXWlwnsgJ4Em7cH/RwDS3jVblAaZflwtj7HTtsa UU0AF78yj2EDzOK64w4LMfJpxlzJrJCrz7obFg12FNpm8QpdJz7k5NgtBfndSXGr GiE2mdzO2JjK7fqvO7PiO24kvTynYABOk7Cp+b3Z0Gmzju1Ua2BwJgjdWg2fidXC sRQQEh9CN0rJayjttX6jhIgYsQZtCBHp+jLxcwmi/lLJj17UaLiVHZf97PylLotT fAUfQn/PS9ELPWW3Sl5ho2f9WtEDa+CWrKgtxvRIA7kBczxgtMDW947fe1DxwfOj oJY/IYala5iBulSycRn9ftd+RHTBZ5ZBK3+zkT4z1PrDtxKznsFRs/woi88exe4= =24Y8 -----END PGP SIGNATURE----- --nextPart9141800.SoBmtebVJ0-- From owner-svn-src-all@FreeBSD.ORG Tue May 5 06:46:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A758D755; Tue, 5 May 2015 06:46:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A7E125A; Tue, 5 May 2015 06:45:59 +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 t456juU7047165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 May 2015 09:45:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t456juL0047164; Tue, 5 May 2015 09:45:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 May 2015 09:45:56 +0300 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150505064556.GM34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <26088556.xbkUe5VAyp@ralph.baldwin.cx> <20150504185125.GL34544@FreeBSD.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2463555.FfYUgqxYi8@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 06:46:00 -0000 John, On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: J> > Your answer seems quite orthogonal to my question. I reread it couple of times, J> > but still can't figure out how exactly do you prefet to fetch per-queue stats. J> > Can you please explain in more detail? J> J> struct if_queue { J> struct ifnet *ifq_parent; J> void (*ifq_get_counter)(struct if_queue *, ift_counter); J> ... J> }; J> J> (Pretend that if_queue is a new object type and that each RX or TX queue on a J> NIC has one.) This looks like a driver with 1024 queues would carry extra 1024 function pointers per ifnet. Is it really worth? Could it be that queue #0 differs from queue #1? Even, if a rare case when queue #N differs from queue #M do exist, they still can share the pointer and the differentiating logic would be in the function itself. Right now, in the projects/ifnet branch, I'm developing in quite opposite direction - many instances of the same driver share the set of interface options. This is done to shrink struct ifnet. What's wrong with KPI when the queue number is parameter to an ifop? This KPI would also hide the queue pointers from the stack, which are quite driver specific. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:33:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29AE9FF9; Tue, 5 May 2015 07:33: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 0B1071791; Tue, 5 May 2015 07:33: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 t457XdBX008778; Tue, 5 May 2015 07:33:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457Xdum008775; Tue, 5 May 2015 07:33:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050733.t457Xdum008775@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282449 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:33:40 -0000 Author: bapt Date: Tue May 5 07:33:38 2015 New Revision: 282449 URL: https://svnweb.freebsd.org/changeset/base/282449 Log: Ansify to allow to work on it later Modified: head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 05:14:12 2015 (r282448) +++ head/usr.bin/vgrind/regexp.c Tue May 5 07:33:38 2015 (r282449) @@ -66,9 +66,7 @@ boolean l_onecase; /* true if upper and */ int -STRNCMP(s1, s2, len) - register char *s1,*s2; - register int len; +STRNCMP(register char *s1, register char *s2, register int len) { if (l_onecase) { do @@ -147,9 +145,9 @@ STRNCMP(s1, s2, len) static char *ccre; /* pointer to current position in converted exp*/ static char *ure; /* pointer current position in unconverted exp */ +/* re: unconverted irregular expression */ char * -convexp(re) - char *re; /* unconverted irregular expression */ +convexp(char *re) { register char *cre; /* pointer to converted regular expression */ @@ -344,11 +342,13 @@ expconv() * character matched. */ +/* + * s: string to check for a match in + * re: a converted irregular expression + * mstring: where to put whatever matches a \p + */ char * -expmatch (s, re, mstring) - register char *s; /* string to check for a match in */ - register char *re; /* a converted irregular expression */ - register char *mstring; /* where to put whatever matches a \p */ +expmatch (register char *s, register char *re, register char *mstring) { register char *cs; /* the current symbol */ register char *ptr,*s1; /* temporary pointer */ Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 05:14:12 2015 (r282448) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 07:33:38 2015 (r282449) @@ -542,11 +542,13 @@ skip: } while (*s); } +/* + * start: start of string to write + * end: end of string to write + * force: true if we should force nokeyw + */ static void -putKcp (start, end, force) - char *start; /* start of string to write */ - char *end; /* end of string to write */ - boolean force; /* true if we should force nokeyw */ +putKcp (char *start, char *end, boolean force) { int i; int xfld = 0; @@ -593,16 +595,14 @@ putKcp (start, end, force) static int -tabs(s, os) - char *s, *os; +tabs(char *s, char *os) { return (width(s, os) / 8); } static int -width(s, os) - register char *s, *os; +width(register char *s, register char *os) { register int i = 0; @@ -690,8 +690,7 @@ putcp(c) * look for a process beginning on this line */ static boolean -isproc(s) - char *s; +isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) @@ -706,8 +705,7 @@ isproc(s) */ static int -iskw(s) - register char *s; +iskw(register char *s) { register char **ss = l_keywds; register int i = 1; Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 05:14:12 2015 (r282448) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:33:38 2015 (r282449) @@ -55,18 +55,19 @@ __FBSDID("$FreeBSD$"); static char *tbuf; static char *filename; static int hopcount; /* detect infinite loops in termcap, init 0 */ -char *tskip(); -char *tgetstr(); -char *tdecode(); -char *getenv(); + +static int tnchktc(void); +static int tnamatch(char *); +static char *tskip(register char *); +static char *tdecode(register char *, char **); /* * Get an entry for terminal name in buffer bp, * from the termcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -tgetent(bp, name, file) - char *bp, *name, *file; +int +tgetent(char *bp, char *name, char *file) { register char *cp; register int c; @@ -125,7 +126,8 @@ tgetent(bp, name, file) * entries to say "like an HP2621 but doesn't turn on the labels". * Note that this works because of the left to right scan. */ -tnchktc() +static int +tnchktc(void) { register char *p, *q; char tcname[16]; /* name of similar terminal */ @@ -172,8 +174,8 @@ tnchktc() * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -tnamatch(np) - char *np; +static int +tnamatch(char *np) { register char *Np, *Bp; @@ -199,8 +201,7 @@ tnamatch(np) * into the termcap file in octal. */ static char * -tskip(bp) - register char *bp; +tskip(register char *bp) { while (*bp && *bp != ':') @@ -251,8 +252,8 @@ tgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -tgetflag(id) - char *id; +int +tgetflag(char *id) { register char *bp = tbuf; @@ -278,8 +279,7 @@ tgetflag(id) * No checking on area overflow. */ char * -tgetstr(id, area) - char *id, **area; +tgetstr(char *id, char **area) { register char *bp = tbuf; @@ -303,9 +303,7 @@ tgetstr(id, area) * string capability escapes. */ static char * -tdecode(str, area) - register char *str; - char **area; +tdecode(register char *str, char **area) { register char *cp; register int c; From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:42:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00D9A38B; Tue, 5 May 2015 07: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 E401E18CC; Tue, 5 May 2015 07: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 t457gADR013476; Tue, 5 May 2015 07:42:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457gAnr013475; Tue, 5 May 2015 07:42:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050742.t457gAnr013475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282450 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:42:11 -0000 Author: bapt Date: Tue May 5 07:42:10 2015 New Revision: 282450 URL: https://svnweb.freebsd.org/changeset/base/282450 Log: Another bit of ansification Modified: head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 07:33:38 2015 (r282449) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 07:42:10 2015 (r282450) @@ -128,9 +128,7 @@ const char *language = "c"; /* the langu #define ps(x) printf("%s", x) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { const char *fname = ""; struct stat stbuf; From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:42:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F14934CD; Tue, 5 May 2015 07:42: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 E061B18D1; Tue, 5 May 2015 07:42: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 t457ge4X013583; Tue, 5 May 2015 07:42:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457geg8013582; Tue, 5 May 2015 07:42:40 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050742.t457geg8013582@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282451 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:42:41 -0000 Author: bapt Date: Tue May 5 07:42:40 2015 New Revision: 282451 URL: https://svnweb.freebsd.org/changeset/base/282451 Log: upper the warning level to 3 Modified: head/usr.bin/vgrind/Makefile Modified: head/usr.bin/vgrind/Makefile ============================================================================== --- head/usr.bin/vgrind/Makefile Tue May 5 07:42:10 2015 (r282450) +++ head/usr.bin/vgrind/Makefile Tue May 5 07:42:40 2015 (r282451) @@ -11,7 +11,7 @@ FILESDIR= ${SHAREDIR}/misc FILESDIR_tmac.vgrind= ${SHAREDIR}/tmac MAN= vgrind.1 vgrindefs.5 -WARNS?= 2 +WARNS?= 3 BINDIR= /usr/libexec SCRIPTSDIR=/usr/bin From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:47:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B706776F; Tue, 5 May 2015 07:47: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 A5ED4192A; Tue, 5 May 2015 07:47: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 t457lbdu014341; Tue, 5 May 2015 07:47:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457lbrr014340; Tue, 5 May 2015 07:47:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050747.t457lbrr014340@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282452 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:47:37 -0000 Author: bapt Date: Tue May 5 07:47:36 2015 New Revision: 282452 URL: https://svnweb.freebsd.org/changeset/base/282452 Log: Use strlcpy(3) instead of strcpy(3) Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:42:40 2015 (r282451) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:47:36 2015 (r282452) @@ -145,7 +145,7 @@ tnchktc(void) /* p now points to beginning of last field */ if (p[0] != 't' || p[1] != 'c') return(1); - strcpy(tcname,p+3); + strlcpy(tcname, p+3, 16); q = tcname; while (q && *q != ':') q++; @@ -163,7 +163,7 @@ tnchktc(void) write(STDERR_FILENO, "Vgrind entry too long\n", 23); q[BUFSIZ - (p-tbuf)] = 0; } - strcpy(p, q+1); + strlcpy(p, q+1, BUFSIZ - (p - holdtbuf)); tbuf = holdtbuf; return(1); } From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:49:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F10FA942; Tue, 5 May 2015 07:49: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 E00FB195E; Tue, 5 May 2015 07:49: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 t457nkWw014645; Tue, 5 May 2015 07:49:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457nk7B014644; Tue, 5 May 2015 07:49:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050749.t457nk7B014644@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282453 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:49:47 -0000 Author: bapt Date: Tue May 5 07:49:46 2015 New Revision: 282453 URL: https://svnweb.freebsd.org/changeset/base/282453 Log: Explicitly use O_RDONLY instead of 0 Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:47:36 2015 (r282452) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:49:46 2015 (r282453) @@ -79,7 +79,7 @@ tgetent(char *bp, char *name, char *file tbuf = bp; tf = 0; filename = file; - tf = open(filename, 0); + tf = open(filename, O_RDONLY); if (tf < 0) return (-1); for (;;) { From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:51:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67211ABB; Tue, 5 May 2015 07:51: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 55F081A29; Tue, 5 May 2015 07:51: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 t457pw0i018529; Tue, 5 May 2015 07:51:58 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457pw0w018528; Tue, 5 May 2015 07:51:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050751.t457pw0w018528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282454 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:51:58 -0000 Author: bapt Date: Tue May 5 07:51:57 2015 New Revision: 282454 URL: https://svnweb.freebsd.org/changeset/base/282454 Log: Remove unused variables Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:49:46 2015 (r282453) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:51:57 2015 (r282454) @@ -73,7 +73,6 @@ tgetent(char *bp, char *name, char *file register int c; register int i = 0, cnt = 0; char ibuf[BUFSIZ]; - char *cp2; int tf; tbuf = bp; @@ -307,7 +306,6 @@ tdecode(register char *str, char **area) { register char *cp; register int c; - int i; cp = *area; while (c = *str++) { From owner-svn-src-all@FreeBSD.ORG Tue May 5 07:52:42 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7004AC07; Tue, 5 May 2015 07:52: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 5ED9D1A39; Tue, 5 May 2015 07:52: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 t457qgB4018680; Tue, 5 May 2015 07:52:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t457qgOR018679; Tue, 5 May 2015 07:52:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050752.t457qgOR018679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 07:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282455 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 07:52:42 -0000 Author: bapt Date: Tue May 5 07:52:41 2015 New Revision: 282455 URL: https://svnweb.freebsd.org/changeset/base/282455 Log: Another function to ansify Modified: head/usr.bin/vgrind/vgrindefs.c Modified: head/usr.bin/vgrind/vgrindefs.c ============================================================================== --- head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:51:57 2015 (r282454) +++ head/usr.bin/vgrind/vgrindefs.c Tue May 5 07:52:41 2015 (r282455) @@ -218,8 +218,8 @@ tskip(register char *bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -tgetnum(id) - char *id; +int +tgetnum(char *id) { register int i, base; register char *bp = tbuf; From owner-svn-src-all@FreeBSD.ORG Tue May 5 08:12:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57452F2B; Tue, 5 May 2015 08:12: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 454D81C8E; Tue, 5 May 2015 08:12: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 t458CPF1028544; Tue, 5 May 2015 08:12:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458CPMr028543; Tue, 5 May 2015 08:12:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505050812.t458CPMr028543@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 May 2015 08:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282456 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:12:25 -0000 Author: kib Date: Tue May 5 08:12:24 2015 New Revision: 282456 URL: https://svnweb.freebsd.org/changeset/base/282456 Log: MFC r282128: Do not sleep waiting for the MAP_ENTRY_IN_TRANSITION state ending with the vnode locked. Modified: stable/10/sys/vm/vm_fault.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Tue May 5 07:52:41 2015 (r282455) +++ stable/10/sys/vm/vm_fault.c Tue May 5 08:12:24 2015 (r282456) @@ -345,6 +345,10 @@ RetryFault:; vm_map_lock(fs.map); if (vm_map_lookup_entry(fs.map, vaddr, &fs.entry) && (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION)) { + if (fs.vp != NULL) { + vput(fs.vp); + fs.vp = NULL; + } fs.entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; vm_map_unlock_and_wait(fs.map, 0); } else From owner-svn-src-all@FreeBSD.ORG Tue May 5 08:15:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61AF3110; Tue, 5 May 2015 08:15: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 504431CAA; Tue, 5 May 2015 08:15: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 t458FC5w029012; Tue, 5 May 2015 08:15:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458FBAv029009; Tue, 5 May 2015 08:15:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050815.t458FBAv029009@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 08:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282457 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 08:15:12 -0000 Author: bapt Date: Tue May 5 08:15:10 2015 New Revision: 282457 URL: https://svnweb.freebsd.org/changeset/base/282457 Log: Use stdbool instead of homebrewed boolean Modified: head/usr.bin/vgrind/extern.h head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/extern.h ============================================================================== --- head/usr.bin/vgrind/extern.h Tue May 5 08:12:24 2015 (r282456) +++ head/usr.bin/vgrind/extern.h Tue May 5 08:15:10 2015 (r282457) @@ -31,9 +31,7 @@ * $FreeBSD$ */ -typedef int boolean; - -extern boolean _escaped; /* if last character was an escape */ +extern bool _escaped; /* if last character was an escape */ extern char *s_start; /* start of the current string */ extern char *l_acmbeg; /* string introducing a comment */ extern char *l_acmend; /* string ending a comment */ @@ -45,11 +43,11 @@ extern char *l_combeg; / extern char *l_comend; /* string ending a comment */ extern char l_escape; /* character used to escape characters */ extern char *l_keywds[]; /* keyword table address */ -extern boolean l_onecase; /* upper and lower case are equivalent */ +extern bool l_onecase; /* upper and lower case are equivalent */ extern char *l_prcbeg; /* regular expr for procedure begin */ extern char *l_strbeg; /* delimiter for string constant */ extern char *l_strend; /* delimiter for string constant */ -extern boolean l_toplex; /* procedures only defined at top lex level */ +extern bool l_toplex; /* procedures only defined at top lex level */ extern const char *language; /* the language indicator */ #include Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 08:12:24 2015 (r282456) +++ head/usr.bin/vgrind/regexp.c Tue May 5 08:15:10 2015 (r282457) @@ -44,19 +44,18 @@ static const char sccsid[] = "@(#)regexp #include #include +#include #include #include "extern.h" -#define FALSE 0 -#define TRUE !(FALSE) #define NIL 0 static void expconv(void); -boolean _escaped; /* true if we are currently _escaped */ +bool _escaped; /* true if we are currently x_escaped */ char *s_start; /* start of string */ -boolean l_onecase; /* true if upper and lower equivalent */ +bool l_onecase; /* true if upper and lower equivalent */ #define makelower(c) (isupper((c)) ? tolower((c)) : (c)) @@ -352,13 +351,13 @@ expmatch (register char *s, register cha { register char *cs; /* the current symbol */ register char *ptr,*s1; /* temporary pointer */ - boolean matched; /* a temporary boolean */ + bool matched; /* a temporary bool */ /* initial conditions */ if (re == NIL) return (NIL); cs = re; - matched = FALSE; + matched = false; /* loop till expression string is exhausted (or at least pretty tired) */ while (*cs) { @@ -464,12 +463,12 @@ expmatch (register char *s, register cha *s1 == '~' || /* C++ scope operator */ (strlen(s1) > 1 && *s1 == ':' && s1[1] == ':' && - (s1++, TRUE)))) + (s1++, true)))) return (NIL); if (*s1 == '\\') - _escaped = _escaped ? FALSE : TRUE; + _escaped = _escaped ? false : true; else - _escaped = FALSE; + _escaped = false; } while (*s1++); return (NIL); @@ -497,9 +496,9 @@ expmatch (register char *s, register cha return (NIL); } if (*s1 == '\\') - _escaped = _escaped ? FALSE : TRUE; + _escaped = _escaped ? false : true; else - _escaped = FALSE; + _escaped = false; } while (*s1++); return (NIL); Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:12:24 2015 (r282456) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:15:10 2015 (r282457) @@ -47,13 +47,12 @@ static const char sccsid[] = "@(#)vfonte #include #include #include +#include #include #include #include "pathnames.h" #include "extern.h" -#define FALSE 0 -#define TRUE !(FALSE) #define NIL 0 #define STANDARD 0 #define ALTERNATE 1 @@ -70,8 +69,8 @@ static const char sccsid[] = "@(#)vfonte #define PSMAX 20 /* size of procedure name stacking */ static int iskw(char *); -static boolean isproc(char *); -static void putKcp(char *, char *, boolean); +static bool isproc(char *); +static void putKcp(char *, char *, bool); static void putScp(char *); static void putcp(int); static int tabs(char *, char *); @@ -81,13 +80,13 @@ static int width(char *, char *); * The state variables */ -static boolean filter = FALSE; /* act as a filter (like eqn) */ -static boolean inchr; /* in a string constant */ -static boolean incomm; /* in a comment of the primary type */ -static boolean idx = FALSE; /* form an index */ -static boolean instr; /* in a string constant */ -static boolean nokeyw = FALSE; /* no keywords being flagged */ -static boolean pass = FALSE; /* +static bool filter = false; /* act as a filter (like eqn) */ +static bool inchr; /* in a string constant */ +static bool incomm; /* in a comment of the primary type */ +static bool idx = false; /* form an index */ +static bool instr; /* in a string constant */ +static bool nokeyw = false; /* no keywords being flagged */ +static bool pass = false; /* * when acting as a filter, pass indicates * whether we are currently processing * input. @@ -100,7 +99,7 @@ static char * defsfile[2] = { _PATH_VGRI static int margin; static int plstack[PSMAX]; /* the procedure nesting level stack */ static char pname[BUFSIZ+1]; -static boolean prccont; /* continue last procedure */ +static bool prccont; /* continue last procedure */ static int psptr; /* the stack index of the current procedure */ static char pstack[PSMAX][PNAMELEN+1]; /* the procedure name stack */ @@ -122,7 +121,7 @@ char *l_nocom; /* regexp for non-commen char *l_prcbeg; /* regular expr for procedure begin */ char *l_strbeg; /* delimiter for string constant */ char *l_strend; /* delimiter for string constant */ -boolean l_toplex; /* procedures only defined at top lex level */ +bool l_toplex; /* procedures only defined at top lex level */ const char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) @@ -158,7 +157,7 @@ main(int argc, char **argv) /* act as a filter like eqn */ if (!strcmp(argv[0], "-f")) { - filter++; + filter = true; argv[0] = argv[argc-1]; argv[argc-1] = strdup("-"); continue; @@ -172,13 +171,13 @@ main(int argc, char **argv) /* build an index */ if (!strcmp(argv[0], "-x")) { - idx++; + idx = true; argv[0] = strdup("-n"); } /* indicate no keywords */ if (!strcmp(argv[0], "-n")) { - nokeyw++; + nokeyw = true; argc--, argv++; continue; } @@ -235,7 +234,7 @@ main(int argc, char **argv) exit(0); } if (cgetustr(defs, "kw", &cp) == -1) - nokeyw = TRUE; + nokeyw = true; else { char **cpp; @@ -280,10 +279,10 @@ main(int argc, char **argv) /* initialize the program */ - incomm = FALSE; - instr = FALSE; - inchr = FALSE; - _escaped = FALSE; + incomm = false; + instr = false; + inchr = false; + _escaped = false; blklevel = 0; for (psptr=0; psptr 0 /* sanity */) blklevel--; @@ -469,7 +468,7 @@ skip: /* see if we should print the last proc name */ if (--psptr >= 0) - prccont = TRUE; + prccont = true; else psptr = -1; } @@ -479,7 +478,7 @@ skip: /* start of a lexical block */ if (blksptr != NIL) { - putKcp (s, blksptr - 1, FALSE); + putKcp(s, blksptr - 1, false); s = blksptr; blklevel++; continue; @@ -492,17 +491,17 @@ skip: if (((comtype == STANDARD) && (comptr != NIL)) || ((comtype == ALTERNATE) && (acmptr != NIL))) { if (comtype == STANDARD) { - putKcp (s, comptr-1, TRUE); + putKcp(s, comptr-1, true); s = comptr; } else { - putKcp (s, acmptr-1, TRUE); + putKcp(s, acmptr-1, true); s = acmptr; } - incomm = FALSE; + incomm = false; ps("\\c\n'-C\n"); continue; } else { - putKcp (s, s + strlen(s) -1, TRUE); + putKcp(s, s + strlen(s) -1, true); s = s + strlen(s); continue; } @@ -510,12 +509,12 @@ skip: /* check for end of string */ } else if (instr) { if ((strptr = expmatch (s, l_strend, dummy)) != NIL) { - putKcp (s, strptr-1, TRUE); + putKcp(s, strptr-1, true); s = strptr; - instr = FALSE; + instr = false; continue; } else { - putKcp (s, s+strlen(s)-1, TRUE); + putKcp(s, s+strlen(s)-1, true); s = s + strlen(s); continue; } @@ -523,19 +522,19 @@ skip: /* check for end of character string */ } else if (inchr) { if ((chrptr = expmatch (s, l_chrend, dummy)) != NIL) { - putKcp (s, chrptr-1, TRUE); + putKcp(s, chrptr-1, true); s = chrptr; - inchr = FALSE; + inchr = false; continue; } else { - putKcp (s, s+strlen(s)-1, TRUE); + putKcp(s, s+strlen(s)-1, true); s = s + strlen(s); continue; } } /* print out the line */ - putKcp (s, s + strlen(s) -1, FALSE); + putKcp(s, s + strlen(s) -1, false); s = s + strlen(s); } while (*s); } @@ -546,7 +545,7 @@ skip: * force: true if we should force nokeyw */ static void -putKcp (char *start, char *end, boolean force) +putKcp(char *start, char *end, bool force) { int i; int xfld = 0; @@ -687,15 +686,15 @@ putcp(c) /* * look for a process beginning on this line */ -static boolean +static bool isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) if (expmatch (s, l_prcbeg, pname) != NIL) { - return (TRUE); + return (true); } - return (FALSE); + return (false); } @@ -716,4 +715,3 @@ iskw(register char *s) return (i); return (0); } - From owner-svn-src-all@FreeBSD.ORG Tue May 5 08:16:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08D18273; Tue, 5 May 2015 08:16: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 EB0AA1CC2; Tue, 5 May 2015 08:16: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 t458Gl4L029260; Tue, 5 May 2015 08:16:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458GlxU029259; Tue, 5 May 2015 08:16:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505050816.t458GlxU029259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 May 2015 08:16:47 +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: r282458 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:16:48 -0000 Author: kib Date: Tue May 5 08:16:47 2015 New Revision: 282458 URL: https://svnweb.freebsd.org/changeset/base/282458 Log: MFC r282128: Do not sleep waiting for the MAP_ENTRY_IN_TRANSITION state ending with the vnode locked. Modified: stable/9/sys/vm/vm_fault.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_fault.c ============================================================================== --- stable/9/sys/vm/vm_fault.c Tue May 5 08:15:10 2015 (r282457) +++ stable/9/sys/vm/vm_fault.c Tue May 5 08:16:47 2015 (r282458) @@ -296,6 +296,10 @@ RetryFault:; vm_map_lock(fs.map); if (vm_map_lookup_entry(fs.map, vaddr, &fs.entry) && (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION)) { + if (fs.vp != NULL) { + vput(fs.vp); + fs.vp = NULL; + } fs.entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; vm_map_unlock_and_wait(fs.map, 0); } else From owner-svn-src-all@FreeBSD.ORG Tue May 5 08:17:42 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7CBB3E7; Tue, 5 May 2015 08:17: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 C61D41CD2; Tue, 5 May 2015 08:17: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 t458HfpJ029479; Tue, 5 May 2015 08:17:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458HfR9029477; Tue, 5 May 2015 08:17:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050817.t458HfR9029477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 08:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282459 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 08:17:42 -0000 Author: bapt Date: Tue May 5 08:17:40 2015 New Revision: 282459 URL: https://svnweb.freebsd.org/changeset/base/282459 Log: Replace homebrewed NIL by NULL Modified: head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 08:16:47 2015 (r282458) +++ head/usr.bin/vgrind/regexp.c Tue May 5 08:17:40 2015 (r282459) @@ -49,8 +49,6 @@ static const char sccsid[] = "@(#)regexp #include "extern.h" -#define NIL 0 - static void expconv(void); bool _escaped; /* true if we are currently x_escaped */ @@ -151,10 +149,10 @@ convexp(char *re) register char *cre; /* pointer to converted regular expression */ /* allocate room for the converted expression */ - if (re == NIL) - return (NIL); + if (re == NULL) + return (NULL); if (*re == '\0') - return (NIL); + return (NULL); cre = malloc (4 * strlen(re) + 3); ccre = cre; ure = re; @@ -179,9 +177,9 @@ expconv() register int temp; /* let the conversion begin */ - acs = NIL; - cs = NIL; - while (*ure != NIL) { + acs = NULL; + cs = NULL; + while (*ure) { switch (c = *ure++) { case '\\': @@ -189,7 +187,7 @@ expconv() /* escaped characters are just characters */ default: - if (cs == NIL || (*cs & STR) == 0) { + if (cs == NULL || (*cs & STR) == 0) { cs = ccre; *cs = STR; SCNT(cs) = 1; @@ -204,13 +202,13 @@ expconv() case 'd': case 'e': case 'p': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -223,13 +221,13 @@ expconv() /* just put the symbol in */ case '^': case '$': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -245,13 +243,13 @@ expconv() /* recurse and define a subexpression */ case '(': - if (acs != NIL && acs != cs) { + if (acs != NULL && acs != cs) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = OPER; @@ -263,13 +261,13 @@ expconv() /* return from a recursion */ case ')': - if (acs != NIL) { + if (acs != NULL) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } cs = ccre; *cs = META; @@ -281,7 +279,7 @@ expconv() /* the third byte will contain an offset to jump over the */ /* alternate match in case the first did not fail */ case '|': - if (acs != NIL && acs != cs) + if (acs != NULL && acs != cs) OCNT(ccre) = ccre - acs; /* make a back pointer */ else OCNT(ccre) = 0; @@ -295,7 +293,7 @@ expconv() /* if its not a metasymbol just build a scharacter string */ default: - if (cs == NIL || (*cs & STR) == 0) { + if (cs == NULL || (*cs & STR) == 0) { cs = ccre; *cs = STR; SCNT(cs) = 1; @@ -306,13 +304,13 @@ expconv() break; } } - if (acs != NIL) { + if (acs != NULL) { do { temp = OCNT(acs); OCNT(acs) = ccre - acs; acs -= temp; } while (temp != 0); - acs = NIL; + acs = NULL; } return; } @@ -354,8 +352,8 @@ expmatch (register char *s, register cha bool matched; /* a temporary bool */ /* initial conditions */ - if (re == NIL) - return (NIL); + if (re == NULL) + return (NULL); cs = re; matched = false; @@ -383,7 +381,7 @@ expmatch (register char *s, register cha } else { /* no match, error return */ - return (NIL); + return (NULL); } break; @@ -406,7 +404,7 @@ expmatch (register char *s, register cha /* this is a grouping, recurse */ case '(': ptr = expmatch (s, ONEXT(cs), mstring); - if (ptr != NIL) { + if (ptr != NULL) { /* the subexpression matched */ matched = 1; @@ -422,7 +420,7 @@ expmatch (register char *s, register cha } else { /* no match, error return */ - return (NIL); + return (NULL); } cs = OPTR(cs); break; @@ -443,20 +441,20 @@ expmatch (register char *s, register cha s1 = s; do { ptr = expmatch (s1, MNEXT(cs), mstring); - if (ptr != NIL && s1 != s) { + if (ptr != NULL && s1 != s) { /* we have a match, remember the match */ strncpy (mstring, s, s1 - s); mstring[s1 - s] = '\0'; return (ptr); - } else if (ptr != NIL && (*cs & OPT)) { + } else if (ptr != NULL && (*cs & OPT)) { /* it was aoptional so no match is ok */ return (ptr); - } else if (ptr != NIL) { + } else if (ptr != NULL) { /* not optional and we still matched */ - return (NIL); + return (NULL); } if (!(isalnum(*s1) || *s1 == '_' || /* C++ destructor */ @@ -464,13 +462,13 @@ expmatch (register char *s, register cha /* C++ scope operator */ (strlen(s1) > 1 && *s1 == ':' && s1[1] == ':' && (s1++, true)))) - return (NIL); + return (NULL); if (*s1 == '\\') _escaped = _escaped ? false : true; else _escaped = false; } while (*s1++); - return (NIL); + return (NULL); /* try to match anything */ case 'a': @@ -482,30 +480,30 @@ expmatch (register char *s, register cha s1 = s; do { ptr = expmatch (s1, MNEXT(cs), mstring); - if (ptr != NIL && s1 != s) { + if (ptr != NULL && s1 != s) { /* we have a match */ return (ptr); - } else if (ptr != NIL && (*cs & OPT)) { + } else if (ptr != NULL && (*cs & OPT)) { /* it was aoptional so no match is ok */ return (ptr); - } else if (ptr != NIL) { + } else if (ptr != NULL) { /* not optional and we still matched */ - return (NIL); + return (NULL); } if (*s1 == '\\') _escaped = _escaped ? false : true; else _escaped = false; } while (*s1++); - return (NIL); + return (NULL); /* fail if we are currently _escaped */ case 'e': if (_escaped) - return(NIL); + return(NULL); cs = MNEXT(cs); break; @@ -537,7 +535,7 @@ expmatch (register char *s, register cha } else /* no match, error return */ - return (NIL); + return (NULL); break; /* check for end of line */ @@ -561,7 +559,7 @@ expmatch (register char *s, register cha } else /* no match, error return */ - return (NIL); + return (NULL); break; /* check for start of line */ @@ -584,7 +582,7 @@ expmatch (register char *s, register cha } else /* no match, error return */ - return (NIL); + return (NULL); break; /* end of a subexpression, return success */ Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:16:47 2015 (r282458) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:17:40 2015 (r282459) @@ -53,7 +53,6 @@ static const char sccsid[] = "@(#)vfonte #include "pathnames.h" #include "extern.h" -#define NIL 0 #define STANDARD 0 #define ALTERNATE 1 @@ -247,7 +246,7 @@ main(int argc, char **argv) while (*cp != ' ' && *cp != '\t' && *cp) cp++; } - *cpp = NIL; + *cpp = NULL; } cgetustr(defs, "pb", &cp); l_prcbeg = convexp(cp); @@ -388,9 +387,9 @@ skip: nocomptr = expmatch (s, l_nocom, dummy); /* start of non-comment? */ - if (nocomptr != NIL) - if ((nocomptr <= comptr || comptr == NIL) - && (nocomptr <= acmptr || acmptr == NIL)) { + if (nocomptr != NULL) + if ((nocomptr <= comptr || comptr == NULL) + && (nocomptr <= acmptr || acmptr == NULL)) { /* continue after non-comment */ putKcp (s, nocomptr-1, false); s = nocomptr; @@ -398,12 +397,12 @@ skip: } /* start of a comment? */ - if (comptr != NIL) - if ((comptr < strptr || strptr == NIL) - && (comptr < acmptr || acmptr == NIL) - && (comptr < chrptr || chrptr == NIL) - && (comptr < blksptr || blksptr == NIL) - && (comptr < blkeptr || blkeptr == NIL)) { + if (comptr != NULL) + if ((comptr < strptr || strptr == NULL) + && (comptr < acmptr || acmptr == NULL) + && (comptr < chrptr || chrptr == NULL) + && (comptr < blksptr || blksptr == NULL) + && (comptr < blkeptr || blkeptr == NULL)) { putKcp (s, comptr-1, false); s = comptr; incomm = true; @@ -415,11 +414,11 @@ skip: } /* start of a comment? */ - if (acmptr != NIL) - if ((acmptr < strptr || strptr == NIL) - && (acmptr < chrptr || chrptr == NIL) - && (acmptr < blksptr || blksptr == NIL) - && (acmptr < blkeptr || blkeptr == NIL)) { + if (acmptr != NULL) + if ((acmptr < strptr || strptr == NULL) + && (acmptr < chrptr || chrptr == NULL) + && (acmptr < blksptr || blksptr == NULL) + && (acmptr < blkeptr || blkeptr == NULL)) { putKcp (s, acmptr-1, false); s = acmptr; incomm = true; @@ -431,10 +430,10 @@ skip: } /* start of a string? */ - if (strptr != NIL) - if ((strptr < chrptr || chrptr == NIL) - && (strptr < blksptr || blksptr == NIL) - && (strptr < blkeptr || blkeptr == NIL)) { + if (strptr != NULL) + if ((strptr < chrptr || chrptr == NULL) + && (strptr < blksptr || blksptr == NULL) + && (strptr < blkeptr || blkeptr == NULL)) { putKcp(s, strptr-1, false); s = strptr; instr = true; @@ -442,9 +441,9 @@ skip: } /* start of a character string? */ - if (chrptr != NIL) - if ((chrptr < blksptr || blksptr == NIL) - && (chrptr < blkeptr || blkeptr == NIL)) { + if (chrptr != NULL) + if ((chrptr < blksptr || blksptr == NULL) + && (chrptr < blkeptr || blkeptr == NULL)) { putKcp(s, chrptr-1, false); s = chrptr; inchr = true; @@ -452,8 +451,8 @@ skip: } /* end of a lexical block */ - if (blkeptr != NIL) { - if (blkeptr < blksptr || blksptr == NIL) { + if (blkeptr != NULL) { + if (blkeptr < blksptr || blksptr == NULL) { putKcp(s, blkeptr - 1, false); s = blkeptr; if (blklevel > 0 /* sanity */) @@ -477,7 +476,7 @@ skip: } /* start of a lexical block */ - if (blksptr != NIL) { + if (blksptr != NULL) { putKcp(s, blksptr - 1, false); s = blksptr; blklevel++; @@ -488,8 +487,8 @@ skip: } else if (incomm) { comptr = expmatch (s, l_comend, dummy); acmptr = expmatch (s, l_acmend, dummy); - if (((comtype == STANDARD) && (comptr != NIL)) || - ((comtype == ALTERNATE) && (acmptr != NIL))) { + if (((comtype == STANDARD) && (comptr != NULL)) || + ((comtype == ALTERNATE) && (acmptr != NULL))) { if (comtype == STANDARD) { putKcp(s, comptr-1, true); s = comptr; @@ -508,7 +507,7 @@ skip: /* check for end of string */ } else if (instr) { - if ((strptr = expmatch (s, l_strend, dummy)) != NIL) { + if ((strptr = expmatch (s, l_strend, dummy)) != NULL) { putKcp(s, strptr-1, true); s = strptr; instr = false; @@ -521,7 +520,7 @@ skip: /* check for end of character string */ } else if (inchr) { - if ((chrptr = expmatch (s, l_chrend, dummy)) != NIL) { + if ((chrptr = expmatch (s, l_chrend, dummy)) != NULL) { putKcp(s, chrptr-1, true); s = chrptr; inchr = false; @@ -691,7 +690,7 @@ isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) - if (expmatch (s, l_prcbeg, pname) != NIL) { + if (expmatch (s, l_prcbeg, pname) != NULL) { return (true); } return (false); From owner-svn-src-all@FreeBSD.ORG Tue May 5 08:25:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C348762F; Tue, 5 May 2015 08:25: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 B27AB1DE0; Tue, 5 May 2015 08:25: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 t458PQ8n034068; Tue, 5 May 2015 08:25:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t458PQ93034067; Tue, 5 May 2015 08:25:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050825.t458PQ93034067@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 08:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282460 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 08:25:26 -0000 Author: bapt Date: Tue May 5 08:25:25 2015 New Revision: 282460 URL: https://svnweb.freebsd.org/changeset/base/282460 Log: Prevent useless use of strdup(3) Obtained from: NetBSD Modified: head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:17:40 2015 (r282459) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:25:25 2015 (r282460) @@ -124,6 +124,8 @@ bool l_toplex; /* procedures only defi const char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) +static char minus[] = "-"; +static char minusn[] = "-n"; int main(int argc, char **argv) @@ -158,7 +160,7 @@ main(int argc, char **argv) if (!strcmp(argv[0], "-f")) { filter = true; argv[0] = argv[argc-1]; - argv[argc-1] = strdup("-"); + argv[argc-1] = minus; continue; } @@ -171,7 +173,7 @@ main(int argc, char **argv) /* build an index */ if (!strcmp(argv[0], "-x")) { idx = true; - argv[0] = strdup("-n"); + argv[0] = minusn; } /* indicate no keywords */ From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:01:43 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7372FEE4; Tue, 5 May 2015 09:01: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 622441245; Tue, 5 May 2015 09:01: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 t4591h1H053356; Tue, 5 May 2015 09:01:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4591gDV053353; Tue, 5 May 2015 09:01:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050901.t4591gDV053353@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282461 - head/usr.bin/vgrind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:01:43 -0000 Author: bapt Date: Tue May 5 09:01:42 2015 New Revision: 282461 URL: https://svnweb.freebsd.org/changeset/base/282461 Log: Apply seom style(9) fixes from NetBSD Obtained from: NetBSD Modified: head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/regexp.c ============================================================================== --- head/usr.bin/vgrind/regexp.c Tue May 5 08:25:25 2015 (r282460) +++ head/usr.bin/vgrind/regexp.c Tue May 5 09:01:42 2015 (r282461) @@ -153,7 +153,7 @@ convexp(char *re) return (NULL); if (*re == '\0') return (NULL); - cre = malloc (4 * strlen(re) + 3); + cre = malloc(4 * strlen(re) + 3); ccre = cre; ure = re; @@ -255,7 +255,7 @@ expconv() *cs = OPER; OSYM(cs) = '('; ccre = ONEXT(cs); - expconv (); + expconv(); OCNT(cs) = ccre - cs; /* offset to next symbol */ break; @@ -403,7 +403,7 @@ expmatch (register char *s, register cha /* this is a grouping, recurse */ case '(': - ptr = expmatch (s, ONEXT(cs), mstring); + ptr = expmatch(s, ONEXT(cs), mstring); if (ptr != NULL) { /* the subexpression matched */ @@ -440,7 +440,7 @@ expmatch (register char *s, register cha */ s1 = s; do { - ptr = expmatch (s1, MNEXT(cs), mstring); + ptr = expmatch(s1, MNEXT(cs), mstring); if (ptr != NULL && s1 != s) { /* we have a match, remember the match */ @@ -479,7 +479,7 @@ expmatch (register char *s, register cha */ s1 = s; do { - ptr = expmatch (s1, MNEXT(cs), mstring); + ptr = expmatch(s1, MNEXT(cs), mstring); if (ptr != NULL && s1 != s) { /* we have a match */ Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:25:25 2015 (r282460) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 09:01:42 2015 (r282461) @@ -225,10 +225,10 @@ main(int argc, char **argv) i = cgetent(&defs, defsfile, language); if (i == -1) { fprintf (stderr, "no entry for language %s\n", language); - exit (0); + exit(0); } else if (i == -2) { fprintf(stderr, "cannot find vgrindefs file %s\n", defsfile[0]); - exit (0); + exit(0); } else if (i == -3) { fprintf(stderr, "potential reference loop detected in vgrindefs file %s\n", defsfile[0]); @@ -347,8 +347,7 @@ main(int argc, char **argv) #define isidchr(c) (isalnum(c) || (c) == '_') static void -putScp(os) - char *os; +putScp(char *os) { register char *s = os; /* pointer to unmatched string */ char dummy[BUFSIZ]; /* dummy to be used by expmatch */ @@ -380,12 +379,12 @@ skip: /* check for string, comment, blockstart, etc */ if (!incomm && !instr && !inchr) { - blkeptr = expmatch (s, l_blkend, dummy); - blksptr = expmatch (s, l_blkbeg, dummy); - comptr = expmatch (s, l_combeg, dummy); - acmptr = expmatch (s, l_acmbeg, dummy); - strptr = expmatch (s, l_strbeg, dummy); - chrptr = expmatch (s, l_chrbeg, dummy); + blkeptr = expmatch(s, l_blkend, dummy); + blksptr = expmatch(s, l_blkbeg, dummy); + comptr = expmatch(s, l_combeg, dummy); + acmptr = expmatch(s, l_acmbeg, dummy); + strptr = expmatch(s, l_strbeg, dummy); + chrptr = expmatch(s, l_chrbeg, dummy); nocomptr = expmatch (s, l_nocom, dummy); /* start of non-comment? */ @@ -405,13 +404,13 @@ skip: && (comptr < chrptr || chrptr == NULL) && (comptr < blksptr || blksptr == NULL) && (comptr < blkeptr || blkeptr == NULL)) { - putKcp (s, comptr-1, false); + putKcp(s, comptr-1, false); s = comptr; incomm = true; comtype = STANDARD; if (s != os) - ps ("\\c"); - ps ("\\c\n'+C\n"); + ps("\\c"); + ps("\\c\n'+C\n"); continue; } @@ -421,13 +420,13 @@ skip: && (acmptr < chrptr || chrptr == NULL) && (acmptr < blksptr || blksptr == NULL) && (acmptr < blkeptr || blkeptr == NULL)) { - putKcp (s, acmptr-1, false); + putKcp(s, acmptr-1, false); s = acmptr; incomm = true; comtype = ALTERNATE; if (s != os) - ps ("\\c"); - ps ("\\c\n'+C\n"); + ps("\\c"); + ps("\\c\n'+C\n"); continue; } @@ -463,8 +462,8 @@ skip: /* end of current procedure */ if (s != os) - ps ("\\c"); - ps ("\\c\n'-F\n"); + ps("\\c"); + ps("\\c\n'-F\n"); blklevel = plstack[psptr]; /* see if we should print the last proc name */ @@ -487,8 +486,8 @@ skip: /* check for end of comment */ } else if (incomm) { - comptr = expmatch (s, l_comend, dummy); - acmptr = expmatch (s, l_acmend, dummy); + comptr = expmatch(s, l_comend, dummy); + acmptr = expmatch(s, l_acmend, dummy); if (((comtype == STANDARD) && (comptr != NULL)) || ((comtype == ALTERNATE) && (acmptr != NULL))) { if (comtype == STANDARD) { @@ -509,7 +508,7 @@ skip: /* check for end of string */ } else if (instr) { - if ((strptr = expmatch (s, l_strend, dummy)) != NULL) { + if ((strptr = expmatch(s, l_strend, dummy)) != NULL) { putKcp(s, strptr-1, true); s = strptr; instr = false; @@ -522,7 +521,7 @@ skip: /* check for end of character string */ } else if (inchr) { - if ((chrptr = expmatch (s, l_chrend, dummy)) != NULL) { + if ((chrptr = expmatch(s, l_chrend, dummy)) != NULL) { putKcp(s, chrptr-1, true); s = chrptr; inchr = false; @@ -587,7 +586,7 @@ putKcp(char *start, char *end, bool forc } } - putcp ((unsigned char)*start++); + putcp((unsigned char)*start++); } } @@ -620,8 +619,7 @@ width(register char *s, register char *o } static void -putcp(c) - register int c; +putcp(register int c) { switch(c) { @@ -692,7 +690,7 @@ isproc(char *s) { pname[0] = '\0'; if (!l_toplex || blklevel == 0) - if (expmatch (s, l_prcbeg, pname) != NULL) { + if (expmatch(s, l_prcbeg, pname) != NULL) { return (true); } return (false); From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:24:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 772E4369; Tue, 5 May 2015 09:24: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 665AC150F; Tue, 5 May 2015 09:24: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 t459OUdA063349; Tue, 5 May 2015 09:24:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459OUZa063348; Tue, 5 May 2015 09:24:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050924.t459OUZa063348@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282462 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:24:30 -0000 Author: bapt Date: Tue May 5 09:24:29 2015 New Revision: 282462 URL: https://svnweb.freebsd.org/changeset/base/282462 Log: cosmetic fixes Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:01:42 2015 (r282461) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:24:29 2015 (r282462) @@ -395,7 +395,7 @@ prop(int i) { if (stk[i].pl == 0) printf(".%s", br[stk[i].opno].opbr); - else switch (stk[i].opno) { + else switch(stk[i].opno) { case SZ: printf("\\s%c%d", stk[i].pl, stk[i].parm); break; @@ -567,7 +567,7 @@ addmac(const char *mac) } /* binsrch sets slot as a side effect */ #ifdef DEBUG -printf("binsrch(%s) -> %d\n", mac, slot); + printf("binsrch(%s) -> %d\n", mac, slot); #endif loc = &knowncmds[slot]; src = &knowncmds[ncmds-1]; From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:26:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C78C4BC; Tue, 5 May 2015 09:26:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4431527; Tue, 5 May 2015 09:26: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 t459QXd0063670; Tue, 5 May 2015 09:26:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459QXdL063669; Tue, 5 May 2015 09:26:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050926.t459QXdL063669@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282463 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:26:33 -0000 Author: bapt Date: Tue May 5 09:26:32 2015 New Revision: 282463 URL: https://svnweb.freebsd.org/changeset/base/282463 Log: Use stdup(3) and check its return instead from homebrew version using strcpy(3) and malloc(3) Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:24:29 2015 (r282462) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:26:32 2015 (r282463) @@ -574,7 +574,8 @@ addmac(const char *mac) dest = src+1; while (dest > loc) *dest-- = *src--; - *loc = strcpy(malloc(3), mac); + if ((*loc = strdup(mac)) == NULL) + err(1, "strdup"); ncmds++; #ifdef DEBUG printf("after: %s %s %s %s %s, %d cmds\n", From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:29:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6DF5641; Tue, 5 May 2015 09:29: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 B61F3155A; Tue, 5 May 2015 09:29: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 t459TWQ2064071; Tue, 5 May 2015 09:29:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459TWU9064070; Tue, 5 May 2015 09:29:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050929.t459TWU9064070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282464 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:29:32 -0000 Author: bapt Date: Tue May 5 09:29:32 2015 New Revision: 282464 URL: https://svnweb.freebsd.org/changeset/base/282464 Log: Ensure we read existing values of the stk table Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:26:32 2015 (r282463) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:29:32 2015 (r282464) @@ -341,7 +341,8 @@ process(FILE *f) n = 10 * n + line[i] - '0'; i--; if (n == 0) { - if (stk[stktop].opno == SZ) { + if (stktop >= 0 && + stk[stktop].opno == SZ) { stktop--; } else { pe(lineno); @@ -356,7 +357,8 @@ process(FILE *f) } else if (!fflag && line[i] == 'f') { n = line[++i]; if (n == 'P') { - if (stk[stktop].opno == FT) { + if (stktop >= 0 && + stk[stktop].opno == FT) { stktop--; } else { pe(lineno); From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:33:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1413A831; Tue, 5 May 2015 09:33: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 E9EA41636; Tue, 5 May 2015 09:33: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 t459X3Kb068224; Tue, 5 May 2015 09:33:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459X3cs068215; Tue, 5 May 2015 09:33:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505050933.t459X3cs068215@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 5 May 2015 09:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282465 - in head: sbin/geom/class/part sys/geom/part sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:33:04 -0000 Author: ae Date: Tue May 5 09:33:02 2015 New Revision: 282465 URL: https://svnweb.freebsd.org/changeset/base/282465 Log: Add apple-boot, apple-hfs and apple-ufs aliases to MBR scheme. Sort DOSPTYP_* entries in diskmbr.h by value. Document these scheme-specific types in gpart(8). MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue May 5 09:29:32 2015 (r282464) +++ head/sbin/geom/class/part/gpart.8 Tue May 5 09:33:02 2015 (r282465) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2015 +.Dd May 5, 2015 .Dt GPART 8 .Os .Sh NAME @@ -668,6 +668,8 @@ for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are +.Qq Li "!175" +for MBR, .Qq Li "!Apple_HFS" for APM and .Qq Li "!48465300-0000-11aa-aa11-00306543ecac" @@ -696,6 +698,8 @@ for GPT. .It Cm apple-ufs An Apple Mac OS X partition that contains a UFS filesystem. The scheme-specific types are +.Qq Li "!168" +for MBR, .Qq Li "!Apple_UNIX_SVR2" for APM and .Qq Li "!55465300-0000-11aa-aa11-00306543ecac" Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue May 5 09:29:32 2015 (r282464) +++ head/sys/geom/part/g_part_mbr.c Tue May 5 09:33:02 2015 (r282465) @@ -138,6 +138,9 @@ static struct g_part_mbr_alias { { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, + { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, + { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, + { DOSPTYP_HFS, G_PART_ALIAS_APPLE_HFS }, }; static int Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Tue May 5 09:29:32 2015 (r282464) +++ head/sys/sys/diskmbr.h Tue May 5 09:33:02 2015 (r282465) @@ -51,11 +51,13 @@ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ -#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ -#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ +#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ +#define DOSPTYP_APPLE_UFS 0xa8 /* Apple Mac OS X boot */ +#define DOSPTYP_APPLE_BOOT 0xab /* Apple Mac OS X UFS */ +#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ #define DOSPTYP_EFI 0xef /* EFI FAT parition */ #define DOSPTYP_VMFS 0xfb /* VMware VMFS partition */ From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:33:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F087F979; Tue, 5 May 2015 09:33: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 DF4801641; Tue, 5 May 2015 09:33: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 t459XWMK068318; Tue, 5 May 2015 09:33:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459XW2A068317; Tue, 5 May 2015 09:33:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050933.t459XW2A068317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282466 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:33:33 -0000 Author: bapt Date: Tue May 5 09:33:32 2015 New Revision: 282466 URL: https://svnweb.freebsd.org/changeset/base/282466 Log: Properly assign open and close brackets and checks memory Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:33:02 2015 (r282465) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:33:32 2015 (r282466) @@ -215,8 +215,18 @@ main(int argc, char **argv) for (i=0; br[i].opbr; i++) ; for (cp=argv[1]+3; cp[-1]; cp += 6) { - br[i].opbr = strncpy(malloc(3), cp, 2); - br[i].clbr = strncpy(malloc(3), cp+3, 2); + char *tmp; + + if (i >= MAXBR) + errx(1, "too many pairs"); + if ((tmp = malloc(3)) == NULL) + err(1, "malloc"); + strlcpy(tmp, cp, 3); + br[i].opbr = tmp; + if ((tmp = malloc(3)) == NULL) + err(1, "malloc"); + strlcpy(tmp, cp+3, 3); + br[i].clbr = tmp; addmac(br[i].opbr); /* knows pairs are also known cmds */ addmac(br[i].clbr); i++; From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:38:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15CCBC01; Tue, 5 May 2015 09:38:23 +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 E4963167B; Tue, 5 May 2015 09:38:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D4210B980; Tue, 5 May 2015 05:38:21 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Date: Tue, 05 May 2015 05:32:11 -0400 Message-ID: <1850166.lcXaWhCA6D@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150505064556.GM34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> <20150505064556.GM34544@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 May 2015 05:38:21 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:38:23 -0000 On Tuesday, May 05, 2015 09:45:56 AM Gleb Smirnoff wrote: > John, > > On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: > J> > Your answer seems quite orthogonal to my question. I reread it couple of times, > J> > but still can't figure out how exactly do you prefet to fetch per-queue stats. > J> > Can you please explain in more detail? > J> > J> struct if_queue { > J> struct ifnet *ifq_parent; > J> void (*ifq_get_counter)(struct if_queue *, ift_counter); > J> ... > J> }; > J> > J> (Pretend that if_queue is a new object type and that each RX or TX queue on a > J> NIC has one.) > > This looks like a driver with 1024 queues would carry extra 1024 function pointers > per ifnet. Is it really worth? Could it be that queue #0 differs from queue #1? > Even, if a rare case when queue #N differs from queue #M do exist, they still > can share the pointer and the differentiating logic would be in the function > itself. Drivers with 1024 queues already have several pointers, however, you could have a "class" pointer (something ifnet doesn't have) like 'cdevsw' where you have a single structure containing the ops and the various queues have a pointer to that instead of having N duplicated function pointers. OTOH, you could probably keep this as an ifnet op, but accept a queue pointer as the argument still (that would give a similar effect). If you really want to trim function pointers though, fix ifnet to not duplicate them and use a shared ifnetsw among instances. :) > Right now, in the projects/ifnet branch, I'm developing in quite opposite > direction - many instances of the same driver share the set of interface > options. This is done to shrink struct ifnet. > > What's wrong with KPI when the queue number is parameter to an ifop? This > KPI would also hide the queue pointers from the stack, which are quite > driver specific. I think at some point we will want stack awareness in the stack for more than just stats. For example, the whole buf_ring/if_transmit thing has been non-ideal in terms of requiring drivers to duplicate a lot of code that was previously hidden from them making the drivers more complex (and fragile). Several of us would like to push the knowledge of the software ring (which is per-TX queue) back up out of drivers, but that will require some per-queue state stored outside of drivers. You could certainly do that with parallel arrays instead, but I'm not sure that is better than having a structure (at least I'm not sure that is as easy to reason about when you are working on the stack) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:50:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 768CE1A2; Tue, 5 May 2015 09:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 646D217DD; Tue, 5 May 2015 09:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t459oMPN074547; Tue, 5 May 2015 09:50:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459oM9V074546; Tue, 5 May 2015 09:50:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050950.t459oM9V074546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282467 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:50:22 -0000 Author: bapt Date: Tue May 5 09:50:21 2015 New Revision: 282467 URL: https://svnweb.freebsd.org/changeset/base/282467 Log: Update the list of known roff commands (adding the mdoc package) Obtained from: NetBSD Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:33:32 2015 (r282466) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:50:21 2015 (r282467) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #define MAXSTK 100 /* Stack size */ #define MAXBR 100 /* Max number of bracket pairs known */ -#define MAXCMDS 500 /* Max number of commands known */ +#define MAXCMDS 600 /* Max number of commands known */ static void addcmd(char *); static void addmac(const char *); @@ -134,6 +134,19 @@ static struct brstr { {"(q", ")q"}, {"(x", ")x"}, {"(z", ")z"}, + /* The -mdoc package */ + {"Ao", "Ac"}, + {"Bd", "Ed"}, + {"Bk", "Ek"}, + {"Bo", "Bc"}, + {"Do", "Dc"}, + {"Fo", "Fc"}, + {"Oo", "Oc"}, + {"Po", "Pc"}, + {"Qo", "Qc"}, + {"Rs", "Re"}, + {"So", "Sc"}, + {"Xo", "Xc"}, /* Things needed by preprocessors */ {"EQ", "EN"}, {"TS", "TE"}, @@ -147,40 +160,46 @@ static struct brstr { * Used so we can complain about unrecognized commands. */ static const char *knowncmds[MAXCMDS] = { -"$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", -"(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", -"+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", -"@c", "@e", "@f", "@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", -"AE", "AF", "AI", "AL", "AM", "AS", "AT", "AU", "AX", "B", "B1", "B2", -"BD", "BE", "BG", "BL", "BS", "BT", "BX", "C1", "C2", "CD", "CM", "CT", -"D", "DA", "DE", "DF", "DL", "DS", "DT", "EC", "EF", "EG", "EH", "EM", -"EN", "EQ", "EX", "FA", "FD", "FE", "FG", "FJ", "FK", "FL", "FN", "FO", -"FQ", "FS", "FV", "FX", "H", "HC", "HD", "HM", "HO", "HU", "I", "ID", -"IE", "IH", "IM", "IP", "IX", "IZ", "KD", "KE", "KF", "KQ", "KS", "LB", -"LC", "LD", "LE", "LG", "LI", "LP", "MC", "ME", "MF", "MH", "ML", "MR", -"MT", "ND", "NE", "NH", "NL", "NP", "NS", "OF", "OH", "OK", "OP", "P", -"P1", "PF", "PH", "PP", "PT", "PX", "PY", "QE", "QP", "QS", "R", "RA", -"RC", "RE", "RL", "RP", "RQ", "RS", "RT", "S", "S0", "S2", "S3", "SA", -"SG", "SH", "SK", "SM", "SP", "SY", "T&", "TA", "TB", "TC", "TD", "TE", -"TH", "TL", "TM", "TP", "TQ", "TR", "TS", "TX", "UL", "US", "UX", "VL", -"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "[", "[-", "[0", -"[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "]", "]-", "]<", "]>", -"][", "ab", "ac", "ad", "af", "am", "ar", "as", "b", "ba", "bc", "bd", -"bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", "ce", "cf", "ch", -"chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", "ds", -"dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", -"evc", "ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", -"fp", "ft", "ftr", "fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", -"ht", "hw", "hx", "hy", "hylang", "i", "ie", "if", "ig", "in", "ip", -"it", "ix", "kern", "kernafter", "kernbefore", "kernpair", "lc", "lg", -"lhang", "lc_ctype", "li", "ll", "ln", "lo", "lp", "ls", "lt", "m1", -"m2", "m3", "m4", "mc", "mk", "mo", "n1", "n2", "na", "ne", "nf", "nh", -"nl", "nm", "nn", "np", "nr", "ns", "nx", "of", "oh", "os", "pa", -"papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", "ps", "q", -"r", "rb", "rd", "re", "recursionlimit", "return", "rhang", "rm", -"rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", "so", -"sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", -"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", +"$c", "$f", "$h", "$p", "$s", "%A", "%B", "%C", "%D", "%I", "%J", "%N", "%O", +"%P", "%Q", "%R", "%T", "%V", "(b", "(c", "(d", "(f", "(l", "(q", "(t", "(x", +"(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", "+c", "1C", +"1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", "@c", "@e", "@f", +"@h", "@m", "@n", "@o", "@p", "@r", "@t", "@z", "AB", "AE", "AF", "AI", "AL", +"AM", "AS", "AT", "AU", "AX", "Ac", "Ad", "An", "Ao", "Ap", "Aq", "Ar", "At", +"B", "B" , "B1", "B2", "BD", "BE", "BG", "BL", "BS", "BT", "BX", "Bc", "Bd", +"Bf", "Bk", "Bl", "Bo", "Bq", "Bsx", "Bx", "C1", "C2", "CD", "CM", "CT", "Cd", +"Cm", "D", "D" , "D1", "DA", "DE", "DF", "DL", "DS", "DT", "Db", "Dc", "Dd", +"Dl", "Do", "Dq", "Dt", "Dv", "EC", "EF", "EG", "EH", "EM", "EN", "EQ", "EX", +"Ec", "Ed", "Ef", "Ek", "El", "Em", "Eo", "Er", "Ev", "FA", "FD", "FE", "FG", +"FJ", "FK", "FL", "FN", "FO", "FQ", "FS", "FV", "FX", "Fa", "Fc", "Fd", "Fl", +"Fn", "Fo", "Ft", "Fx", "H", "H" , "HC", "HD", "HM", "HO", "HU", "I", "I" , +"ID", "IE", "IH", "IM", "IP", "IX", "IZ", "Ic", "In", "It", "KD", "KE", "KF", +"KQ", "KS", "LB", "LC", "LD", "LE", "LG", "LI", "LP", "Lb", "Li", "MC", "ME", +"MF", "MH", "ML", "MR", "MT", "ND", "NE", "NH", "NL", "NP", "NS", "Nd", "Nm", +"No", "Ns", "Nx", "OF", "OH", "OK", "OP", "Oc", "Oo", "Op", "Os", "Ot", "Ox", +"P", "P" , "P1", "PF", "PH", "PP", "PT", "PX", "PY", "Pa", "Pc", "Pf", "Po", +"Pp", "Pq", "QE", "QP", "QS", "Qc", "Ql", "Qo", "Qq", "R", "R" , "RA", "RC", +"RE", "RL", "RP", "RQ", "RS", "RT", "Re", "Rs", "S", "S" , "S0", "S2", "S3", +"SA", "SG", "SH", "SK", "SM", "SP", "SY", "Sc", "Sh", "Sm", "So", "Sq", "Ss", +"St", "Sx", "Sy", "T&", "TA", "TB", "TC", "TD", "TE", "TH", "TL", "TM", "TP", +"TQ", "TR", "TS", "TX", "Tn", "UL", "US", "UX", "Ud", "Ux", "VL", "Va", "Vt", +"WC", "WH", "XA", "XD", "XE", "XF", "XK", "XP", "XS", "Xc", "Xo", "Xr", "[", +"[" , "[-", "[0", "[1", "[2", "[3", "[4", "[5", "[<", "[>", "[]", "\\{", "\\}", +"]", "]" , "]-", "]<", "]>", "][", "ab", "ac", "ad", "af", "am", "ar", "as", +"b", "b" , "ba", "bc", "bd", "bi", "bl", "bp", "br", "bx", "c.", "c2", "cc", +"ce", "cf", "ch", "chop", "cs", "ct", "cu", "da", "de", "di", "dl", "dn", "do", +"ds", "dt", "dw", "dy", "ec", "ef", "eh", "el", "em", "eo", "ep", "ev", "evc", +"ex", "fallback", "fc", "feature", "fi", "fl", "flig", "fo", "fp", "ft", "ftr", +"fz", "fzoom", "hc", "he", "hidechar", "hl", "hp", "ht", "hw", "hx", "hy", +"hylang", "i", "i" , "ie", "if", "ig", "in", "ip", "it", "ix", "kern", +"kernafter", "kernbefore", "kernpair", "lc", "lc_ctype", "lg", "lhang", "li", +"ll", "ln", "lo", "lp", "ls", "lt", "m1", "m2", "m3", "m4", "mc", "mk", "mo", +"n1", "n2", "na", "ne", "nf", "nh", "nl", "nm", "nn", "np", "nr", "ns", "nx", +"of", "oh", "os", "pa", "papersize", "pc", "pi", "pl", "pm", "pn", "po", "pp", +"ps", "q", "q" , "r", "r" , "rb", "rd", "re", "recursionlimit", "return", +"rhang", "rm", "rn", "ro", "rr", "rs", "rt", "sb", "sc", "sh", "shift", "sk", +"so", "sp", "ss", "st", "sv", "sz", "ta", "tc", "th", "ti", "tl", "tm", "tp", +"tr", "track", "u", "uf", "uh", "ul", "vs", "wh", "xflag", "xp", "yr", 0 }; From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:54:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07B4440; Tue, 5 May 2015 09:54: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 DF56118D8; Tue, 5 May 2015 09:54: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 t459slPW078726; Tue, 5 May 2015 09:54:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t459slxm078725; Tue, 5 May 2015 09:54:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201505050954.t459slxm078725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 5 May 2015 09:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282468 - head/usr.bin/checknr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 09:54:48 -0000 Author: bapt Date: Tue May 5 09:54:47 2015 New Revision: 282468 URL: https://svnweb.freebsd.org/changeset/base/282468 Log: Enlarge the buffer for storing macros as some macros can be longer than 5 Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue May 5 09:50:21 2015 (r282467) +++ head/usr.bin/checknr/checknr.c Tue May 5 09:54:47 2015 (r282468) @@ -313,7 +313,7 @@ static void process(FILE *f) { int i, n; - char mac[5]; /* The current macro or nroff command */ + char mac[512]; /* The current macro or nroff command */ char *line; size_t linecap; int pl; From owner-svn-src-all@FreeBSD.ORG Tue May 5 09:59:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D60D95D2; Tue, 5 May 2015 09:59:16 +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 740851909; Tue, 5 May 2015 09:59:15 +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 t459x6iF048389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 May 2015 12:59:06 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t459x6FE048388; Tue, 5 May 2015 12:59:06 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 5 May 2015 12:59:06 +0300 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282280 - in head/sys/dev: e1000 ixgbe ixl Message-ID: <20150505095906.GO34544@FreeBSD.org> References: <201504301823.t3UINd74073186@svn.freebsd.org> <2463555.FfYUgqxYi8@ralph.baldwin.cx> <20150505064556.GM34544@FreeBSD.org> <1850166.lcXaWhCA6D@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1850166.lcXaWhCA6D@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 09:59:17 -0000 On Tue, May 05, 2015 at 05:32:11AM -0400, John Baldwin wrote: J> > On Mon, May 04, 2015 at 04:01:28PM -0400, John Baldwin wrote: J> > J> > Your answer seems quite orthogonal to my question. I reread it couple of times, J> > J> > but still can't figure out how exactly do you prefet to fetch per-queue stats. J> > J> > Can you please explain in more detail? J> > J> J> > J> struct if_queue { J> > J> struct ifnet *ifq_parent; J> > J> void (*ifq_get_counter)(struct if_queue *, ift_counter); J> > J> ... J> > J> }; J> > J> J> > J> (Pretend that if_queue is a new object type and that each RX or TX queue on a J> > J> NIC has one.) J> > J> > This looks like a driver with 1024 queues would carry extra 1024 function pointers J> > per ifnet. Is it really worth? Could it be that queue #0 differs from queue #1? J> > Even, if a rare case when queue #N differs from queue #M do exist, they still J> > can share the pointer and the differentiating logic would be in the function J> > itself. J> J> Drivers with 1024 queues already have several pointers, however, you could J> have a "class" pointer (something ifnet doesn't have) like 'cdevsw' where you J> have a single structure containing the ops and the various queues have a pointer J> to that instead of having N duplicated function pointers. OTOH, you could probably J> keep this as an ifnet op, but accept a queue pointer as the argument still (that J> would give a similar effect). J> J> If you really want to trim function pointers though, fix ifnet to not duplicate J> them and use a shared ifnetsw among instances. :) Note that my own paragraph quoted below states that this is exactly what I did in projects/ifnet. J> > Right now, in the projects/ifnet branch, I'm developing in quite opposite J> > direction - many instances of the same driver share the set of interface J> > options. This is done to shrink struct ifnet. J> > J> > What's wrong with KPI when the queue number is parameter to an ifop? This J> > KPI would also hide the queue pointers from the stack, which are quite J> > driver specific. J> J> I think at some point we will want stack awareness in the stack for more than J> just stats. For example, the whole buf_ring/if_transmit thing has been non-ideal J> in terms of requiring drivers to duplicate a lot of code that was previously J> hidden from them making the drivers more complex (and fragile). Several of us J> would like to push the knowledge of the software ring (which is per-TX queue) J> back up out of drivers, but that will require some per-queue state stored outside J> of drivers. You could certainly do that with parallel arrays instead, but I'm J> not sure that is better than having a structure (at least I'm not sure that is J> as easy to reason about when you are working on the stack) Well, if the drivers access the structure functionally: dequeue, putback, etc., then this isn't a big deal. When the structure is ready, and we got drivers capable of working with it, we can introduce if_transmit_queue. I hope by that time projects/ifnet will be finalized, and expanding functionality of ifnet will be much easier. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue May 5 10:19:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2709BB96; Tue, 5 May 2015 10:19: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 15B451BAC; Tue, 5 May 2015 10:19: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 t45AJhuh089520; Tue, 5 May 2015 10:19:43 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AJhPV089518; Tue, 5 May 2015 10:19:43 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201505051019.t45AJhPV089518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 5 May 2015 10:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282469 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 10:19:44 -0000 Author: garga (ports committer) Date: Tue May 5 10:19:43 2015 New Revision: 282469 URL: https://svnweb.freebsd.org/changeset/base/282469 Log: Add support for Sierra MC7354 card Author: Jeremy Porter Differential Revision: https://reviews.freebsd.org/D2444 Reviewed by: gnn, hselasky MFC after: 1 week Sponsored by: Netgate Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue May 5 09:54:47 2015 (r282468) +++ head/sys/dev/usb/serial/u3g.c Tue May 5 10:19:43 2015 (r282469) @@ -522,6 +522,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(SIERRA, MC5727, 0), U3G_DEV(SIERRA, MC5727_2, 0), U3G_DEV(SIERRA, MC5728, 0), + U3G_DEV(SIERRA, MC7354, 0), U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), U3G_DEV(SIERRA, MC8755_2, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 5 09:54:47 2015 (r282468) +++ head/sys/dev/usb/usbdevs Tue May 5 10:19:43 2015 (r282469) @@ -4029,6 +4029,7 @@ product SIERRA C22 0x6891 C22 product SIERRA E6892 0x6892 E6892 product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 +product SIERRA MC7354 0x6820 MC7354 product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer From owner-svn-src-all@FreeBSD.ORG Tue May 5 10:33:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F4E7E; Tue, 5 May 2015 10:33: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 BF7571DA6; Tue, 5 May 2015 10:33: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 t45AX01G098724; Tue, 5 May 2015 10:33:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AX07f098723; Tue, 5 May 2015 10:33:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051033.t45AX07f098723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 10:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282470 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:33:00 -0000 Author: andrew Date: Tue May 5 10:32:59 2015 New Revision: 282470 URL: https://svnweb.freebsd.org/changeset/base/282470 Log: When cross-building ${LIBSTAND} may be set to the host copy. Point to the version built with the toolchain. Differential Revision: https://reviews.freebsd.org/D2312 Submitted by: jhb Modified: head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue May 5 10:19:43 2015 (r282469) +++ head/sys/boot/efi/loader/Makefile Tue May 5 10:32:59 2015 (r282470) @@ -38,6 +38,12 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 CFLAGS+= -DNO_PCI -DEFI +# make buildenv doesn't set DESTDIR, this means LIBSTAND +# will be wrong when crossbuilding. +.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a) +LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a +.endif + .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH From owner-svn-src-all@FreeBSD.ORG Tue May 5 10:35:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2610231C; Tue, 5 May 2015 10:35: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 1481E1DCE; Tue, 5 May 2015 10:35: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 t45AZTLb099363; Tue, 5 May 2015 10:35:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AZTok099362; Tue, 5 May 2015 10:35:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051035.t45AZTok099362@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 10:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282471 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 10:35:30 -0000 Author: andrew Date: Tue May 5 10:35:29 2015 New Revision: 282471 URL: https://svnweb.freebsd.org/changeset/base/282471 Log: Copy new attribute types when linking. bfd will copy attributes as needed, however it will fail to output them if the type is not set correctly. This can happen when it finds an attribute it hasn't seen before, for example when building shared objects it will use the attributes from crti.o, hwever this file has no attributes set. Differential Revision: https://reviews.freebsd.org/D2413 Reviewed by: imp Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Tue May 5 10:32:59 2015 (r282470) +++ head/contrib/binutils/bfd/elf32-arm.c Tue May 5 10:35:29 2015 (r282471) @@ -6816,6 +6816,9 @@ elf32_arm_merge_eabi_attributes (bfd *ib for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { + if (out_attr[i].type == 0) + out_attr[i].type = in_attr[i].type; + /* Merge this attribute with existing attributes. */ switch (i) { From owner-svn-src-all@FreeBSD.ORG Tue May 5 10:37:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DA6F4A4; Tue, 5 May 2015 10:37:25 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1D11DF8; Tue, 5 May 2015 10:37:25 +0000 (UTC) Received: from bender (host81-149-102-120.in-addr.btopenworld.com [81.149.102.120]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 5C116D7A6E; Tue, 5 May 2015 10:36:47 +0000 (UTC) Date: Tue, 5 May 2015 11:36:43 +0100 From: Andrew Turner To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282470 - head/sys/boot/efi/loader Message-ID: <20150505113643.3e0101ee@bender> In-Reply-To: <201505051033.t45AX07f098723@svn.freebsd.org> References: <201505051033.t45AX07f098723@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:37:25 -0000 On Tue, 5 May 2015 10:33:00 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Tue May 5 10:32:59 2015 > New Revision: 282470 > URL: https://svnweb.freebsd.org/changeset/base/282470 > > Log: > When cross-building ${LIBSTAND} may be set to the host copy. Point > to the version built with the toolchain. > > Differential Revision: https://reviews.freebsd.org/D2312 > Submitted by: jhb This should be "Reviewed by: jhb" Andrew From owner-svn-src-all@FreeBSD.ORG Tue May 5 10:44:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06A6732; Tue, 5 May 2015 10:44: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 9EB451ECB; Tue, 5 May 2015 10:44: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 t45AiIGg004337; Tue, 5 May 2015 10:44:18 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AiIpL004336; Tue, 5 May 2015 10:44:18 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201505051044.t45AiIpL004336@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 5 May 2015 10:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282472 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 10:44:18 -0000 Author: pluknet Date: Tue May 5 10:44:17 2015 New Revision: 282472 URL: https://svnweb.freebsd.org/changeset/base/282472 Log: Fix major copy/paste and other style errors. Modified: head/lib/libc/stdlib/reallocarray.3 Modified: head/lib/libc/stdlib/reallocarray.3 ============================================================================== --- head/lib/libc/stdlib/reallocarray.3 Tue May 5 10:35:29 2015 (r282471) +++ head/lib/libc/stdlib/reallocarray.3 Tue May 5 10:44:17 2015 (r282472) @@ -1,6 +1,5 @@ -.\" .\" Copyright (c) 1980, 1991, 1993 -.\">----The Regents of the University of California. All rights reserved. +.\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information @@ -44,6 +43,9 @@ .Sh DESCRIPTION The .Fn reallocarray +function is similar to the +.Fn realloc +function except it operates on .Fa nmemb members of size @@ -53,8 +55,9 @@ and checks for integer overflow in the c * .Fa size . .Sh RETURN VALUES +The .Fn reallocarray -return a pointer to the allocated space; otherwise, a +function returns a pointer to the allocated space; otherwise, a .Dv NULL pointer is returned and .Va errno @@ -132,6 +135,8 @@ if ((newp = reallocarray(p, num, size)) .Xr realloc 3 .Sh HISTORY The -.Fn reallocf +.Fn reallocarray function first appeared in -.Ox 5.6 . +.Ox 5.6 +and +.Fx 11.0 . From owner-svn-src-all@FreeBSD.ORG Tue May 5 10:56:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C22F3B2B; Tue, 5 May 2015 10:56: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 B014C1FF4; Tue, 5 May 2015 10:56:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45AuH6u009811; Tue, 5 May 2015 10:56:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45AuHmo009810; Tue, 5 May 2015 10:56:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505051056.t45AuHmo009810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2015 10:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282473 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 10:56:17 -0000 Author: avg Date: Tue May 5 10:56:16 2015 New Revision: 282473 URL: https://svnweb.freebsd.org/changeset/base/282473 Log: dmu_recv_end_check: don't leak hold if dsl_destroy_snapshot_check_impl fails The leak may happen if !drc_newfs && drc_force and there is an error iterating through snapshots or any of snapshot checks fails. See https://www.illumos.org/issues/5870 See https://reviews.csiden.org/r/206/ Reviewed by: mahrens (as mahrens@delphix.com) MFC after: 15 days Sponsored by: ClusterHQ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue May 5 10:44:17 2015 (r282472) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue May 5 10:56:16 2015 (r282473) @@ -2010,7 +2010,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); if (error != 0) - return (error); + break; if (snap->ds_dir != origin_head->ds_dir) error = SET_ERROR(EINVAL); if (error == 0) { @@ -2020,7 +2020,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) - return (error); + break; + } + if (error != 0) { + dsl_dataset_rele(origin_head, FTAG); + return (error); } } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:00:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88C90D9C; Tue, 5 May 2015 11:00: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 5CB5D10EA; Tue, 5 May 2015 11:00: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 t45B0qDo011676; Tue, 5 May 2015 11:00:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45B0p1o011673; Tue, 5 May 2015 11:00:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051100.t45B0p1o011673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282474 - in head/sys/boot/efi: boot1 libefi loader/arch/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:00:52 -0000 Author: andrew Date: Tue May 5 11:00:50 2015 New Revision: 282474 URL: https://svnweb.freebsd.org/changeset/base/282474 Log: Disable the use of floating-point and vector registers in the loader. They need the vfp unit to be enabled which may not be the case. Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/arch/arm64/Makefile.inc Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue May 5 10:56:16 2015 (r282473) +++ head/sys/boot/efi/boot1/Makefile Tue May 5 11:00:50 2015 (r282474) @@ -33,6 +33,9 @@ FILESMODE_boot1.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -msoft-float -mgeneral-regs-only +.endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue May 5 10:56:16 2015 (r282473) +++ head/sys/boot/efi/libefi/Makefile Tue May 5 11:00:50 2015 (r282474) @@ -6,6 +6,9 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -msoft-float -mgeneral-regs-only +.endif .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif Modified: head/sys/boot/efi/loader/arch/arm64/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue May 5 10:56:16 2015 (r282473) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc Tue May 5 11:00:50 2015 (r282474) @@ -7,3 +7,5 @@ SRCS+= exec.c \ .PATH: ${.CURDIR}/../../arm64/libarm64 CFLAGS+=-I${.CURDIR}/../../arm64/libarm64 SRCS+= cache.c + +CFLAGS+= -msoft-float -mgeneral-regs-only From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:01:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B515EDB; Tue, 5 May 2015 11:01: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 3952B10EB; Tue, 5 May 2015 11:01: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 t45B17mV012282; Tue, 5 May 2015 11:01:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45B16eD012277; Tue, 5 May 2015 11:01:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505051101.t45B16eD012277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2015 11:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282475 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 11:01:07 -0000 Author: avg Date: Tue May 5 11:01:06 2015 New Revision: 282475 URL: https://svnweb.freebsd.org/changeset/base/282475 Log: zfs: do not hold an extra reference on a root vnode while a filesystem is mounted At present zfs_domount() acquires a reference on the filesystem's root vnode and that reference is kept until zfs_umount. The latter calls vflush(rootrefs = 1) to dispose of the extra reference. There is no explanation of why that reference is kept - what problem it solves or what behavior it improves. Also, that logic is FreeBSD specific. There is one real problem with that reference, though. zfs recv -F may receive a full, non-incremental stream to a mounted filesystem. In that case the received root object is likely to have a different z_gen attribute value. Because of that, zfs_rezget will leave the previous root znode and vnode disassociated from the actual object (z_sa_hdl == NULL). Thus, future calls to VFS_ROOT() -> zfs_root() will produce a new vnode-znode pair, while the old one will be kept alive by the outstanding reference. So, the outstanding reference will not actually be for the new root vnode (or, more precisely, vnodes - because a root vnode may be recycled and a newer one can be created). As a result, when vflush(rootrefs = 1) s called there will be two problems: - a leaked reference on the old root vnode preventing a graceful unmount - insufficient references on the actual root vnode leading to a crash upon access to the vnode after it is destroyed by vgone() + vdrop() The second issue will actually override the first one. Differential Revision: https://reviews.freebsd.org/D2353 Reviewed by: delphij, kib, smh MFC after: 17 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue May 5 11:00:50 2015 (r282474) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue May 5 11:01:06 2015 (r282475) @@ -261,10 +261,6 @@ VTOZ(vnode_t *vp) } \ } -/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ -#define ZFS_ENTER_NOERROR(zfsvfs) \ - rrm_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) - /* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue May 5 11:00:50 2015 (r282474) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue May 5 11:01:06 2015 (r282475) @@ -1239,9 +1239,6 @@ zfs_domount(vfs_t *vfsp, char *osname) } vfs_mountedfrom(vfsp, osname); - /* Grab extra reference. */ - VERIFY(VFS_ROOT(vfsp, LK_EXCLUSIVE, &vp) == 0); - VOP_UNLOCK(vp, 0); if (!zfsvfs->z_issnap) zfsctl_create(zfsvfs); @@ -1819,7 +1816,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t znode_t *rootzp; int error; - ZFS_ENTER_NOERROR(zfsvfs); + ZFS_ENTER(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) @@ -1994,7 +1991,7 @@ zfs_umount(vfs_t *vfsp, int fflag) /* * Flush all the files. */ - ret = vflush(vfsp, 1, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); + ret = vflush(vfsp, 0, (fflag & MS_FORCE) ? FORCECLOSE : 0, td); if (ret != 0) { if (!zfsvfs->z_issnap) { zfsctl_create(zfsvfs); From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:07:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFEC7335; Tue, 5 May 2015 11:07: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 9E3471159; Tue, 5 May 2015 11:07: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 t45B7iCG015415; Tue, 5 May 2015 11:07:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45B7i2m015412; Tue, 5 May 2015 11:07:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051107.t45B7i2m015412@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282477 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:07:44 -0000 Author: andrew Date: Tue May 5 11:07:43 2015 New Revision: 282477 URL: https://svnweb.freebsd.org/changeset/base/282477 Log: Add FDT to the list of known GUIDs. Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue May 5 11:01:31 2015 (r282476) +++ head/sys/boot/efi/loader/main.c Tue May 5 11:07:43 2015 (r282477) @@ -59,6 +59,7 @@ EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_STATUS main(int argc, CHAR16 *argv[]) @@ -287,6 +288,8 @@ command_configuration(int argc, char *ar printf("Memory Type Information Table"); else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID))) printf("Debug Image Info Table"); + else if (!memcmp(guid, &fdtdtb, sizeof(EFI_GUID))) + printf("FDT Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:12:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D7934DB; Tue, 5 May 2015 11:12: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 01E131227; Tue, 5 May 2015 11:12: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 t45BCKjm019641; Tue, 5 May 2015 11:12:20 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BCKFv019640; Tue, 5 May 2015 11:12:20 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201505051112.t45BCKFv019640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Tue, 5 May 2015 11:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282478 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 11:12:21 -0000 Author: osa (ports committer) Date: Tue May 5 11:12:20 2015 New Revision: 282478 URL: https://svnweb.freebsd.org/changeset/base/282478 Log: Document DragonFly releases 4.0.2 - 4.0.5 and OpenBSD 5.7. Fix typo for NetBSD 6.1.5. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue May 5 11:07:43 2015 (r282477) +++ head/share/misc/bsd-family-tree Tue May 5 11:12:20 2015 (r282478) @@ -321,8 +321,15 @@ FreeBSD 5.2 | | | FreeBSD | | | | | 10.1 | | | DragonFly 4.0.1 | | | | | + | | | | DragonFly 4.0.2 | | | | | + | | | | DragonFly 4.0.3 | | | | | + | | | | DragonFly 4.0.4 + | | | | | + | | | | DragonFly 4.0.5 + | | | | | + | | | OpenBSD 5.7 | | | | | | | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current @@ -655,11 +662,16 @@ DragonFly 3.8.1 2014-06-16 [DFB] DragonFly 3.6.3 2014-06-17 [DFB] FreeBSD 9.3 2014-07-05 [FBD] DragonFly 3.8.2 2014-08-08 [DFB] -NetBSD 6.1.5 2014-09-22 [NDB] +NetBSD 6.1.5 2014-09-22 [NBD] Mac OS X 10.10 2014-10-16 [APL] OpenBSD 5.6 2014-11-01 [OBD] FreeBSD 10.1 2014-11-14 [FBD] DragonFly 4.0.1 2014-11-25 [DFB] +DragonFly 4.0.2 2015-01-07 [DFB] +DragonFly 4.0.3 2015-01-21 [DFB] +DragonFly 4.0.4 2015-03-09 [DFB] +DragonFly 4.0.5 2015-01-23 [DFB] +OpenBSD 5.7 2015-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:12:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 483DE618; Tue, 5 May 2015 11:12: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 1D48A122A; Tue, 5 May 2015 11:12: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 t45BCXIu019717; Tue, 5 May 2015 11:12:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BCXqH019716; Tue, 5 May 2015 11:12:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201505051112.t45BCXqH019716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 May 2015 11:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282479 - head/sys/cddl/contrib/opensolaris X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 11:12:34 -0000 Author: avg Date: Tue May 5 11:12:33 2015 New Revision: 282479 URL: https://svnweb.freebsd.org/changeset/base/282479 Log: mergeinfo for commits r282125 and r282126 Those were MFVs: MFV r282124: 5393 spurious failures from dsl_dataset_hold_obj() MFV r282123: 5610 zfs clone from different source and target pools produces coredump Modified: Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:13:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8C7175D; Tue, 5 May 2015 11:13: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 8CF4D1233; Tue, 5 May 2015 11:13:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45BDHbI019860; Tue, 5 May 2015 11:13:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BDHme019858; Tue, 5 May 2015 11:13:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051113.t45BDHme019858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282480 - in head/sys: arm64/arm64 dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 11:13:17 -0000 Author: andrew Date: Tue May 5 11:13:16 2015 New Revision: 282480 URL: https://svnweb.freebsd.org/changeset/base/282480 Log: Move the point we attach the ofw driver on arm64 to nexus.c. This will allow us to have a single place to decide to use ofw or acpi. Modified: head/sys/arm64/arm64/nexus.c head/sys/dev/ofw/ofwbus.c Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Tue May 5 11:12:33 2015 (r282479) +++ head/sys/arm64/arm64/nexus.c Tue May 5 11:13:16 2015 (r282480) @@ -148,6 +148,10 @@ nexus_attach(device_t dev) if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) panic("nexus_probe mem_rman"); + /* Add the ofwbus device */ + /* ARM64TODO: Alternatively add acpi */ + nexus_add_child(dev, 10, "ofwbus", 0); + /* * First, deal with the children we know about already */ Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Tue May 5 11:12:33 2015 (r282479) +++ head/sys/dev/ofw/ofwbus.c Tue May 5 11:13:16 2015 (r282480) @@ -69,7 +69,9 @@ struct ofwbus_softc { struct rman sc_mem_rman; }; +#ifndef __aarch64__ static device_identify_t ofwbus_identify; +#endif static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; @@ -78,7 +80,9 @@ static bus_release_resource_t ofwbus_rel static device_method_t ofwbus_methods[] = { /* Device interface */ +#ifndef __aarch64__ DEVMETHOD(device_identify, ofwbus_identify), +#endif DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), @@ -97,6 +101,7 @@ EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbu BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); +#ifndef __aarch64__ static void ofwbus_identify(driver_t *driver, device_t parent) { @@ -108,11 +113,17 @@ ofwbus_identify(driver_t *driver, device if (device_find_child(parent, "ofwbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "ofwbus", -1); } +#endif static int ofwbus_probe(device_t dev) { +#ifdef __aarch64__ + if (OF_peer(0) == 0) + return (ENXIO); +#endif + device_set_desc(dev, "Open Firmware Device Tree"); return (BUS_PROBE_NOWILDCARD); } From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:39:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 328FA26D; Tue, 5 May 2015 11:39:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 212CF151E; Tue, 5 May 2015 11:39:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45BdsWN031233; Tue, 5 May 2015 11:39:54 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BdsxC031232; Tue, 5 May 2015 11:39:54 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201505051139.t45BdsxC031232@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Tue, 5 May 2015 11:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282481 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 11:39:55 -0000 Author: osa (ports committer) Date: Tue May 5 11:39:54 2015 New Revision: 282481 URL: https://svnweb.freebsd.org/changeset/base/282481 Log: Add "The Design and Implementation of the FreeBSD OS, 2nd Ed.". Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue May 5 11:13:16 2015 (r282480) +++ head/share/misc/bsd-family-tree Tue May 5 11:39:54 2015 (r282481) @@ -691,6 +691,10 @@ McKusick, Marshall Kirk, George Neville- Implementation of the FreeBSD Operating System. Addison-Wesley Professional, Published: Aug 2, 2004. ISBN 0-201-70245-2 +McKusick, Marshall Kirk, George Neville-Neil, Robert Watson. The +Design and Implementation of the FreeBSD Operating System, 2nd Edition. +Pearson Education, Inc., 2014. ISBN 0-321-96897-2 + Doug McIlroy. Research Unix Reader. Michael G. Brown. The Role of BSD in the Development of Unix. From owner-svn-src-all@FreeBSD.ORG Tue May 5 13:23:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A53A1BF5; Tue, 5 May 2015 13:23: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 793BF11F5; Tue, 5 May 2015 13:23: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 t45DN43i084102; Tue, 5 May 2015 13:23:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45DN487084101; Tue, 5 May 2015 13:23:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201505051323.t45DN487084101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 5 May 2015 13:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282482 - head/bin/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 13:23:04 -0000 Author: jilles Date: Tue May 5 13:23:03 2015 New Revision: 282482 URL: https://svnweb.freebsd.org/changeset/base/282482 Log: cp: Remove fts sorting. In an attempt to improve performance, cp reordered directories first (although the comment says directories last). This is not effective with new UFS layout policies. The sorting reorders multiple arguments passed to cp, which may be undesirable. Additionally, the comparison function does not induce a total order. Per POSIX, this causes undefined behaviour in qsort(). NetBSD removed the sorting in 2009. On filesystems that return directory entries in hash/btree order, sorting by d_fileno before statting improves performance on large directories. However, this can only be implemented in fts(3). PR: 53475 Reviewed by: bde (in 2004) MFC after: 1 week Modified: head/bin/cp/cp.c Modified: head/bin/cp/cp.c ============================================================================== --- head/bin/cp/cp.c Tue May 5 11:39:54 2015 (r282481) +++ head/bin/cp/cp.c Tue May 5 13:23:03 2015 (r282482) @@ -90,7 +90,6 @@ volatile sig_atomic_t info; enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); -static int mastercmp(const FTSENT * const *, const FTSENT * const *); static void siginfo(int __unused); int @@ -274,7 +273,7 @@ copy(char *argv[], enum op type, int fts mask = ~umask(0777); umask(~mask); - if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL) + if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL) err(1, "fts_open"); for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) { switch (curr->fts_info) { @@ -488,32 +487,6 @@ copy(char *argv[], enum op type, int fts return (rval); } -/* - * mastercmp -- - * The comparison function for the copy order. The order is to copy - * non-directory files before directory files. The reason for this - * is because files tend to be in the same cylinder group as their - * parent directory, whereas directories tend not to be. Copying the - * files first reduces seeking. - */ -static int -mastercmp(const FTSENT * const *a, const FTSENT * const *b) -{ - int a_info, b_info; - - a_info = (*a)->fts_info; - if (a_info == FTS_ERR || a_info == FTS_NS || a_info == FTS_DNR) - return (0); - b_info = (*b)->fts_info; - if (b_info == FTS_ERR || b_info == FTS_NS || b_info == FTS_DNR) - return (0); - if (a_info == FTS_D) - return (-1); - if (b_info == FTS_D) - return (1); - return (0); -} - static void siginfo(int sig __unused) { From owner-svn-src-all@FreeBSD.ORG Tue May 5 14:17:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3101093C; Tue, 5 May 2015 14:17: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 1F15C194F; Tue, 5 May 2015 14:17: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 t45EHFLM008870; Tue, 5 May 2015 14:17:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45EHFRe008869; Tue, 5 May 2015 14:17:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051417.t45EHFRe008869@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 14:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282483 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:17:16 -0000 Author: andrew Date: Tue May 5 14:17:15 2015 New Revision: 282483 URL: https://svnweb.freebsd.org/changeset/base/282483 Log: Update the comment on what CPUs this driver supports. Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Tue May 5 13:23:03 2015 (r282482) +++ head/sys/arm/arm/generic_timer.c Tue May 5 14:17:15 2015 (r282483) @@ -31,7 +31,7 @@ */ /** - * Cortex-A15 (and probably A7) Generic Timer + * Cortex-A7, Cortex-A15, ARMv8 and later Generic Timer */ #include From owner-svn-src-all@FreeBSD.ORG Tue May 5 14:19:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 699B6AB8; Tue, 5 May 2015 14:19: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 581161969; Tue, 5 May 2015 14:19: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 t45EJNKR009157; Tue, 5 May 2015 14:19:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45EJNJ9009156; Tue, 5 May 2015 14:19:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051419.t45EJNJ9009156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 14:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282484 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:19:23 -0000 Author: andrew Date: Tue May 5 14:19:22 2015 New Revision: 282484 URL: https://svnweb.freebsd.org/changeset/base/282484 Log: Add DEV_ACPI to opt_acpi.h to be used to detect when ACPI is enabled in the kernel. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 5 14:17:15 2015 (r282483) +++ head/sys/conf/options Tue May 5 14:19:22 2015 (r282484) @@ -692,6 +692,7 @@ ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h ACPI_DMAR opt_acpi.h +DEV_ACPI opt_acpi.h # ISA support DEV_ISA opt_isa.h From owner-svn-src-all@FreeBSD.ORG Tue May 5 14:34:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9846ADCD; Tue, 5 May 2015 14:34:12 +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 72FAB1B41; Tue, 5 May 2015 14:34:12 +0000 (UTC) Received: from dhcp-10-2-210-36.hudson-trading.com (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BB3EBB953; Tue, 5 May 2015 10:34:10 -0400 (EDT) Message-ID: <5548D4E4.7070600@FreeBSD.org> Date: Tue, 05 May 2015 10:34:12 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282480 - in head/sys: arm64/arm64 dev/ofw References: <201505051113.t45BDHme019858@svn.freebsd.org> In-Reply-To: <201505051113.t45BDHme019858@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 May 2015 10:34:10 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 14:34:12 -0000 On 5/5/15 7:13 AM, Andrew Turner wrote: > Author: andrew > Date: Tue May 5 11:13:16 2015 > New Revision: 282480 > URL: https://svnweb.freebsd.org/changeset/base/282480 > > Log: > Move the point we attach the ofw driver on arm64 to nexus.c. This will > allow us to have a single place to decide to use ofw or acpi. > > Modified: > head/sys/arm64/arm64/nexus.c > head/sys/dev/ofw/ofwbus.c x86 does this by having an ACPI-specific nexus(4). It checks for ACPI in its nexus_probe() routine and if found returns a higher probe value than the default nexus. The ACPI nexus adds acpi0 whereas the default nexus adds legacy0. For x86 this allowed us to also do other things based on ACPI or not via bus attachments (so pre-ACPI versions of things like PCI interrupt routing, or non-ACPI CPU devices for cpufreq would hang off of legacy0 rather than having to do explicit runtime checks for ACPI). Xen makes use of this to add its own nexus for PVH that overrides the normal ACPI nexus even when ACPI is present, so this approach can work well if you have multiple types of "platforms" you want to support without the various platforms having to be aware of each other (e.g. the PNPBIOS bits don't have to explicitly check for ACPI to disable themselves, instead the PNPBIOS stuff only runs on legacy0). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue May 5 14:52:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63A98330; Tue, 5 May 2015 14:52: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 448B61D8C; Tue, 5 May 2015 14:52: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 t45EqZDF027619; Tue, 5 May 2015 14:52:35 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45EqXXv027613; Tue, 5 May 2015 14:52:33 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201505051452.t45EqXXv027613@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Tue, 5 May 2015 14:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282485 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 14:52:35 -0000 Author: julian Date: Tue May 5 14:52:33 2015 New Revision: 282485 URL: https://svnweb.freebsd.org/changeset/base/282485 Log: Tweak seekdir, telldir and readdir so that when htere are deletes going on, as seek to teh last location saved will still work. This is needed for Samba to be able to correctly handle delete requests from windows. This does not completely fix seekdir when deletes are present but fixes the worst of the problems. The real solution must involve some changes to the API for eh VFS and getdirentries(2). Obtained from: Panzura inc MFC after: 1 week Modified: head/lib/libc/gen/directory.3 head/lib/libc/gen/readdir.c head/lib/libc/gen/rewinddir.c head/lib/libc/gen/telldir.c head/lib/libc/gen/telldir.h Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/directory.3 Tue May 5 14:52:33 2015 (r282485) @@ -267,4 +267,27 @@ The invalidation of .Fn telldir tokens when calling .Fn seekdir -is non-standard. +is non-standard. This is a compile time option. +.Pp +The behaviour of +.Fn telldir +and +.Fn seekdir +is likely to be wrong if there are parallel unlinks happening +and the directory is larger than one page. +There is code to ensure that a +.Fn seekdir +to the location given by a +.Fn telldir +immediately before the last +.Fn readdir +will always set the correct location to return the same value as that last +.Fn readdir +performed. +This is enough for some applications which want to "push back the last entry read" E.g. Samba. +Seeks back to any other location, +other than the beginning of the directory, +may result in unexpected behaviour if deletes are present. +It is hoped that this situation will be resolved with changes to +.Fn getdirentries +and the VFS. Modified: head/lib/libc/gen/readdir.c ============================================================================== --- head/lib/libc/gen/readdir.c Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/readdir.c Tue May 5 14:52:33 2015 (r282485) @@ -54,19 +54,25 @@ _readdir_unlocked(dirp, skip) int skip; { struct dirent *dp; + long initial_seek; + long initial_loc = 0; for (;;) { if (dirp->dd_loc >= dirp->dd_size) { if (dirp->dd_flags & __DTF_READALL) return (NULL); + initial_loc = dirp->dd_loc; + dirp->dd_flags &= ~__DTF_SKIPREAD; dirp->dd_loc = 0; } if (dirp->dd_loc == 0 && !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { + initial_seek = dirp->dd_seek; dirp->dd_size = _getdirentries(dirp->dd_fd, dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); if (dirp->dd_size <= 0) return (NULL); + _fixtelldir(dirp, initial_seek, initial_loc); } dirp->dd_flags &= ~__DTF_SKIPREAD; dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); Modified: head/lib/libc/gen/rewinddir.c ============================================================================== --- head/lib/libc/gen/rewinddir.c Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/rewinddir.c Tue May 5 14:52:33 2015 (r282485) @@ -51,6 +51,7 @@ rewinddir(dirp) if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ if (dirp->dd_flags & __DTF_READALL) _filldir(dirp, false); else { Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/telldir.c Tue May 5 14:52:33 2015 (r282485) @@ -101,9 +101,21 @@ _seekdir(dirp, loc) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) return; + /* If it's within the same chunk of data, don't bother reloading */ + if (lp->loc_seek == dirp->dd_seek) { + /* + * If we go back to 0 don't make the next readdir + * trigger a call to getdirentries() + */ + if (lp->loc_loc == 0) + dirp->dd_flags |= __DTF_SKIPREAD; + dirp->dd_loc = lp->loc_loc; + return; + } (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); dirp->dd_seek = lp->loc_seek; dirp->dd_loc = 0; + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid */ while (dirp->dd_loc < lp->loc_loc) { dp = _readdir_unlocked(dirp, 0); if (dp == NULL) @@ -112,6 +124,27 @@ _seekdir(dirp, loc) } /* + * when we do a read and cross a boundary, any telldir we + * just did will have wrong information in it. + * We need to move it from "beyond the end of the previous chunk" + * to "the beginning of the new chunk" + */ +void +_fixtelldir(DIR *dirp, long oldseek, long oldloc) +{ + struct ddloc *lp; + + lp = LIST_FIRST(&dirp->dd_td->td_locq); + if (lp != NULL) { + if (lp->loc_loc == oldloc && + lp->loc_seek == oldseek) { + lp->loc_seek = dirp->dd_seek; + lp->loc_loc = dirp->dd_loc; + } + } +} + +/* * Reclaim memory for telldir cookies which weren't used. */ void Modified: head/lib/libc/gen/telldir.h ============================================================================== --- head/lib/libc/gen/telldir.h Tue May 5 14:19:22 2015 (r282484) +++ head/lib/libc/gen/telldir.h Tue May 5 14:52:33 2015 (r282485) @@ -64,5 +64,6 @@ bool _filldir(DIR *, bool); struct dirent *_readdir_unlocked(DIR *, int); void _reclaim_telldir(DIR *); void _seekdir(DIR *, long); +void _fixtelldir(DIR *dirp, long oldseek, long oldloc); #endif From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:14:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D2906B9; Tue, 5 May 2015 15:14: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 8AB8A1FAE; Tue, 5 May 2015 15:14: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 t45FE0oo037457; Tue, 5 May 2015 15:14:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FE0cD037452; Tue, 5 May 2015 15:14:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201505051514.t45FE0cD037452@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 5 May 2015 15:14: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: r282486 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:14:00 -0000 Author: np Date: Tue May 5 15:13:59 2015 New Revision: 282486 URL: https://svnweb.freebsd.org/changeset/base/282486 Log: Backport some parts of r272200. - a lock to protect indirect register access - put code that deals with stats in a separate cxgbe_refresh_stats. This is a direct commit to stable/10. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/t4_main.c Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Tue May 5 14:52:33 2015 (r282485) +++ stable/10/sys/dev/cxgbe/adapter.h Tue May 5 15:13:59 2015 (r282486) @@ -263,7 +263,9 @@ struct port_info { int linkdnrc; struct link_config link_cfg; - struct port_stats stats; + + struct timeval last_refreshed; + struct port_stats stats; eventhandler_tag vlan_c; @@ -786,6 +788,8 @@ struct adapter { TAILQ_HEAD(, sge_fl) sfl; struct callout sfl_callout; + struct mtx regwin_lock; /* for indirect reads and memory windows */ + an_handler_t an_handler __aligned(CACHE_LINE_SIZE); fw_msg_handler_t fw_msg_handler[5]; /* NUM_FW6_TYPES */ cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Tue May 5 14:52:33 2015 (r282485) +++ stable/10/sys/dev/cxgbe/t4_main.c Tue May 5 15:13:59 2015 (r282486) @@ -386,6 +386,7 @@ static int t4_free_irq(struct adapter *, static void reg_block_dump(struct adapter *, uint8_t *, unsigned int, unsigned int); static void t4_get_regs(struct adapter *, struct t4_regdump *, uint8_t *); +static void cxgbe_refresh_stats(struct adapter *, struct port_info *); static void cxgbe_tick(void *); static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static int cpl_not_handled(struct sge_iq *, const struct rss_header *, @@ -611,6 +612,8 @@ t4_attach(device_t dev) TAILQ_INIT(&sc->sfl); callout_init(&sc->sfl_callout, CALLOUT_MPSAFE); + mtx_init(&sc->regwin_lock, "register and memory window", 0, MTX_DEF); + rc = map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1011,6 +1014,8 @@ t4_detach(device_t dev) mtx_destroy(&sc->sfl_lock); if (mtx_initialized(&sc->ifp_lock)) mtx_destroy(&sc->ifp_lock); + if (mtx_initialized(&sc->regwin_lock)) + mtx_destroy(&sc->regwin_lock); bzero(sc, sizeof(*sc)); @@ -4243,20 +4248,19 @@ t4_get_regs(struct adapter *sc, struct t } static void -cxgbe_tick(void *arg) +cxgbe_refresh_stats(struct adapter *sc, struct port_info *pi) { - struct port_info *pi = arg; - struct adapter *sc = pi->adapter; struct ifnet *ifp = pi->ifp; struct sge_txq *txq; int i, drops; struct port_stats *s = &pi->stats; + struct timeval tv; + const struct timeval interval = {0, 250000}; /* 250ms */ - PORT_LOCK(pi); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - PORT_UNLOCK(pi); - return; /* without scheduling another callout */ - } + getmicrotime(&tv); + timevalsub(&tv, &interval); + if (timevalcmp(&tv, &pi->last_refreshed, <)) + return; t4_get_port_stats(sc, pi->tx_chan, s); @@ -4269,16 +4273,14 @@ cxgbe_tick(void *arg) ifp->if_iqdrops = s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 + s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 + s->rx_trunc3; - for (i = 0; i < 4; i++) { + for (i = 0; i < NCHAN; i++) { if (pi->rx_chan_map & (1 << i)) { uint32_t v; - /* - * XXX: indirect reads from the same ADDR/DATA pair can - * race with each other. - */ + mtx_lock(&sc->regwin_lock); t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, 1, A_TP_MIB_TNL_CNG_DROP_0 + i); + mtx_unlock(&sc->regwin_lock); ifp->if_iqdrops += v; } } @@ -4292,6 +4294,24 @@ cxgbe_tick(void *arg) ifp->if_ierrors = s->rx_jabber + s->rx_runt + s->rx_too_long + s->rx_fcs_err + s->rx_len_err; + getmicrotime(&pi->last_refreshed); +} + +static void +cxgbe_tick(void *arg) +{ + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; + struct ifnet *ifp = pi->ifp; + + PORT_LOCK(pi); + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + PORT_UNLOCK(pi); + return; /* without scheduling another callout */ + } + + cxgbe_refresh_stats(sc, pi); + callout_schedule(&pi->tick, hz); PORT_UNLOCK(pi); } From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CF0B842; Tue, 5 May 2015 15:16: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 3B3DF1FD1; Tue, 5 May 2015 15:16: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 t45FG1ZS037882; Tue, 5 May 2015 15:16:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG1FF037881; Tue, 5 May 2015 15:16:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG1FF037881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282487 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:01 -0000 Author: gjb Date: Tue May 5 15:16:00 2015 New Revision: 282487 URL: https://svnweb.freebsd.org/changeset/base/282487 Log: Fix a typo. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:13:59 2015 (r282486) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:00 2015 (r282487) @@ -423,7 +423,7 @@ updated to version 20150410. The &man.wpa.supplicant.8; and - &man.hostapd.8; utilties have been updated to version + &man.hostapd.8; utilities have been updated to version 2.4. bmake has From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64CDDC44; Tue, 5 May 2015 15:16:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5325E1FDB; Tue, 5 May 2015 15:16:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FGBnn038085; Tue, 5 May 2015 15:16:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGBco038084; Tue, 5 May 2015 15:16:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGBco038084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282491 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:11 -0000 Author: gjb Date: Tue May 5 15:16:10 2015 New Revision: 282491 URL: https://svnweb.freebsd.org/changeset/base/282491 Log: Document r282274, xen(4) PV domU kernel support removed. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:08 2015 (r282490) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:10 2015 (r282491) @@ -948,6 +948,9 @@ fixes. + + Support for &man.xen.4; para-virtualized + domU kernels has been removed. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:04 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09EAC91F; Tue, 5 May 2015 15: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 EC6971FD2; Tue, 5 May 2015 15:16: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 t45FG3j1037938; Tue, 5 May 2015 15:16:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG3eB037935; Tue, 5 May 2015 15:16:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG3eB037935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282488 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:04 -0000 Author: gjb Date: Tue May 5 15:16:02 2015 New Revision: 282488 URL: https://svnweb.freebsd.org/changeset/base/282488 Log: Document r282208, chmod(1), chflags(1), chgrp(1), and chown(8) now affect symbolic links when '-R' is used. Add Multiplay to sponsors.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:00 2015 (r282487) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:02 2015 (r282488) @@ -334,6 +334,12 @@ ARCHIVE_EXTRACT_SECURE_NODOTDOT to disallow directory traversal when extracting an archive, similar to &man.tar.1;. + + The &man.chflags.1;, &man.chgrp.1;, + &man.chmod.1;, and &man.chown.8; utilities now affect symbolic + links when the -R flag is specified, as + documented in &man.symlink.7;. Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:00 2015 (r282487) +++ head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:02 2015 (r282488) @@ -31,6 +31,7 @@ + From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54760F0C; Tue, 5 May 2015 15:16: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 4337F1FE3; Tue, 5 May 2015 15:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FGKA5038294; Tue, 5 May 2015 15:16:20 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGK1G038293; Tue, 5 May 2015 15:16:20 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGK1G038293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282495 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:20 -0000 Author: gjb Date: Tue May 5 15:16:19 2015 New Revision: 282495 URL: https://svnweb.freebsd.org/changeset/base/282495 Log: Fix a FDP style nit. Wrap the lines as a result. Found with: textproc/igor Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:17 2015 (r282494) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:19 2015 (r282495) @@ -695,9 +695,9 @@ A new &man.sysctl.8;, kern.racct.enable, has been added, which when set to a non-zero value allows using - &man.rctl.8; with the GENERIC kernel. A new - kernel configuration option, RACCT_DISABLED - has also been added. + &man.rctl.8; with the GENERIC kernel. + A new kernel configuration option, + RACCT_DISABLED has also been added. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9610CD4; Tue, 5 May 2015 15:16: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 98BCC1FDD; Tue, 5 May 2015 15:16: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 t45FGDQH038148; Tue, 5 May 2015 15:16:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGDmq038147; Tue, 5 May 2015 15:16:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGDmq038147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282492 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:13 -0000 Author: gjb Date: Tue May 5 15:16:12 2015 New Revision: 282492 URL: https://svnweb.freebsd.org/changeset/base/282492 Log: Document r282434, openresolv updated to version 3.7.0. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:10 2015 (r282491) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:12 2015 (r282492) @@ -437,6 +437,10 @@ The &man.unbound.8; utility has been updated to version 1.5.3. + + The + &man.resolvconf.8; utility has been updated to version + 3.7.0. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:07 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 009F9A5A; Tue, 5 May 2015 15:16:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB941FD3; Tue, 5 May 2015 15:16:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FG6mw037990; Tue, 5 May 2015 15:16:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG6fP037988; Tue, 5 May 2015 15:16:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG6fP037988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282489 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:07 -0000 Author: gjb Date: Tue May 5 15:16:05 2015 New Revision: 282489 URL: https://svnweb.freebsd.org/changeset/base/282489 Log: Document r282212, several improvements/updates to the HyperV drivers. Add Microsoft OSTC to sponsors.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:02 2015 (r282488) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:05 2015 (r282489) @@ -920,6 +920,27 @@ Support for the QEMU virt system has been added. + + The + HyperV™ drivers have been updated with several + enhancements: + + + + The &man.hv.vmbus.4; driver now has multi-channel + support. + + + + The &man.hv.storvsc.4; driver now has scatter/gather + support, in addition to performance improvements. + + + + The &man.hv.kvp.4; driver has received several bug + fixes. + + Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:02 2015 (r282488) +++ head/release/doc/share/xml/sponsor.ent Tue May 5 15:16:05 2015 (r282489) @@ -30,6 +30,7 @@ + From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF9EB38; Tue, 5 May 2015 15: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 0ECB61FD9; Tue, 5 May 2015 15: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 t45FG8LG038034; Tue, 5 May 2015 15:16:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FG8ZU038033; Tue, 5 May 2015 15:16:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FG8ZU038033@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282490 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:09 -0000 Author: gjb Date: Tue May 5 15:16:08 2015 New Revision: 282490 URL: https://svnweb.freebsd.org/changeset/base/282490 Log: Document r282213, kern.racct.enable tunable and RACCT_DISABLED kernel configuration option. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:05 2015 (r282489) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:08 2015 (r282490) @@ -687,6 +687,13 @@ vfs.devfs.dotimes has been added, which when set to a non-zero value, enables default precision timestamps for these operations. + + A new + &man.sysctl.8;, kern.racct.enable, has been + added, which when set to a non-zero value allows using + &man.rctl.8; with the GENERIC kernel. A new + kernel configuration option, RACCT_DISABLED + has also been added. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AB0CD78; Tue, 5 May 2015 15:16: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 D89EC1FDF; Tue, 5 May 2015 15:16: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 t45FGFVu038207; Tue, 5 May 2015 15:16:15 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGFbR038206; Tue, 5 May 2015 15:16:15 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGFbR038206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282493 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:16 -0000 Author: gjb Date: Tue May 5 15:16:15 2015 New Revision: 282493 URL: https://svnweb.freebsd.org/changeset/base/282493 Log: Update the svn revision marker. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:12 2015 (r282492) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:15 2015 (r282493) @@ -22,7 +22,7 @@ $FreeBSD$ - + 2015 From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBB7E94; Tue, 5 May 2015 15:16: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 F2A341FE0; Tue, 5 May 2015 15:16:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FGHKe038253; Tue, 5 May 2015 15:16:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGH4u038252; Tue, 5 May 2015 15:16:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGH4u038252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282494 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:18 -0000 Author: gjb Date: Tue May 5 15:16:17 2015 New Revision: 282494 URL: https://svnweb.freebsd.org/changeset/base/282494 Log: Document r281802, support added for building FreeBSD/aarch64 virtual machine and memory stick images. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:15 2015 (r282493) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:17 2015 (r282494) @@ -1216,6 +1216,11 @@ been updated to use multi-threaded &man.xz.1;. By default, the number of &man.xz.1; threads is set to the number of cores available. + + The + Release Engineering build tools have been updated to include + support for building &os;/&arch.arm64; virtual machine and + memory stick installation images. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4900F97; Tue, 5 May 2015 15:16:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 847D11FE5; Tue, 5 May 2015 15:16:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FGM4u038346; Tue, 5 May 2015 15:16:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGMoY038344; Tue, 5 May 2015 15:16:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGMoY038344@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282496 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:22 -0000 Author: gjb Date: Tue May 5 15:16:21 2015 New Revision: 282496 URL: https://svnweb.freebsd.org/changeset/base/282496 Log: Document r281617, wc(1) race when receiving SIGINFO fixed. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:19 2015 (r282495) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:21 2015 (r282496) @@ -340,6 +340,11 @@ &man.chmod.1;, and &man.chown.8; utilities now affect symbolic links when the -R flag is specified, as documented in &man.symlink.7;. + + A race condition in &man.wc.1; that + would cause final results to be sent to &man.stderr.4; when + receiving the SIGINFO signal has been + fixed. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:16:39 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A101F535; Tue, 5 May 2015 15:16: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 8EF041FF0; Tue, 5 May 2015 15:16:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45FGd0P038462; Tue, 5 May 2015 15:16:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FGdZ9038461; Tue, 5 May 2015 15:16:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051516.t45FGdZ9038461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:16: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: r282497 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:16:39 -0000 Author: gjb Date: Tue May 5 15:16:38 2015 New Revision: 282497 URL: https://svnweb.freebsd.org/changeset/base/282497 Log: Document r282278, wc(1) race when receiving SIGINFO fixed. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:21 2015 (r282496) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:38 2015 (r282497) @@ -199,6 +199,11 @@ ARCHIVE_EXTRACT_SECURE_NODOTDOT to disallow directory traversal when extracting an archive, similar to &man.tar.1;. + + A race condition in &man.wc.1; that + would cause final results to be sent to &man.stderr.4; when + receiving the SIGINFO signal has been + fixed. From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:43:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B9FEA2B; Tue, 5 May 2015 15:43:59 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C51A3131D; Tue, 5 May 2015 15:43:58 +0000 (UTC) Received: by widdi4 with SMTP id di4so151905632wid.0; Tue, 05 May 2015 08:43:57 -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=q9Cjm4G+e5LEweQ9mC0A9dJamU7dszszRt8lxonJ2Yw=; b=W5nbHhLa+JoUGOBbRkSOWgXItQ6KZhhLi9ztl9IphUhocMlOaOqT9IG0UJOE2l0YRK F880uDul/kpDzcVwKLxJeNs44EzSTYYDApIg93zJzyUWPXKaOA8ieJtHlJC1Ro24rpfT WRQf1B7f4aaDXoo3FfRQvg6ppH4TFYYNCQfYemex3J84py/JoHU2qoN8GmcJUANxj/bJ apEPwGepqPn8lcQ+KktQ6TIcebnZDDtxpkgKxbuDVLL5wWSMj2nabB9K6Go5Vp7VmD2i tVTZFWzR5HTeXlyzT5q+dCA+XAN5XIyy/LZJbjCbNuGVXAD7MZ/wNEHPx5H3tnNP5HEG 2KtA== MIME-Version: 1.0 X-Received: by 10.180.231.4 with SMTP id tc4mr5299971wic.27.1430840637188; Tue, 05 May 2015 08:43:57 -0700 (PDT) Received: by 10.27.77.201 with HTTP; Tue, 5 May 2015 08:43:56 -0700 (PDT) In-Reply-To: <201505051452.t45EqXXv027613@svn.freebsd.org> References: <201505051452.t45EqXXv027613@svn.freebsd.org> Date: Tue, 5 May 2015 11:43:56 -0400 Message-ID: Subject: Re: svn commit: r282485 - head/lib/libc/gen From: Benjamin Kaduk To: Julian Elischer Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 15:43:59 -0000 On Tue, May 5, 2015 at 10:52 AM, Julian Elischer wrote: > Author: julian > Date: Tue May 5 14:52:33 2015 > New Revision: 282485 > URL: https://svnweb.freebsd.org/changeset/base/282485 > > Log: > Tweak seekdir, telldir and readdir so that when htere are deletes going > on, > as seek to teh last location saved will still work. This is needed for > Samba > to be able to correctly handle delete requests from windows. This does > not > completely fix seekdir when deletes are present but fixes the worst of > the > problems. The real solution must involve some changes to the API for eh > VFS > and getdirentries(2). > > Would it be so hard to run a spell-checker over commit messages? "teh" is not a word, nor is "htere", and "eh" only is if you're in Canada or Minnesota (not that it's the right word there anyway). > Obtained from: Panzura inc > MFC after: 1 week > > Modified: > head/lib/libc/gen/directory.3 > head/lib/libc/gen/readdir.c > head/lib/libc/gen/rewinddir.c > head/lib/libc/gen/telldir.c > head/lib/libc/gen/telldir.h > > Modified: head/lib/libc/gen/directory.3 > > ============================================================================== > --- head/lib/libc/gen/directory.3 Tue May 5 14:19:22 2015 > (r282484) > +++ head/lib/libc/gen/directory.3 Tue May 5 14:52:33 2015 > (r282485) > @@ -267,4 +267,27 @@ The invalidation of > .Fn telldir > tokens when calling > .Fn seekdir > -is non-standard. > +is non-standard. This is a compile time option. > Man page style puts the start of new sentences on a new line. > +.Pp > +The behaviour of > +.Fn telldir > +and > +.Fn seekdir > +is likely to be wrong if there are parallel unlinks happening > +and the directory is larger than one page. > +There is code to ensure that a > +.Fn seekdir > +to the location given by a > +.Fn telldir > +immediately before the last > +.Fn readdir > +will always set the correct location to return the same value as that last > +.Fn readdir > +performed. > +This is enough for some applications which want to "push back the last > entry read" E.g. Samba. > "e.g." should be offset by commas on both sides, and the capital 'E' is only appropriate at the start of a sentence. > +Seeks back to any other location, > +other than the beginning of the directory, > +may result in unexpected behaviour if deletes are present. > "behaviour" is the British English; we use American unless an entire file is already in British. > +It is hoped that this situation will be resolved with changes to > +.Fn getdirentries > +and the VFS. > > This sort of thing is more appropriate for BUGS or CAVEATS, in my opinion. > Modified: head/lib/libc/gen/readdir.c > > ============================================================================== > --- head/lib/libc/gen/readdir.c Tue May 5 14:19:22 2015 (r282484) > +++ head/lib/libc/gen/readdir.c Tue May 5 14:52:33 2015 (r282485) > @@ -54,19 +54,25 @@ _readdir_unlocked(dirp, skip) > int skip; > { > struct dirent *dp; > + long initial_seek; > + long initial_loc = 0; > > for (;;) { > if (dirp->dd_loc >= dirp->dd_size) { > if (dirp->dd_flags & __DTF_READALL) > return (NULL); > + initial_loc = dirp->dd_loc; > + dirp->dd_flags &= ~__DTF_SKIPREAD; > dirp->dd_loc = 0; > } > if (dirp->dd_loc == 0 && > !(dirp->dd_flags & (__DTF_READALL | __DTF_SKIPREAD))) { > + initial_seek = dirp->dd_seek; > dirp->dd_size = _getdirentries(dirp->dd_fd, > dirp->dd_buf, dirp->dd_len, &dirp->dd_seek); > if (dirp->dd_size <= 0) > return (NULL); > + _fixtelldir(dirp, initial_seek, initial_loc); > } > dirp->dd_flags &= ~__DTF_SKIPREAD; > dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); > > Modified: head/lib/libc/gen/rewinddir.c > > ============================================================================== > --- head/lib/libc/gen/rewinddir.c Tue May 5 14:19:22 2015 > (r282484) > +++ head/lib/libc/gen/rewinddir.c Tue May 5 14:52:33 2015 > (r282485) > @@ -51,6 +51,7 @@ rewinddir(dirp) > > if (__isthreaded) > _pthread_mutex_lock(&dirp->dd_lock); > + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid > */ > if (dirp->dd_flags & __DTF_READALL) > _filldir(dirp, false); > else { > > Modified: head/lib/libc/gen/telldir.c > > ============================================================================== > --- head/lib/libc/gen/telldir.c Tue May 5 14:19:22 2015 (r282484) > +++ head/lib/libc/gen/telldir.c Tue May 5 14:52:33 2015 (r282485) > @@ -101,9 +101,21 @@ _seekdir(dirp, loc) > return; > if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) > return; > + /* If it's within the same chunk of data, don't bother reloading */ > No stop at the end of the sentence in the comment? > + if (lp->loc_seek == dirp->dd_seek) { > + /* > + * If we go back to 0 don't make the next readdir > + * trigger a call to getdirentries() > nor here > + */ > + if (lp->loc_loc == 0) > + dirp->dd_flags |= __DTF_SKIPREAD; > + dirp->dd_loc = lp->loc_loc; > + return; > + } > (void) lseek(dirp->dd_fd, (off_t)lp->loc_seek, SEEK_SET); > dirp->dd_seek = lp->loc_seek; > dirp->dd_loc = 0; > + dirp->dd_flags &= ~__DTF_SKIPREAD; /* current contents are invalid > */ > while (dirp->dd_loc < lp->loc_loc) { > dp = _readdir_unlocked(dirp, 0); > if (dp == NULL) > @@ -112,6 +124,27 @@ _seekdir(dirp, loc) > } > > /* > + * when we do a read and cross a boundary, any telldir we > + * just did will have wrong information in it. > No capital letter at start of sentence. Strange line wrapping (in lieu of proper paragraph break with empty line?). -Ben > + * We need to move it from "beyond the end of the previous chunk" > + * to "the beginning of the new chunk" > + */ > +void > +_fixtelldir(DIR *dirp, long oldseek, long oldloc) > +{ > + struct ddloc *lp; > + > + lp = LIST_FIRST(&dirp->dd_td->td_locq); > + if (lp != NULL) { > + if (lp->loc_loc == oldloc && > + lp->loc_seek == oldseek) { > + lp->loc_seek = dirp->dd_seek; > + lp->loc_loc = dirp->dd_loc; > + } > + } > +} > + > +/* > * Reclaim memory for telldir cookies which weren't used. > */ > void > > Modified: head/lib/libc/gen/telldir.h > > ============================================================================== > --- head/lib/libc/gen/telldir.h Tue May 5 14:19:22 2015 (r282484) > +++ head/lib/libc/gen/telldir.h Tue May 5 14:52:33 2015 (r282485) > @@ -64,5 +64,6 @@ bool _filldir(DIR *, bool); > struct dirent *_readdir_unlocked(DIR *, int); > void _reclaim_telldir(DIR *); > void _seekdir(DIR *, long); > +void _fixtelldir(DIR *dirp, long oldseek, long oldloc); > > #endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Tue May 5 15:48:26 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CF50C4E; Tue, 5 May 2015 15:48: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 8AE401343; Tue, 5 May 2015 15:48: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 t45FmQFI053118; Tue, 5 May 2015 15:48:26 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45FmQKn053117; Tue, 5 May 2015 15:48:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051548.t45FmQKn053117@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 15:48: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: r282498 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 15:48:26 -0000 Author: gjb Date: Tue May 5 15:48:25 2015 New Revision: 282498 URL: https://svnweb.freebsd.org/changeset/base/282498 Log: Update the last svn rev marker. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:16:38 2015 (r282497) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 5 15:48:25 2015 (r282498) @@ -22,7 +22,7 @@ $FreeBSD$ - + 2015 From owner-svn-src-all@FreeBSD.ORG Tue May 5 16:09:40 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 447B5115; Tue, 5 May 2015 16: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 3288C161C; Tue, 5 May 2015 16: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 t45G9eOX063050; Tue, 5 May 2015 16:09:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45G9QVa062972; Tue, 5 May 2015 16:09:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505051609.t45G9QVa062972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 May 2015 16:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282499 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 16:09:40 -0000 Author: ian Date: Tue May 5 16:09:25 2015 New Revision: 282499 URL: https://svnweb.freebsd.org/changeset/base/282499 Log: Create std.arm and std.armv6 config files and include the right one from each of the existing kernel configs. This gives a place to put config that applies to the entire arch. Add the ARM_NEW_PMAP option to std.armv6. This is working well in early testing and it's time for wide exposure, but it's still nice to be able to fall back to the old implementation for testing when a problem comes along. Eventually the option and the old implementation will go away. The opportunity now exists to move a whole lot of boilerplate from all the arm kernel config files into std.arm*, but that's a commit for another day. Added: head/sys/arm/conf/std.arm (contents, props changed) head/sys/arm/conf/std.armv6 (contents, props changed) Modified: head/sys/arm/conf/AML8726 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EP80219 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RK3188 head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/SOCKIT.common head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VIRT head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/AML8726 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,8 @@ # $FreeBSD$ ident AML8726 + +include "std.armv6" include "../amlogic/aml8726/std.aml8726" options HZ=100 Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ARMADAXP Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,8 @@ # $FreeBSD$ ident MV-88F78XX0 + +include "std.armv6" include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ATMEL Tue May 5 16:09:25 2015 (r282499) @@ -6,6 +6,7 @@ ident ATMEL +include "std.arm" include "../at91/std.atmel" # Typical values for most SoCs and board configurations. Will not work for Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/AVILA Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident AVILA +include "std.arm" include "../xscale/ixp425/std.ixp425" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/BEAGLEBONE Tue May 5 16:09:25 2015 (r282499) @@ -23,6 +23,7 @@ ident BEAGLEBONE +include "std.armv6" include "../ti/am335x/std.am335x" makeoptions MODULES_EXTRA="dtb/am335x" @@ -67,7 +68,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/BWCT Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident BWCT +include "std.arm" options VERBOSE_INIT_ARM include "../at91/std.bwct" Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CAMBRIA Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident CAMBRIA +include "std.arm" include "../xscale/ixp425/std.ixp435" # NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CNS11XXNAS Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident CNS11XXNAS +include "std.arm" #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CRB Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident CRB +include "std.arm" options PHYSADDR=0x00000000 options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CUBIEBOARD Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident CUBIEBOARD +include "std.armv6" include "../allwinner/std.a10" options HZ=100 Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/CUBIEBOARD2 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident CUBIEBOARD2 +include "std.armv6" include "../allwinner/a20/std.a20" options HZ=100 Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DB-78XXX Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident DB-88F78XX +include "std.arm" include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DB-88F5XXX Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident DB-88F5XXX +include "std.arm" include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DB-88F6XXX Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident DB-88F6XXX +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DOCKSTAR Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident DOCKSTAR +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dockstar.dts Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/DREAMPLUG-1001 Tue May 5 16:09:25 2015 (r282499) @@ -24,6 +24,7 @@ ident DREAMPLUG-1001 +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dreamplug-1001.dts Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EA3250 Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident EA3250 +include "std.arm" include "../lpc/std.lpc" hints "EA3250.hints" Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EB9200 Tue May 5 16:09:25 2015 (r282499) @@ -16,6 +16,7 @@ ident EB9200 +include "std.arm" include "../at91/std.eb9200" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EFIKA_MX Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident EFIKA_MX +include "std.armv6" include "../freescale/imx/std.imx51" makeoptions WITHOUT_MODULES="ahc" Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EP80219 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident EP80219 +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ETHERNUT5 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident ETHERNUT5 +include "std.arm" include "../at91/std.ethernut5" # To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/EXYNOS5.common Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ makeoptions WERROR="-Werror" +include "std.armv6" options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/GUMSTIX Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ # $FreeBSD$ ident GUMSTIX +include "std.arm" cpu CPU_XSCALE_PXA2X0 # This probably wants to move somewhere else. Maybe we can create a basic Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/HL200 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident HL200 +include "std.arm" include "../at91/std.hl200" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/HL201 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident HL201 +include "std.arm" include "../at91/std.hl201" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/IMX53 Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident IMX53 +include "std.armv6" include "../freescale/imx/std.imx53" options SOC_IMX53 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/IMX6 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ # $FreeBSD$ ident IMX6 +include "std.armv6" include "../freescale/imx/std.imx6" options SOC_IMX6 Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/IQ31244 Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident IQ31244 +include "std.arm" options PHYSADDR=0xa0000000 options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/KB920X Tue May 5 16:09:25 2015 (r282499) @@ -22,6 +22,7 @@ ident KB920X +include "std.arm" include "../at91/std.kb920x" # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/LN2410SBC Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident LN2410SBC +include "std.arm" include "../samsung/s3c2xx0/std.ln2410sbc" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/NSLU Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident NSLU +include "std.arm" # XXX What is defined in std.avila does not exactly match the following: #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/PANDABOARD Tue May 5 16:09:25 2015 (r282499) @@ -27,6 +27,7 @@ ident PANDABOARD hints "PANDABOARD.hints" +include "std.armv6" include "../ti/omap4/pandaboard/std.pandaboard" options HZ=100 @@ -64,7 +65,6 @@ options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/QILA9G20 Tue May 5 16:09:25 2015 (r282499) @@ -22,6 +22,7 @@ ident QILA9G20 +include "std.arm" include "../at91/std.qila9g20" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/RK3188 Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident RK3188 +include "std.armv6" include "../rockchip/std.rk30xx" options HZ=100 Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/RPI-B Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident RPI-B +include "std.armv6" include "../broadcom/bcm2835/std.rpi" include "../broadcom/bcm2835/std.bcm2835" @@ -57,7 +58,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/RPI2 Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident RPI2 +include "std.armv6" include "../broadcom/bcm2835/std.rpi" include "../broadcom/bcm2835/std.bcm2836" @@ -57,7 +58,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SAM9260EK Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident SAM9260EK +include "std.arm" include "../at91/std.sam9260ek" # To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SAM9G20EK Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ ident SAM9G20EK +include "std.arm" include "../at91/std.sam9g20ek" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SAM9X25EK Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident SAM9X25EK +include "std.arm" include "../at91/std.sam9x25ek" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SHEEVAPLUG Tue May 5 16:09:25 2015 (r282499) @@ -6,6 +6,7 @@ #NO_UNIVERSE ident SHEEVAPLUG +include "std.arm" include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SN9G45 Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident SN9G45 +include "std.arm" include "../at91/std.sn9g45" #To statically compile in device wiring instead of /boot/device.hints Modified: head/sys/arm/conf/SOCKIT.common ============================================================================== --- head/sys/arm/conf/SOCKIT.common Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/SOCKIT.common Tue May 5 16:09:25 2015 (r282499) @@ -18,6 +18,7 @@ # # $FreeBSD$ +include "std.armv6" include "../altera/socfpga/std.socfpga" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/TS7800 Tue May 5 16:09:25 2015 (r282499) @@ -5,6 +5,7 @@ # ident TS7800 +include "std.arm" include "../mv/orion/std.ts7800" options SOC_MV_ORION Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/VERSATILEPB Tue May 5 16:09:25 2015 (r282499) @@ -22,6 +22,7 @@ ident VERSATILEPB machine arm armv6 cpu CPU_ARM1176 +include "std.armv6" files "../versatile/files.versatile" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/VIRT Tue May 5 16:09:25 2015 (r282499) @@ -20,6 +20,7 @@ ident VIRT +include "std.arm" include "../qemu/std.virt" options HZ=100 @@ -57,7 +58,6 @@ options KBD_INSTALL_CDEV # install a CD options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/VYBRID Tue May 5 16:09:25 2015 (r282499) @@ -19,6 +19,7 @@ # $FreeBSD$ ident VYBRID +include "std.armv6" include "../freescale/vybrid/std.vybrid" makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue May 5 15:48:25 2015 (r282498) +++ head/sys/arm/conf/ZEDBOARD Tue May 5 16:09:25 2015 (r282499) @@ -21,6 +21,7 @@ ident ZEDBOARD +include "std.armv6" include "../xilinx/zedboard/std.zedboard" options SCHED_ULE # ULE scheduler @@ -56,7 +57,6 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores -options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Added: head/sys/arm/conf/std.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/std.arm Tue May 5 16:09:25 2015 (r282499) @@ -0,0 +1,5 @@ +# Standard kernel config items for all ARMv4/v5 systems. +# +# $FreeBSD$ + + Added: head/sys/arm/conf/std.armv6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/std.armv6 Tue May 5 16:09:25 2015 (r282499) @@ -0,0 +1,6 @@ +# Standard kernel config items for all ARMv6/v7 systems. +# +# $FreeBSD$ + +options ARM_NEW_PMAP # Use new pmap code. + From owner-svn-src-all@FreeBSD.ORG Tue May 5 16:28:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D657ABF; Tue, 5 May 2015 16:28: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 1C7041901; Tue, 5 May 2015 16:28: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 t45GS5j4073054; Tue, 5 May 2015 16:28:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45GS5h9073051; Tue, 5 May 2015 16:28:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051628.t45GS5h9073051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 16:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282500 - in head/release: . arm tools/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 16:28:06 -0000 Author: gjb Date: Tue May 5 16:28:04 2015 New Revision: 282500 URL: https://svnweb.freebsd.org/changeset/base/282500 Log: Add initial support for building RPI2 images. In release.sh, allow overriding buildenv_setup() before the handoff to arm/release.sh. Copy arm/RPI-B.conf -> arm/RPI2.conf, set UBOOT_PORT and the correct KERNEL, and add the buildenv_setup() override to install the sysutils/u-boot-rpi2 port/package. Copy tools/arm/crochet-RPI-B.conf -> tools/arm/crochet-RPI2.conf, and set the correct entries for the RaspberryPi2 board. Thanks to: loos@ Sponsored by: The FreeBSD Foundation Added: head/release/arm/RPI2.conf - copied, changed from r282497, head/release/arm/RPI-B.conf head/release/tools/arm/crochet-RPI2.conf - copied, changed from r282497, head/release/tools/arm/crochet-RPI-B.conf Modified: head/release/release.sh Copied and modified: head/release/arm/RPI2.conf (from r282497, head/release/arm/RPI-B.conf) ============================================================================== --- head/release/arm/RPI-B.conf Tue May 5 15:16:38 2015 (r282497, copy source) +++ head/release/arm/RPI2.conf Tue May 5 16:28:04 2015 (r282500) @@ -13,7 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.nc export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 -export EMBEDDEDPORTS="lang/python textproc/gsed" +export UBOOT_PORT="sysutils/u-boot-rpi2" # Build chroot configuration load_chroot_env() { @@ -31,10 +31,23 @@ load_target_env() { export XDEV_ARCH="armv6" export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" - export KERNEL="RPI-B" + export KERNEL="RPI2" export CROCHETSRC="https://github.com/freebsd/crochet" export CROCHETBRANCH="trunk@rHEAD" - export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" - export UBOOTBRANCH="trunk" - export UBOOTDIR="/tmp/crochet/u-boot-rpi" } + +# Build environment setup +buildenv_setup() { + if [ ! -d ${CHROOTDIR}/usr/ports/${UBOOT_PORT} ]; then + chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg bootstrap -y + chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg install -y ${UBOOT_PORT} + else + chroot ${CHROOTDIR} env BATCH=1 \ + make -C /usr/ports/${UBOOT_PORT} \ + all install clean + fi + return 0 +} + Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Tue May 5 16:09:25 2015 (r282499) +++ head/release/release.sh Tue May 5 16:28:04 2015 (r282500) @@ -238,6 +238,7 @@ fi # Embedded builds do not use the 'make release' target. if [ -n "${EMBEDDEDBUILD}" ]; then + buildenv_setup # If a crochet configuration file exists in *this* checkout of # release/, copy it to the /tmp/external directory within the chroot. # This allows building embedded releases without relying on updated Copied and modified: head/release/tools/arm/crochet-RPI2.conf (from r282497, head/release/tools/arm/crochet-RPI-B.conf) ============================================================================== --- head/release/tools/arm/crochet-RPI-B.conf Tue May 5 15:16:38 2015 (r282497, copy source) +++ head/release/tools/arm/crochet-RPI2.conf Tue May 5 16:28:04 2015 (r282500) @@ -3,9 +3,9 @@ # # This is the configuration file for use with crochet to produce -# FreeBSD Raspberry Pi images. +# FreeBSD Raspberry Pi 2 images. -board_setup RaspberryPi +board_setup RaspberryPi2 option ImageSize 1gb option Growfs @@ -16,7 +16,7 @@ SRCCONF=/dev/null WORKDIR=/usr/obj _BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) _REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) -KERNCONF=RPI-B +KERNCONF=RPI2 TARGET=arm TARGET_ARCH=armv6 FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" From owner-svn-src-all@FreeBSD.ORG Tue May 5 16:38:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C23C8E16; Tue, 5 May 2015 16:38: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 B15E51A79; Tue, 5 May 2015 16:38: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 t45Gc00Z077948; Tue, 5 May 2015 16:38:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45Gc0da077947; Tue, 5 May 2015 16:38:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505051638.t45Gc0da077947@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 16:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282501 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 16:38:00 -0000 Author: gjb Date: Tue May 5 16:37:59 2015 New Revision: 282501 URL: https://svnweb.freebsd.org/changeset/base/282501 Log: Remove buildenv_setup(), and set EMBEDDEDPORTS to the sysutils/u-boot-rpi2 port, since these cases are already handled by arm/release.sh. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/RPI2.conf Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Tue May 5 16:28:04 2015 (r282500) +++ head/release/arm/RPI2.conf Tue May 5 16:37:59 2015 (r282501) @@ -13,7 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.nc export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 -export UBOOT_PORT="sysutils/u-boot-rpi2" +export EMBEDDEDPORTS="sysutils/u-boot-rpi2" # Build chroot configuration load_chroot_env() { @@ -36,18 +36,3 @@ load_target_env() { export CROCHETBRANCH="trunk@rHEAD" } -# Build environment setup -buildenv_setup() { - if [ ! -d ${CHROOTDIR}/usr/ports/${UBOOT_PORT} ]; then - chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg bootstrap -y - chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg install -y ${UBOOT_PORT} - else - chroot ${CHROOTDIR} env BATCH=1 \ - make -C /usr/ports/${UBOOT_PORT} \ - all install clean - fi - return 0 -} - From owner-svn-src-all@FreeBSD.ORG Tue May 5 17:59:08 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C2EF1F8; Tue, 5 May 2015 17:59:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39BDB1576; Tue, 5 May 2015 17:59:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45Hx8Jv017186; Tue, 5 May 2015 17:59:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45Hx3pp017160; Tue, 5 May 2015 17:59:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051759.t45Hx3pp017160@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 17:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282502 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 17:59:08 -0000 Author: andrew Date: Tue May 5 17:59:02 2015 New Revision: 282502 URL: https://svnweb.freebsd.org/changeset/base/282502 Log: Move the first batch of common armv6 options to std.armv6. Modified: head/sys/arm/conf/AML8726 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/PANDABOARD head/sys/arm/conf/RK3188 head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/arm/conf/SOCKIT.common head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD head/sys/arm/conf/std.armv6 Modified: head/sys/arm/conf/AML8726 ============================================================================== --- head/sys/arm/conf/AML8726 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/AML8726 Tue May 5 17:59:02 2015 (r282502) @@ -25,39 +25,8 @@ include "../amlogic/aml8726/std.aml8726 options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options LINUX_BOOT_ABI -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/ARMADAXP Tue May 5 17:59:02 2015 (r282502) @@ -28,36 +28,7 @@ options SOC_MV_ARMADAXP makeoptions WERROR="-Werror" options HZ=1000 -#options SCHED_ULE # ULE scheduler options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/BEAGLEBONE Tue May 5 17:59:02 2015 (r282502) @@ -36,38 +36,7 @@ makeoptions MODULES_EXTRA+="opensolaris options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/CUBIEBOARD Tue May 5 17:59:02 2015 (r282502) @@ -26,37 +26,6 @@ include "../allwinner/std.a10" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/CUBIEBOARD2 Tue May 5 17:59:02 2015 (r282502) @@ -26,37 +26,6 @@ include "../allwinner/a20/std.a20" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/EFIKA_MX Tue May 5 17:59:02 2015 (r282502) @@ -28,43 +28,13 @@ makeoptions WITHOUT_MODULES="ahc" options SOC_IMX51 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS #options MD_ROOT # MD is a potential root device -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 #options COMPAT_FREEBSD6 # Compatible with FreeBSD6 #options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/IMX53 Tue May 5 17:59:02 2015 (r282502) @@ -26,42 +26,12 @@ include "../freescale/imx/std.imx53" options SOC_IMX53 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 #options COMPAT_FREEBSD6 # Compatible with FreeBSD6 #options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/IMX6 Tue May 5 17:59:02 2015 (r282502) @@ -26,39 +26,9 @@ options SOC_IMX6 options HZ=500 # Scheduling quantum is 2 milliseconds. options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options INCLUDE_CONFIG_FILE # Include this file in kernel options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/PANDABOARD Tue May 5 17:59:02 2015 (r282502) @@ -32,38 +32,7 @@ include "../ti/omap4/pandaboard/std.pan options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/RK3188 Tue May 5 17:59:02 2015 (r282502) @@ -25,37 +25,6 @@ include "../rockchip/std.rk30xx" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/RPI-B Tue May 5 17:59:02 2015 (r282502) @@ -26,38 +26,7 @@ include "../broadcom/bcm2835/std.bcm283 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/RPI2 Tue May 5 17:59:02 2015 (r282502) @@ -26,38 +26,7 @@ include "../broadcom/bcm2835/std.bcm283 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/SOCKIT.common ============================================================================== --- head/sys/arm/conf/SOCKIT.common Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/SOCKIT.common Tue May 5 17:59:02 2015 (r282502) @@ -27,37 +27,6 @@ makeoptions WERROR="-Werror" options HZ=100 options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/VERSATILEPB Tue May 5 17:59:02 2015 (r282502) @@ -34,38 +34,7 @@ options PHYSADDR=0x00000000 options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options LINUX_BOOT_ABI # Process metadata passed from Linux boot loaders -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/VYBRID Tue May 5 17:59:02 2015 (r282502) @@ -26,38 +26,7 @@ makeoptions WERROR="-Werror" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem #options NANDFS # NAND Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support #options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/ZEDBOARD Tue May 5 17:59:02 2015 (r282502) @@ -25,37 +25,7 @@ include "std.armv6" include "../xilinx/zedboard/std.zedboard" options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client #options NFSSD # Network Filesystem Server -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support options SMP # Enable multiple cores # Debugging for use in -current Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Tue May 5 16:37:59 2015 (r282501) +++ head/sys/arm/conf/std.armv6 Tue May 5 17:59:02 2015 (r282502) @@ -2,5 +2,37 @@ # # $FreeBSD$ -options ARM_NEW_PMAP # Use new pmap code. +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem +options GEOM_PART_GPT # GUID Partition Tables +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options GEOM_LABEL # Provides labelization +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) +options VFP # Enable floating point hardware support +options ARM_NEW_PMAP # Use new pmap code. From owner-svn-src-all@FreeBSD.ORG Tue May 5 18:04:48 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1066453; Tue, 5 May 2015 18:04: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 84CB2167C; Tue, 5 May 2015 18:04: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 t45I4mpw021646; Tue, 5 May 2015 18:04:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45I4mUM021645; Tue, 5 May 2015 18:04:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051804.t45I4mUM021645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 18:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282503 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 18:04:48 -0000 Author: andrew Date: Tue May 5 18:04:47 2015 New Revision: 282503 URL: https://svnweb.freebsd.org/changeset/base/282503 Log: The VIRT kernel config targets armv6. Modified: head/sys/arm/conf/VIRT Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Tue May 5 17:59:02 2015 (r282502) +++ head/sys/arm/conf/VIRT Tue May 5 18:04:47 2015 (r282503) @@ -20,44 +20,12 @@ ident VIRT -include "std.arm" +include "std.armv6" include "../qemu/std.virt" options HZ=100 options SCHED_4BSD # 4BSD scheduler -options PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options QUOTA # Enable disk quotas for UFS -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCL -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # Efficient memory filesystem -options GEOM_PART_GPT # GUID Partition Tables -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_LABEL # Provides labelization -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM -options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) -options VFP # Enable floating point hardware support # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Tue May 5 18:29:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB3129E3; Tue, 5 May 2015 18:29: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 BC0831916; Tue, 5 May 2015 18:29: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 t45ITqYo031934; Tue, 5 May 2015 18:29:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45ITqeY031928; Tue, 5 May 2015 18:29:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051829.t45ITqeY031928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 18:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282504 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 18:29:53 -0000 Author: andrew Date: Tue May 5 18:29:51 2015 New Revision: 282504 URL: https://svnweb.freebsd.org/changeset/base/282504 Log: Start to reduce the diff between the Atmel kernel configs. Modified: head/sys/arm/conf/ATMEL head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue May 5 18:04:47 2015 (r282503) +++ head/sys/arm/conf/ATMEL Tue May 5 18:29:51 2015 (r282504) @@ -78,10 +78,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +options DDB # Enable the kernel debugger +options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp options BOOTP -options BOOTP_COMPAT options BOOTP_NFSROOT +options BOOTP_COMPAT options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 @@ -95,20 +109,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -options DDB # Support DDB. -options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. @@ -116,7 +116,7 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device ate # Atmel AT91 Ethernet driver # I2C device at91_twi # Atmel AT91 Two-wire Interface Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Tue May 5 18:04:47 2015 (r282503) +++ head/sys/arm/conf/SAM9260EK Tue May 5 18:29:51 2015 (r282504) @@ -73,10 +73,24 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# required for netbooting +# Debugging support. Always need this: +#options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +#options DDB # Enable the kernel debugger +#options GDB # Support remote GDB +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# NFS root from boopt/dhcp #options BOOTP -#options BOOTP_COMPAT #options BOOTP_NFSROOT +#options BOOTP_COMPAT #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 @@ -93,20 +107,6 @@ options NO_SWAPPING options NO_SYSCTL_DESCR options RWLOCK_NOINLINE -# Debugging support. Always need this: -#options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -#options DDB # Support DDB. -#options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Tue May 5 18:04:47 2015 (r282503) +++ head/sys/arm/conf/SAM9G20EK Tue May 5 18:29:51 2015 (r282504) @@ -27,14 +27,10 @@ hints "SAM9G20EK.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support @@ -47,77 +43,80 @@ options NFSCL # Network Filesystem Cl #options NFSD # Network Filesystem Server #options NFSLOCKD # Network Lock Manager #options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT - -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" - -options ALT_BREAK_TO_DEBUGGER - #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) #options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI #options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options MUTEX_NOINLINE -options RWLOCK_NOINLINE -options NO_FFS_SNAPSHOT -options NO_SWAPPING -# Debugging for use in -current +# Debugging support. Always need this: +options KDB # Enable kernel debugger support +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -device random -device loop -device bpf -device ether -device md +# NFS root from boopt/dhcp +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 -device uart # Serial Ports +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter # Ethernet -device ate # Ethernet Driver -device mii +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet driver option AT91_ATE_USE_RMII -device at91_twi # TWI: Two Wire Interface (EEPROM) -device at91_wdt # WDT: Watchdog timer +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device icee -# NAND Flash - Reference design has Samsung 256MB but others possible -device nand # NAND interface on CS3 +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +options AT91_MCI_HAS_4WIRE +options AT91_MCI_SLOT_B +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +# DataFlash # NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware # confilict on this card. Use one or the other. # see board_sam9g20ek.c - -# SPI: Data Flash -#device at91_spi # SPI: -#device spibus +#device at91_spi # Atmel AT91 Serial Peripheral Interface +#device spibus # SPI bus #device at45d # at45db642 and maybe others -# MMC/SD -device at91_mci -device mmc -device mmcsd -option AT91_MCI_SLOT_B -option AT91_MCI_HAS_4WIRE - -# iic -device iic -device iicbus -device icee +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device md # Memory "disks" # SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) @@ -125,8 +124,12 @@ device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + # USB support -device ohci # OHCI localbus->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" @@ -155,3 +158,9 @@ device uhid # "Human Interface Device #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm + +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer + +# NAND Flash - Reference design has Samsung 256MB but others possible +device nand # NAND interface on CS3 From owner-svn-src-all@FreeBSD.ORG Tue May 5 19:34:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A55C86C; Tue, 5 May 2015 19:34: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 880E1104B; Tue, 5 May 2015 19:34: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 t45JYO2f066589; Tue, 5 May 2015 19:34:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45JYORa066587; Tue, 5 May 2015 19:34:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505051934.t45JYORa066587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 19:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282505 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 19:34:24 -0000 Author: hselasky Date: Tue May 5 19:34:23 2015 New Revision: 282505 URL: https://svnweb.freebsd.org/changeset/base/282505 Log: Add new USB ID. PR: 199843 MFC after: 1 week Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Tue May 5 18:29:51 2015 (r282504) +++ head/sys/dev/usb/serial/uftdi.c Tue May 5 19:34:23 2015 (r282505) @@ -497,6 +497,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SCX8_USB_PHOENIX, 0), UFTDI_DEV(FTDI, SDMUSBQSS, 0), UFTDI_DEV(FTDI, SEMC_DSS20, 0), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 5 18:29:51 2015 (r282504) +++ head/sys/dev/usb/usbdevs Tue May 5 19:34:23 2015 (r282505) @@ -1872,6 +1872,7 @@ product FREECOM HDD 0xfc05 Classic SL H product FSC E5400 0x1009 PrismGT USB 2.0 WLAN /* Future Technology Devices products */ +product FTDI SCX8_USB_PHOENIX 0x5259 SCx8 USB Phoenix interface product FTDI SERIAL_8U100AX 0x8372 8U100AX Serial product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial From owner-svn-src-all@FreeBSD.ORG Tue May 5 19:47:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53F8DD30; Tue, 5 May 2015 19:47: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 350A6117A; Tue, 5 May 2015 19:47: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 t45JlKI7072262; Tue, 5 May 2015 19:47:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45JlIOP072250; Tue, 5 May 2015 19:47:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505051947.t45JlIOP072250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 19:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282506 - in stable/10/sys: arm/arm ia64/ia64 mips/mips powerpc/powerpc x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 19:47:20 -0000 Author: hselasky Date: Tue May 5 19:47:17 2015 New Revision: 282506 URL: https://svnweb.freebsd.org/changeset/base/282506 Log: MFC r282120: The add_bounce_page() function can be called when loading physical pages which pass a NULL virtual address. If the BUS_DMA_KEEP_PG_OFFSET flag is set, use the physical address to compute the page offset instead. The physical address should always be valid when adding bounce pages and should contain the same page offset like the virtual address. Submitted by: Svatopluk Kraus Reviewed by: jhb@ Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c stable/10/sys/arm/arm/busdma_machdep.c stable/10/sys/ia64/ia64/busdma_machdep.c stable/10/sys/mips/mips/busdma_machdep.c stable/10/sys/powerpc/powerpc/busdma_machdep.c stable/10/sys/x86/x86/busdma_bounce.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 Tue May 5 19:34:23 2015 (r282505) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Tue May 5 19:47:17 2015 (r282506) @@ -1662,8 +1662,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/10/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep.c Tue May 5 19:34:23 2015 (r282505) +++ stable/10/sys/arm/arm/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) @@ -1441,8 +1441,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/10/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/busdma_machdep.c Tue May 5 19:34:23 2015 (r282505) +++ stable/10/sys/ia64/ia64/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) @@ -910,8 +910,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/10/sys/mips/mips/busdma_machdep.c ============================================================================== --- stable/10/sys/mips/mips/busdma_machdep.c Tue May 5 19:34:23 2015 (r282505) +++ stable/10/sys/mips/mips/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) @@ -1359,8 +1359,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/10/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/busdma_machdep.c Tue May 5 19:34:23 2015 (r282505) +++ stable/10/sys/powerpc/powerpc/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) @@ -1121,8 +1121,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/10/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/10/sys/x86/x86/busdma_bounce.c Tue May 5 19:34:23 2015 (r282505) +++ stable/10/sys/x86/x86/busdma_bounce.c Tue May 5 19:47:17 2015 (r282506) @@ -994,8 +994,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; From owner-svn-src-all@FreeBSD.ORG Tue May 5 19:52:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D076F6E; Tue, 5 May 2015 19:52: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 EDF851268; Tue, 5 May 2015 19:52: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 t45JqNHv076568; Tue, 5 May 2015 19:52:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45JqMWJ076560; Tue, 5 May 2015 19:52:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505051952.t45JqMWJ076560@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 19:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282507 - in stable/9/sys: arm/arm ia64/ia64 mips/mips powerpc/powerpc x86/x86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 19:52:24 -0000 Author: hselasky Date: Tue May 5 19:52:22 2015 New Revision: 282507 URL: https://svnweb.freebsd.org/changeset/base/282507 Log: MFC r282120: The add_bounce_page() function can be called when loading physical pages which pass a NULL virtual address. If the BUS_DMA_KEEP_PG_OFFSET flag is set, use the physical address to compute the page offset instead. The physical address should always be valid when adding bounce pages and should contain the same page offset like the virtual address. Submitted by: Svatopluk Kraus Reviewed by: jhb@ Modified: stable/9/sys/arm/arm/busdma_machdep.c stable/9/sys/ia64/ia64/busdma_machdep.c stable/9/sys/mips/mips/busdma_machdep.c stable/9/sys/powerpc/powerpc/busdma_machdep.c stable/9/sys/x86/x86/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) +++ stable/9/sys/arm/arm/busdma_machdep.c Tue May 5 19:52:22 2015 (r282507) @@ -1449,8 +1449,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/9/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- stable/9/sys/ia64/ia64/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) +++ stable/9/sys/ia64/ia64/busdma_machdep.c Tue May 5 19:52:22 2015 (r282507) @@ -899,8 +899,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/9/sys/mips/mips/busdma_machdep.c ============================================================================== --- stable/9/sys/mips/mips/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) +++ stable/9/sys/mips/mips/busdma_machdep.c Tue May 5 19:52:22 2015 (r282507) @@ -1349,8 +1349,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/9/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- stable/9/sys/powerpc/powerpc/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) +++ stable/9/sys/powerpc/powerpc/busdma_machdep.c Tue May 5 19:52:22 2015 (r282507) @@ -1108,8 +1108,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; Modified: stable/9/sys/x86/x86/busdma_machdep.c ============================================================================== --- stable/9/sys/x86/x86/busdma_machdep.c Tue May 5 19:47:17 2015 (r282506) +++ stable/9/sys/x86/x86/busdma_machdep.c Tue May 5 19:52:22 2015 (r282507) @@ -1134,8 +1134,8 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ - bpage->vaddr |= vaddr & PAGE_MASK; - bpage->busaddr |= vaddr & PAGE_MASK; + bpage->vaddr |= addr & PAGE_MASK; + bpage->busaddr |= addr & PAGE_MASK; } bpage->datavaddr = vaddr; bpage->dataaddr = addr; From owner-svn-src-all@FreeBSD.ORG Tue May 5 19:56:24 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F24A2AB; Tue, 5 May 2015 19:56: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 0C9551299; Tue, 5 May 2015 19:56: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 t45JuNSe077275; Tue, 5 May 2015 19:56:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45JuNxs077274; Tue, 5 May 2015 19:56:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505051956.t45JuNxs077274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 19:56: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: r282508 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 19:56:24 -0000 Author: hselasky Date: Tue May 5 19:56:23 2015 New Revision: 282508 URL: https://svnweb.freebsd.org/changeset/base/282508 Log: MFC r281881: Disable multi process interrupts, because the current code doesn't use them. Else we can end up in an infinite interrupt loop in USB device mode. Modified: stable/10/sys/dev/usb/controller/dwc_otg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/dwc_otg.c Tue May 5 19:52:22 2015 (r282507) +++ stable/10/sys/dev/usb/controller/dwc_otg.c Tue May 5 19:56:23 2015 (r282508) @@ -3872,20 +3872,18 @@ dwc_otg_init(struct dwc_otg_softc *sc) if (temp & GHWCFG2_MPI) { uint8_t x; - DPRINTF("Multi Process Interrupts\n"); + DPRINTF("Disable Multi Process Interrupts\n"); for (x = 0; x != sc->sc_dev_in_ep_max; x++) { - DWC_OTG_WRITE_4(sc, DOTG_DIEPEACHINTMSK(x), - DIEPMSK_XFERCOMPLMSK); + DWC_OTG_WRITE_4(sc, DOTG_DIEPEACHINTMSK(x), 0); DWC_OTG_WRITE_4(sc, DOTG_DOEPEACHINTMSK(x), 0); } - DWC_OTG_WRITE_4(sc, DOTG_DEACHINTMSK, 0xFFFF); - } else { - DWC_OTG_WRITE_4(sc, DOTG_DIEPMSK, - DIEPMSK_XFERCOMPLMSK); - DWC_OTG_WRITE_4(sc, DOTG_DOEPMSK, 0); - DWC_OTG_WRITE_4(sc, DOTG_DAINTMSK, 0xFFFF); + DWC_OTG_WRITE_4(sc, DOTG_DEACHINTMSK, 0); } + DWC_OTG_WRITE_4(sc, DOTG_DIEPMSK, + DIEPMSK_XFERCOMPLMSK); + DWC_OTG_WRITE_4(sc, DOTG_DOEPMSK, 0); + DWC_OTG_WRITE_4(sc, DOTG_DAINTMSK, 0xFFFF); } if (sc->sc_mode == DWC_MODE_OTG || sc->sc_mode == DWC_MODE_HOST) { From owner-svn-src-all@FreeBSD.ORG Tue May 5 19:59:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DAF1521; Tue, 5 May 2015 19:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ACFD12C5; Tue, 5 May 2015 19:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45JxGcl077687; Tue, 5 May 2015 19:59:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45JxGus077686; Tue, 5 May 2015 19:59:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505051959.t45JxGus077686@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 19:59: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: r282509 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 19:59:16 -0000 Author: hselasky Date: Tue May 5 19:59:15 2015 New Revision: 282509 URL: https://svnweb.freebsd.org/changeset/base/282509 Log: MFC r280598: Add definition of the ISOCHRONOUS endpoint usage bits. Refer to the USB v2.0 specification for more information. Modified: stable/10/sys/dev/usb/usb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb.h ============================================================================== --- stable/10/sys/dev/usb/usb.h Tue May 5 19:56:23 2015 (r282508) +++ stable/10/sys/dev/usb/usb.h Tue May 5 19:59:15 2015 (r282509) @@ -542,6 +542,11 @@ struct usb_endpoint_descriptor { #define UE_ISO_ADAPT 0x08 #define UE_ISO_SYNC 0x0c #define UE_GET_ISO_TYPE(a) ((a) & UE_ISO_TYPE) +#define UE_ISO_USAGE 0x30 +#define UE_ISO_USAGE_DATA 0x00 +#define UE_ISO_USAGE_FEEDBACK 0x10 +#define UE_ISO_USAGE_IMPLICT_FB 0x20 +#define UE_GET_ISO_USAGE(a) ((a) & UE_ISO_USAGE) uWord wMaxPacketSize; #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; From owner-svn-src-all@FreeBSD.ORG Tue May 5 20:00:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94BCE695; Tue, 5 May 2015 20:00: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 82CA112E2; Tue, 5 May 2015 20:00: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 t45K0LDs078780; Tue, 5 May 2015 20:00:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45K0Lsq078778; Tue, 5 May 2015 20:00:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505052000.t45K0Lsq078778@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 20:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282510 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 20:00:21 -0000 Author: hselasky Date: Tue May 5 20:00:20 2015 New Revision: 282510 URL: https://svnweb.freebsd.org/changeset/base/282510 Log: MFC r280598: Add definition of the ISOCHRONOUS endpoint usage bits. Refer to the USB v2.0 specification for more information. Modified: stable/9/sys/dev/usb/usb.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb.h ============================================================================== --- stable/9/sys/dev/usb/usb.h Tue May 5 19:59:15 2015 (r282509) +++ stable/9/sys/dev/usb/usb.h Tue May 5 20:00:20 2015 (r282510) @@ -536,6 +536,11 @@ struct usb_endpoint_descriptor { #define UE_ISO_ADAPT 0x08 #define UE_ISO_SYNC 0x0c #define UE_GET_ISO_TYPE(a) ((a) & UE_ISO_TYPE) +#define UE_ISO_USAGE 0x30 +#define UE_ISO_USAGE_DATA 0x00 +#define UE_ISO_USAGE_FEEDBACK 0x10 +#define UE_ISO_USAGE_IMPLICT_FB 0x20 +#define UE_GET_ISO_USAGE(a) ((a) & UE_ISO_USAGE) uWord wMaxPacketSize; #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; From owner-svn-src-all@FreeBSD.ORG Tue May 5 20:01:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE99C7F1; Tue, 5 May 2015 20: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 CC5A6138A; Tue, 5 May 2015 20:01: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 t45K1SJS079502; Tue, 5 May 2015 20:01:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45K1Saa079501; Tue, 5 May 2015 20:01:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505052001.t45K1Saa079501@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 20:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r282511 - 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.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 20:01:29 -0000 Author: hselasky Date: Tue May 5 20:01:28 2015 New Revision: 282511 URL: https://svnweb.freebsd.org/changeset/base/282511 Log: MFC r280598: Add definition of the ISOCHRONOUS endpoint usage bits. Refer to the USB v2.0 specification for more information. Modified: stable/8/sys/dev/usb/usb.h 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.h ============================================================================== --- stable/8/sys/dev/usb/usb.h Tue May 5 20:00:20 2015 (r282510) +++ stable/8/sys/dev/usb/usb.h Tue May 5 20:01:28 2015 (r282511) @@ -525,6 +525,11 @@ struct usb_endpoint_descriptor { #define UE_ISO_ADAPT 0x08 #define UE_ISO_SYNC 0x0c #define UE_GET_ISO_TYPE(a) ((a) & UE_ISO_TYPE) +#define UE_ISO_USAGE 0x30 +#define UE_ISO_USAGE_DATA 0x00 +#define UE_ISO_USAGE_FEEDBACK 0x10 +#define UE_ISO_USAGE_IMPLICT_FB 0x20 +#define UE_GET_ISO_USAGE(a) ((a) & UE_ISO_USAGE) uWord wMaxPacketSize; #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; From owner-svn-src-all@FreeBSD.ORG Tue May 5 20:04:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33FAA9E6; Tue, 5 May 2015 20:04: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 21E2A13BA; Tue, 5 May 2015 20:04: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 t45K42P5082240; Tue, 5 May 2015 20:04:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45K41vK082239; Tue, 5 May 2015 20:04:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505052004.t45K41vK082239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 20:04: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: r282512 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages 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, 05 May 2015 20:04:02 -0000 Author: hselasky Date: Tue May 5 20:04:01 2015 New Revision: 282512 URL: https://svnweb.freebsd.org/changeset/base/282512 Log: MFC r280597: Add DA_Q_NO_RC16 quirk for USB mass storage device. PR: 198647 Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Tue May 5 20:01:28 2015 (r282511) +++ stable/10/sys/cam/scsi/scsi_da.c Tue May 5 20:04:01 2015 (r282512) @@ -1175,6 +1175,13 @@ static struct da_quirk_entry da_quirk_ta { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SG9XCS2D*", "*" }, /*quirks*/DA_Q_4K }, + { + /* + * MX-ES USB Drive by Mach Xtreme + */ + { T_DIRECT, SIP_MEDIA_REMOVABLE, "MX", "MXUB3SES*", "*"}, + /*quirks*/DA_Q_NO_RC16 + }, }; static disk_strategy_t dastrategy; From owner-svn-src-all@FreeBSD.ORG Tue May 5 20:58:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DD89BAF; Tue, 5 May 2015 20:58: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 2A04719E7; Tue, 5 May 2015 20:58: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 t45KwJUX008007; Tue, 5 May 2015 20:58:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45KwD3B007981; Tue, 5 May 2015 20:58:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505052058.t45KwD3B007981@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 20:58: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: r282513 - in stable/10/sys/ofed/include: linux net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 20:58:19 -0000 Author: hselasky Date: Tue May 5 20:58:12 2015 New Revision: 282513 URL: https://svnweb.freebsd.org/changeset/base/282513 Log: MFC r277396, r278681, r278865, r278924, r279205, r280208, r280210, r280764 and r280768: Update the Linux compatibility layer: - Add more functions. - Add some missing includes which are needed when the header files are not included in a particular order. - The kasprintf() function cannot be inlined due to using a variable number of arguments. Move it to a C-file. - Fix problems about 32-bit ticks wraparound and unsigned long conversion. Jiffies or ticks in FreeBSD have integer type and are not long. - Add missing "order_base_2()" macro. - Fix BUILD_BUG_ON() macro. - Declare a missing symbol which is needed when compiling without -O2 - Clean up header file inclusions in the linux/completion.h, linux/in.h and linux/fs.h header files. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/bitops.h stable/10/sys/ofed/include/linux/cache.h stable/10/sys/ofed/include/linux/completion.h stable/10/sys/ofed/include/linux/device.h stable/10/sys/ofed/include/linux/dma-mapping.h stable/10/sys/ofed/include/linux/etherdevice.h stable/10/sys/ofed/include/linux/fs.h stable/10/sys/ofed/include/linux/gfp.h stable/10/sys/ofed/include/linux/in.h stable/10/sys/ofed/include/linux/io.h stable/10/sys/ofed/include/linux/jiffies.h stable/10/sys/ofed/include/linux/kernel.h stable/10/sys/ofed/include/linux/kref.h stable/10/sys/ofed/include/linux/ktime.h stable/10/sys/ofed/include/linux/linux_compat.c stable/10/sys/ofed/include/linux/log2.h stable/10/sys/ofed/include/linux/pci.h stable/10/sys/ofed/include/linux/slab.h stable/10/sys/ofed/include/linux/timer.h stable/10/sys/ofed/include/net/ip.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/bitops.h ============================================================================== --- stable/10/sys/ofed/include/linux/bitops.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/bitops.h Tue May 5 20:58:12 2015 (r282513) @@ -288,9 +288,15 @@ bitmap_empty(unsigned long *addr, int si #define NBLONG (NBBY * sizeof(long)) +#define __set_bit(i, a) \ + atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) + #define set_bit(i, a) \ atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) +#define __clear_bit(i, a) \ + atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) + #define clear_bit(i, a) \ atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) Modified: stable/10/sys/ofed/include/linux/cache.h ============================================================================== --- stable/10/sys/ofed/include/linux/cache.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/cache.h Tue May 5 20:58:12 2015 (r282513) @@ -30,8 +30,7 @@ #ifndef _LINUX_CACHE_H_ #define _LINUX_CACHE_H_ - #define cache_line_size() CACHE_LINE_SIZE - +#define L1_CACHE_BYTES CACHE_LINE_SIZE #endif /* _LINUX_CACHE_H_ */ Modified: stable/10/sys/ofed/include/linux/completion.h ============================================================================== --- stable/10/sys/ofed/include/linux/completion.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/completion.h Tue May 5 20:58:12 2015 (r282513) @@ -32,124 +32,35 @@ #include -#include -#include -#include -#include -#include - struct completion { unsigned int done; }; -#define INIT_COMPLETION(c) ((c).done = 0) -#define init_completion(c) ((c)->done = 0) - -static inline void -_complete_common(struct completion *c, int all) -{ - int wakeup_swapper; - - sleepq_lock(c); - c->done++; - if (all) - wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); - else - wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); - sleepq_release(c); - if (wakeup_swapper) - kick_proc0(); -} - -#define complete(c) _complete_common(c, 0) -#define complete_all(c) _complete_common(c, 1) - -/* - * Indefinite wait for done != 0 with or without signals. - */ -static inline long -_wait_for_common(struct completion *c, int flags) -{ - - flags |= SLEEPQ_SLEEP; - for (;;) { - sleepq_lock(c); - if (c->done) - break; - sleepq_add(c, NULL, "completion", flags, 0); - if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_wait_sig(c, 0) != 0) - return (-ERESTARTSYS); - } else - sleepq_wait(c, 0); - } - c->done--; - sleepq_release(c); - - return (0); -} - -#define wait_for_completion(c) _wait_for_common(c, 0) -#define wait_for_completion_interuptible(c) \ - _wait_for_common(c, SLEEPQ_INTERRUPTIBLE) - -static inline long -_wait_for_timeout_common(struct completion *c, long timeout, int flags) -{ - long end; - - end = ticks + timeout; - flags |= SLEEPQ_SLEEP; - for (;;) { - sleepq_lock(c); - if (c->done) - break; - sleepq_add(c, NULL, "completion", flags, 0); - sleepq_set_timeout(c, end - ticks); - if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_timedwait_sig(c, 0) != 0) - return (-ERESTARTSYS); - } else - sleepq_timedwait(c, 0); - } - c->done--; - sleepq_release(c); - timeout = end - ticks; - - return (timeout > 0 ? timeout : 1); -} - -#define wait_for_completion_timeout(c, timeout) \ - _wait_for_timeout_common(c, timeout, 0) -#define wait_for_completion_interruptible_timeout(c, timeout) \ - _wait_for_timeout_common(c, timeout, SLEEPQ_INTERRUPTIBLE) - -static inline int -try_wait_for_completion(struct completion *c) -{ - int isdone; - - isdone = 1; - sleepq_lock(c); - if (c->done) - c->done--; - else - isdone = 0; - sleepq_release(c); - return (isdone); -} - -static inline int -completion_done(struct completion *c) -{ - int isdone; - - isdone = 1; - sleepq_lock(c); - if (c->done == 0) - isdone = 0; - sleepq_release(c); - return (isdone); -} +#define INIT_COMPLETION(c) \ + ((c).done = 0) +#define init_completion(c) \ + ((c)->done = 0) +#define complete(c) \ + linux_complete_common((c), 0) +#define complete_all(c) \ + linux_complete_common((c), 1) +#define wait_for_completion(c) \ + linux_wait_for_common((c), 0) +#define wait_for_completion_interuptible(c) \ + linux_wait_for_common((c), 1) +#define wait_for_completion_timeout(c, timeout) \ + linux_wait_for_timeout_common((c), (timeout), 0) +#define wait_for_completion_interruptible_timeout(c, timeout) \ + linux_wait_for_timeout_common((c), (timeout), 1) +#define try_wait_for_completion(c) \ + linux_try_wait_for_completion(c) +#define completion_done(c) \ + linux_completion_done(c) + +extern void linux_complete_common(struct completion *, int); +extern long linux_wait_for_common(struct completion *, int); +extern long linux_wait_for_timeout_common(struct completion *, long, int); +extern int linux_try_wait_for_completion(struct completion *); +extern int linux_completion_done(struct completion *); -#endif /* _LINUX_COMPLETION_H_ */ +#endif /* _LINUX_COMPLETION_H_ */ Modified: stable/10/sys/ofed/include/linux/device.h ============================================================================== --- stable/10/sys/ofed/include/linux/device.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/device.h Tue May 5 20:58:12 2015 (r282513) @@ -431,17 +431,6 @@ static inline char *kvasprintf(gfp_t gfp return p; } -static inline char *kasprintf(gfp_t gfp, const char *fmt, ...) -{ - va_list ap; - char *p; - - va_start(ap, fmt); - p = kvasprintf(gfp, fmt, ap); - va_end(ap); - - return p; -} - +char *kasprintf(gfp_t, const char *, ...); #endif /* _LINUX_DEVICE_H_ */ Modified: stable/10/sys/ofed/include/linux/dma-mapping.h ============================================================================== --- stable/10/sys/ofed/include/linux/dma-mapping.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/dma-mapping.h Tue May 5 20:58:12 2015 (r282513) @@ -139,6 +139,14 @@ dma_alloc_coherent(struct device *dev, s *dma_handle = 0; return (mem); } + +static inline void * +dma_zalloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, + gfp_t flag) +{ + + return (dma_alloc_coherent(dev, size, dma_handle, flag | __GFP_ZERO)); +} static inline void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, Modified: stable/10/sys/ofed/include/linux/etherdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/etherdevice.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/etherdevice.h Tue May 5 20:58:12 2015 (r282513) @@ -89,6 +89,9 @@ static inline bool is_valid_ether_addr(c return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); } - +static inline void ether_addr_copy(u8 *dst, const u8 *src) +{ + memcpy(dst, src, 6); +} #endif /* _LINUX_ETHERDEVICE */ Modified: stable/10/sys/ofed/include/linux/fs.h ============================================================================== --- stable/10/sys/ofed/include/linux/fs.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/fs.h Tue May 5 20:58:12 2015 (r282513) @@ -29,6 +29,8 @@ #ifndef _LINUX_FS_H_ #define _LINUX_FS_H_ +#include +#include #include #include #include Modified: stable/10/sys/ofed/include/linux/gfp.h ============================================================================== --- stable/10/sys/ofed/include/linux/gfp.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/gfp.h Tue May 5 20:58:12 2015 (r282513) @@ -30,6 +30,8 @@ #ifndef _LINUX_GFP_H_ #define _LINUX_GFP_H_ +#include +#include #include #include @@ -103,6 +105,13 @@ __free_pages(struct page *m, unsigned in kmem_free(kmem_arena, (vm_offset_t)page_address(m), size); } +static inline void free_pages(uintptr_t addr, unsigned int order) +{ + if (addr == 0) + return; + __free_pages(virt_to_page((void *)addr), order); +} + /* * Alloc pages allocates directly from the buddy allocator on linux so * order specifies a power of two bucket of pages and the results @@ -122,6 +131,16 @@ alloc_pages(gfp_t gfp_mask, unsigned int return (virt_to_page(page)); } +static inline uintptr_t __get_free_pages(gfp_t gfp_mask, unsigned int order) +{ + struct page *page; + + page = alloc_pages(gfp_mask, order); + if (page == NULL) + return (0); + return ((uintptr_t)page_address(page)); +} + #define alloc_pages_node(node, mask, order) alloc_pages(mask, order) #define kmalloc_node(chunk, mask, node) kmalloc(chunk, mask) Modified: stable/10/sys/ofed/include/linux/in.h ============================================================================== --- stable/10/sys/ofed/include/linux/in.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/in.h Tue May 5 20:58:12 2015 (r282513) @@ -31,6 +31,9 @@ #include "opt_inet.h" +#include +#include +#include #include #include Modified: stable/10/sys/ofed/include/linux/io.h ============================================================================== --- stable/10/sys/ofed/include/linux/io.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/io.h Tue May 5 20:58:12 2015 (r282513) @@ -31,6 +31,7 @@ #define _LINUX_IO_H_ #include +#include static inline uint32_t __raw_readl(const volatile void *addr) @@ -89,6 +90,20 @@ writew(uint16_t b, void *addr) *(volatile uint16_t *)addr = b; } +#undef ioread32be +static inline uint32_t +ioread32be(const volatile void *addr) +{ + return be32toh(*(const volatile uint32_t *)addr); +} + +#undef iowrite32be +static inline void +iowrite32be(uint32_t v, volatile void *addr) +{ + *(volatile uint32_t *)addr = htobe32(v); +} + void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) Modified: stable/10/sys/ofed/include/linux/jiffies.h ============================================================================== --- stable/10/sys/ofed/include/linux/jiffies.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/jiffies.h Tue May 5 20:58:12 2015 (r282513) @@ -45,14 +45,12 @@ msecs_to_jiffies(int msec) return (tvtohz(&tv)); } - #define jiffies ticks #define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz) - -#define time_after(a, b) ((long)(b) - (long)(a) < 0) +#define time_after(a, b) ((int)((b) - (a)) < 0) #define time_before(a, b) time_after(b,a) -#define time_after_eq(a, b) ((long)(a) - (long)(b) >= 0) +#define time_after_eq(a, b) ((int)((a) - (b)) >= 0) #define time_before_eq(a, b) time_after_eq(b, a) #define HZ hz Modified: stable/10/sys/ofed/include/linux/kernel.h ============================================================================== --- stable/10/sys/ofed/include/linux/kernel.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/kernel.h Tue May 5 20:58:12 2015 (r282513) @@ -29,6 +29,8 @@ #ifndef _LINUX_KERNEL_H_ #define _LINUX_KERNEL_H_ +#include +#include #include #include #include @@ -57,6 +59,8 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" +#define BUILD_BUG_ON(x) CTASSERT(!(x)) + #define BUG() panic("BUG") #define BUG_ON(condition) do { if (condition) BUG(); } while(0) #define WARN_ON BUG_ON @@ -66,6 +70,7 @@ #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define DIV_ROUND_UP howmany +#define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) #define printk(X...) printf(X) @@ -86,6 +91,7 @@ #endif #define udelay(t) DELAY(t) +#define usleep_range(min,max) DELAY(min) #ifndef pr_fmt #define pr_fmt(fmt) fmt @@ -172,6 +178,7 @@ #define round_down(x, y) ((x) & ~__round_mask(x, y)) #define num_possible_cpus() mp_ncpus +#define num_online_cpus() mp_ncpus typedef struct pm_message { int event; Modified: stable/10/sys/ofed/include/linux/kref.h ============================================================================== --- stable/10/sys/ofed/include/linux/kref.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/kref.h Tue May 5 20:58:12 2015 (r282513) @@ -29,6 +29,7 @@ #ifndef _LINUX_KREF_H_ #define _LINUX_KREF_H_ +#include #include struct kref { Modified: stable/10/sys/ofed/include/linux/ktime.h ============================================================================== --- stable/10/sys/ofed/include/linux/ktime.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/ktime.h Tue May 5 20:58:12 2015 (r282513) @@ -288,4 +288,13 @@ static inline s64 ktime_to_ns(const ktim #endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ +static inline s64 ktime_get_ns(void) +{ + struct timespec ts; + ktime_t kt; + ktime_get_ts(&ts); + kt = timespec_to_ktime(ts); + return (ktime_to_ns(kt)); +} + #endif /* _LINUX_KTIME_H */ Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/linux_compat.c Tue May 5 20:58:12 2015 (r282513) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -56,6 +58,8 @@ #include #include #include +#include +#include #include @@ -67,20 +71,17 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux #undef file #undef cdev #define RB_ROOT(head) (head)->rbh_root -#undef LIST_HEAD -/* From sys/queue.h */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} struct kobject class_root; struct device linux_rootdev; struct class miscclass; struct list_head pci_drivers; struct list_head pci_devices; +struct net init_net; spinlock_t pci_lock; +unsigned long linux_timer_hz_mask; + int panic_cmp(struct rb_node *one, struct rb_node *two) { @@ -597,7 +598,9 @@ struct vmmap { unsigned long vm_size; }; -LIST_HEAD(vmmaphd, vmmap); +struct vmmaphd { + struct vmmap *lh_first; +}; #define VMMAP_HASH_SIZE 64 #define VMMAP_HASH_MASK (VMMAP_HASH_SIZE - 1) #define VM_HASH(addr) ((uintptr_t)(addr) >> PAGE_SHIFT) & VMMAP_HASH_MASK @@ -688,6 +691,185 @@ vunmap(void *addr) kfree(vmmap); } + +char * +kasprintf(gfp_t gfp, const char *fmt, ...) +{ + va_list ap; + char *p; + + va_start(ap, fmt); + p = kvasprintf(gfp, fmt, ap); + va_end(ap); + + return p; +} + +static int +linux_timer_jiffies_until(unsigned long expires) +{ + int delta = expires - jiffies; + /* guard against already expired values */ + if (delta < 1) + delta = 1; + return (delta); +} + +static void +linux_timer_callback_wrapper(void *context) +{ + struct timer_list *timer; + + timer = context; + timer->function(timer->data); +} + +void +mod_timer(struct timer_list *timer, unsigned long expires) +{ + + timer->expires = expires; + callout_reset(&timer->timer_callout, + linux_timer_jiffies_until(expires), + &linux_timer_callback_wrapper, timer); +} + +void +add_timer(struct timer_list *timer) +{ + + callout_reset(&timer->timer_callout, + linux_timer_jiffies_until(timer->expires), + &linux_timer_callback_wrapper, timer); +} + +static void +linux_timer_init(void *arg) +{ + + /* + * Compute an internal HZ value which can divide 2**32 to + * avoid timer rounding problems when the tick value wraps + * around 2**32: + */ + linux_timer_hz_mask = 1; + while (linux_timer_hz_mask < (unsigned long)hz) + linux_timer_hz_mask *= 2; + linux_timer_hz_mask--; +} +SYSINIT(linux_timer, SI_SUB_DRIVERS, SI_ORDER_FIRST, linux_timer_init, NULL); + +void +linux_complete_common(struct completion *c, int all) +{ + int wakeup_swapper; + + sleepq_lock(c); + c->done++; + if (all) + wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); + else + wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); + sleepq_release(c); + if (wakeup_swapper) + kick_proc0(); +} + +/* + * Indefinite wait for done != 0 with or without signals. + */ +long +linux_wait_for_common(struct completion *c, int flags) +{ + + if (flags != 0) + flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; + else + flags = SLEEPQ_SLEEP; + for (;;) { + sleepq_lock(c); + if (c->done) + break; + sleepq_add(c, NULL, "completion", flags, 0); + if (flags & SLEEPQ_INTERRUPTIBLE) { + if (sleepq_wait_sig(c, 0) != 0) + return (-ERESTARTSYS); + } else + sleepq_wait(c, 0); + } + c->done--; + sleepq_release(c); + + return (0); +} + +/* + * Time limited wait for done != 0 with or without signals. + */ +long +linux_wait_for_timeout_common(struct completion *c, long timeout, int flags) +{ + long end = jiffies + timeout; + + if (flags != 0) + flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; + else + flags = SLEEPQ_SLEEP; + for (;;) { + int ret; + + sleepq_lock(c); + if (c->done) + break; + sleepq_add(c, NULL, "completion", flags, 0); + sleepq_set_timeout(c, linux_timer_jiffies_until(end)); + if (flags & SLEEPQ_INTERRUPTIBLE) + ret = sleepq_timedwait_sig(c, 0); + else + ret = sleepq_timedwait(c, 0); + if (ret != 0) { + /* check for timeout or signal */ + if (ret == EWOULDBLOCK) + return (0); + else + return (-ERESTARTSYS); + } + } + c->done--; + sleepq_release(c); + + /* return how many jiffies are left */ + return (linux_timer_jiffies_until(end)); +} + +int +linux_try_wait_for_completion(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done) + c->done--; + else + isdone = 0; + sleepq_release(c); + return (isdone); +} + +int +linux_completion_done(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done == 0) + isdone = 0; + sleepq_release(c); + return (isdone); +} + static void linux_compat_init(void *arg) { Modified: stable/10/sys/ofed/include/linux/log2.h ============================================================================== --- stable/10/sys/ofed/include/linux/log2.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/log2.h Tue May 5 20:58:12 2015 (r282513) @@ -167,4 +167,6 @@ int __ilog2_u64(u64 n) __ilog2_u64(n) \ ) +#define order_base_2(x) ilog2(roundup_pow_of_two(x)) + #endif /* _LINUX_LOG2_H_ */ Modified: stable/10/sys/ofed/include/linux/pci.h ============================================================================== --- stable/10/sys/ofed/include/linux/pci.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/pci.h Tue May 5 20:58:12 2015 (r282513) @@ -270,6 +270,14 @@ pci_set_master(struct pci_dev *pdev) } static inline int +pci_clear_master(struct pci_dev *pdev) +{ + + pci_disable_busmaster(pdev->dev.bsddev); + return (0); +} + +static inline int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name) { int rid; @@ -592,6 +600,30 @@ pci_enable_msix(struct pci_dev *pdev, st return (0); } +#define pci_enable_msix_range linux_pci_enable_msix_range +static inline int +pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, + int minvec, int maxvec) +{ + int nvec = maxvec; + int rc; + + if (maxvec < minvec) + return (-ERANGE); + + do { + rc = pci_enable_msix(dev, entries, nvec); + if (rc < 0) { + return (rc); + } else if (rc > 0) { + if (rc < minvec) + return (-ENOSPC); + nvec = rc; + } + } while (rc); + return (nvec); +} + static inline int pci_channel_offline(struct pci_dev *pdev) { return false; Modified: stable/10/sys/ofed/include/linux/slab.h ============================================================================== --- stable/10/sys/ofed/include/linux/slab.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/slab.h Tue May 5 20:58:12 2015 (r282513) @@ -40,6 +40,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) +#define kvmalloc(size) kmalloc((size), 0) #define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO) #define kzalloc_node(size, flags, node) kzalloc(size, flags) #define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) @@ -47,6 +48,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kcalloc(n, size, flags) kmalloc((n) * (size), flags | M_ZERO) #define vzalloc(size) kzalloc(size, GFP_KERNEL | __GFP_NOWARN) #define vfree(arg) kfree(arg) +#define kvfree(arg) kfree(arg) #define vmalloc(size) kmalloc(size, GFP_KERNEL) #define vmalloc_node(size, node) kmalloc(size, GFP_KERNEL) Modified: stable/10/sys/ofed/include/linux/timer.h ============================================================================== --- stable/10/sys/ofed/include/linux/timer.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/linux/timer.h Tue May 5 20:58:12 2015 (r282513) @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _LINUX_TIMER_H_ -#define _LINUX_TIMER_H_ +#define _LINUX_TIMER_H_ #include @@ -36,20 +36,13 @@ #include struct timer_list { - struct callout timer_callout; - void (*function)(unsigned long); - unsigned long data; - unsigned long expires; + struct callout timer_callout; + void (*function) (unsigned long); + unsigned long data; + unsigned long expires; }; -static inline void -_timer_fn(void *context) -{ - struct timer_list *timer; - - timer = context; - timer->function(timer->data); -} +extern unsigned long linux_timer_hz_mask; #define setup_timer(timer, func, dat) \ do { \ @@ -65,28 +58,15 @@ do { \ callout_init(&(timer)->timer_callout, CALLOUT_MPSAFE); \ } while (0) -#define mod_timer(timer, exp) \ -do { \ - (timer)->expires = (exp); \ - callout_reset(&(timer)->timer_callout, (exp) - jiffies, \ - _timer_fn, (timer)); \ -} while (0) - -#define add_timer(timer) \ - callout_reset(&(timer)->timer_callout, \ - (timer)->expires - jiffies, _timer_fn, (timer)) +extern void mod_timer(struct timer_list *, unsigned long); +extern void add_timer(struct timer_list *); #define del_timer(timer) callout_stop(&(timer)->timer_callout) #define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) - #define timer_pending(timer) callout_pending(&(timer)->timer_callout) +#define round_jiffies(j) \ + ((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) +#define round_jiffies_relative(j) \ + round_jiffies(j) -static inline unsigned long -round_jiffies(unsigned long j) -{ - return roundup(j, hz); -} - -#define round_jiffies_relative(j) round_jiffies(j) - -#endif /* _LINUX_TIMER_H_ */ +#endif /* _LINUX_TIMER_H_ */ Modified: stable/10/sys/ofed/include/net/ip.h ============================================================================== --- stable/10/sys/ofed/include/net/ip.h Tue May 5 20:04:01 2015 (r282512) +++ stable/10/sys/ofed/include/net/ip.h Tue May 5 20:58:12 2015 (r282513) @@ -42,13 +42,17 @@ #include #include -#ifdef INET static inline void inet_get_local_port_range(int *low, int *high) { +#ifdef INET CURVNET_SET_QUIET(TD_TO_VNET(curthread)); *low = V_ipport_firstauto; *high = V_ipport_lastauto; CURVNET_RESTORE(); +#else + *low = IPPORT_EPHEMERALFIRST; /* 10000 */ + *high = IPPORT_EPHEMERALLAST; /* 65535 */ +#endif } static inline void @@ -79,6 +83,5 @@ ip_ib_mc_map(uint32_t addr, const unsign buf[18] = (addr >> 8) & 0xff; buf[19] = addr & 0xff; } -#endif #endif /* _LINUX_NET_IP_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue May 5 20:59:50 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AECAD0A; Tue, 5 May 2015 20:59:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB52D1A02; Tue, 5 May 2015 20:59: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 t45KxnAM008253; Tue, 5 May 2015 20:59:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45KxieA008224; Tue, 5 May 2015 20:59:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505052059.t45KxieA008224@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 5 May 2015 20:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r282514 - in stable/9/sys/ofed/include: linux net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 20:59:50 -0000 Author: hselasky Date: Tue May 5 20:59:43 2015 New Revision: 282514 URL: https://svnweb.freebsd.org/changeset/base/282514 Log: MFC r277396, r278681, r278865, r278924, r279205, r280208, r280210, r280764 and r280768: Update the Linux compatibility layer: - Add more functions. - Add some missing includes which are needed when the header files are not included in a particular order. - The kasprintf() function cannot be inlined due to using a variable number of arguments. Move it to a C-file. - Fix problems about 32-bit ticks wraparound and unsigned long conversion. Jiffies or ticks in FreeBSD have integer type and are not long. - Add missing "order_base_2()" macro. - Fix BUILD_BUG_ON() macro. - Declare a missing symbol which is needed when compiling without -O2 - Clean up header file inclusions in the linux/completion.h, linux/in.h and linux/fs.h header files. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/include/linux/bitops.h stable/9/sys/ofed/include/linux/cache.h stable/9/sys/ofed/include/linux/completion.h stable/9/sys/ofed/include/linux/device.h stable/9/sys/ofed/include/linux/dma-mapping.h stable/9/sys/ofed/include/linux/etherdevice.h stable/9/sys/ofed/include/linux/fs.h stable/9/sys/ofed/include/linux/gfp.h stable/9/sys/ofed/include/linux/in.h stable/9/sys/ofed/include/linux/io.h stable/9/sys/ofed/include/linux/jiffies.h stable/9/sys/ofed/include/linux/kernel.h stable/9/sys/ofed/include/linux/kref.h stable/9/sys/ofed/include/linux/ktime.h stable/9/sys/ofed/include/linux/linux_compat.c stable/9/sys/ofed/include/linux/log2.h stable/9/sys/ofed/include/linux/pci.h stable/9/sys/ofed/include/linux/slab.h stable/9/sys/ofed/include/linux/timer.h stable/9/sys/ofed/include/net/ip.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/bitops.h ============================================================================== --- stable/9/sys/ofed/include/linux/bitops.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/bitops.h Tue May 5 20:59:43 2015 (r282514) @@ -288,9 +288,15 @@ bitmap_empty(unsigned long *addr, int si #define NBLONG (NBBY * sizeof(long)) +#define __set_bit(i, a) \ + atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) + #define set_bit(i, a) \ atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) +#define __clear_bit(i, a) \ + atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) + #define clear_bit(i, a) \ atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) Modified: stable/9/sys/ofed/include/linux/cache.h ============================================================================== --- stable/9/sys/ofed/include/linux/cache.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/cache.h Tue May 5 20:59:43 2015 (r282514) @@ -30,8 +30,7 @@ #ifndef _LINUX_CACHE_H_ #define _LINUX_CACHE_H_ - #define cache_line_size() CACHE_LINE_SIZE - +#define L1_CACHE_BYTES CACHE_LINE_SIZE #endif /* _LINUX_CACHE_H_ */ Modified: stable/9/sys/ofed/include/linux/completion.h ============================================================================== --- stable/9/sys/ofed/include/linux/completion.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/completion.h Tue May 5 20:59:43 2015 (r282514) @@ -32,124 +32,35 @@ #include -#include -#include -#include -#include -#include - struct completion { unsigned int done; }; -#define INIT_COMPLETION(c) ((c).done = 0) -#define init_completion(c) ((c)->done = 0) - -static inline void -_complete_common(struct completion *c, int all) -{ - int wakeup_swapper; - - sleepq_lock(c); - c->done++; - if (all) - wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); - else - wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); - sleepq_release(c); - if (wakeup_swapper) - kick_proc0(); -} - -#define complete(c) _complete_common(c, 0) -#define complete_all(c) _complete_common(c, 1) - -/* - * Indefinite wait for done != 0 with or without signals. - */ -static inline long -_wait_for_common(struct completion *c, int flags) -{ - - flags |= SLEEPQ_SLEEP; - for (;;) { - sleepq_lock(c); - if (c->done) - break; - sleepq_add(c, NULL, "completion", flags, 0); - if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_wait_sig(c, 0) != 0) - return (-ERESTARTSYS); - } else - sleepq_wait(c, 0); - } - c->done--; - sleepq_release(c); - - return (0); -} - -#define wait_for_completion(c) _wait_for_common(c, 0) -#define wait_for_completion_interuptible(c) \ - _wait_for_common(c, SLEEPQ_INTERRUPTIBLE) - -static inline long -_wait_for_timeout_common(struct completion *c, long timeout, int flags) -{ - long end; - - end = ticks + timeout; - flags |= SLEEPQ_SLEEP; - for (;;) { - sleepq_lock(c); - if (c->done) - break; - sleepq_add(c, NULL, "completion", flags, 0); - sleepq_set_timeout(c, end - ticks); - if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_timedwait_sig(c, 0) != 0) - return (-ERESTARTSYS); - } else - sleepq_timedwait(c, 0); - } - c->done--; - sleepq_release(c); - timeout = end - ticks; - - return (timeout > 0 ? timeout : 1); -} - -#define wait_for_completion_timeout(c, timeout) \ - _wait_for_timeout_common(c, timeout, 0) -#define wait_for_completion_interruptible_timeout(c, timeout) \ - _wait_for_timeout_common(c, timeout, SLEEPQ_INTERRUPTIBLE) - -static inline int -try_wait_for_completion(struct completion *c) -{ - int isdone; - - isdone = 1; - sleepq_lock(c); - if (c->done) - c->done--; - else - isdone = 0; - sleepq_release(c); - return (isdone); -} - -static inline int -completion_done(struct completion *c) -{ - int isdone; - - isdone = 1; - sleepq_lock(c); - if (c->done == 0) - isdone = 0; - sleepq_release(c); - return (isdone); -} +#define INIT_COMPLETION(c) \ + ((c).done = 0) +#define init_completion(c) \ + ((c)->done = 0) +#define complete(c) \ + linux_complete_common((c), 0) +#define complete_all(c) \ + linux_complete_common((c), 1) +#define wait_for_completion(c) \ + linux_wait_for_common((c), 0) +#define wait_for_completion_interuptible(c) \ + linux_wait_for_common((c), 1) +#define wait_for_completion_timeout(c, timeout) \ + linux_wait_for_timeout_common((c), (timeout), 0) +#define wait_for_completion_interruptible_timeout(c, timeout) \ + linux_wait_for_timeout_common((c), (timeout), 1) +#define try_wait_for_completion(c) \ + linux_try_wait_for_completion(c) +#define completion_done(c) \ + linux_completion_done(c) + +extern void linux_complete_common(struct completion *, int); +extern long linux_wait_for_common(struct completion *, int); +extern long linux_wait_for_timeout_common(struct completion *, long, int); +extern int linux_try_wait_for_completion(struct completion *); +extern int linux_completion_done(struct completion *); -#endif /* _LINUX_COMPLETION_H_ */ +#endif /* _LINUX_COMPLETION_H_ */ Modified: stable/9/sys/ofed/include/linux/device.h ============================================================================== --- stable/9/sys/ofed/include/linux/device.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/device.h Tue May 5 20:59:43 2015 (r282514) @@ -431,17 +431,6 @@ static inline char *kvasprintf(gfp_t gfp return p; } -static inline char *kasprintf(gfp_t gfp, const char *fmt, ...) -{ - va_list ap; - char *p; - - va_start(ap, fmt); - p = kvasprintf(gfp, fmt, ap); - va_end(ap); - - return p; -} - +char *kasprintf(gfp_t, const char *, ...); #endif /* _LINUX_DEVICE_H_ */ Modified: stable/9/sys/ofed/include/linux/dma-mapping.h ============================================================================== --- stable/9/sys/ofed/include/linux/dma-mapping.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/dma-mapping.h Tue May 5 20:59:43 2015 (r282514) @@ -139,6 +139,14 @@ dma_alloc_coherent(struct device *dev, s *dma_handle = 0; return (mem); } + +static inline void * +dma_zalloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, + gfp_t flag) +{ + + return (dma_alloc_coherent(dev, size, dma_handle, flag | __GFP_ZERO)); +} static inline void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, Modified: stable/9/sys/ofed/include/linux/etherdevice.h ============================================================================== --- stable/9/sys/ofed/include/linux/etherdevice.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/etherdevice.h Tue May 5 20:59:43 2015 (r282514) @@ -89,6 +89,9 @@ static inline bool is_valid_ether_addr(c return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); } - +static inline void ether_addr_copy(u8 *dst, const u8 *src) +{ + memcpy(dst, src, 6); +} #endif /* _LINUX_ETHERDEVICE */ Modified: stable/9/sys/ofed/include/linux/fs.h ============================================================================== --- stable/9/sys/ofed/include/linux/fs.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/fs.h Tue May 5 20:59:43 2015 (r282514) @@ -29,6 +29,8 @@ #ifndef _LINUX_FS_H_ #define _LINUX_FS_H_ +#include +#include #include #include #include Modified: stable/9/sys/ofed/include/linux/gfp.h ============================================================================== --- stable/9/sys/ofed/include/linux/gfp.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/gfp.h Tue May 5 20:59:43 2015 (r282514) @@ -30,6 +30,8 @@ #ifndef _LINUX_GFP_H_ #define _LINUX_GFP_H_ +#include +#include #include #include @@ -103,6 +105,13 @@ __free_pages(void *p, unsigned int order kmem_free(kmem_map, (vm_offset_t)p, size); } +static inline void free_pages(uintptr_t addr, unsigned int order) +{ + if (addr == 0) + return; + __free_pages(virt_to_page((void *)addr), order); +} + /* * Alloc pages allocates directly from the buddy allocator on linux so * order specifies a power of two bucket of pages and the results @@ -122,6 +131,16 @@ alloc_pages(gfp_t gfp_mask, unsigned int return (virt_to_page(page)); } +static inline uintptr_t __get_free_pages(gfp_t gfp_mask, unsigned int order) +{ + struct page *page; + + page = alloc_pages(gfp_mask, order); + if (page == NULL) + return (0); + return ((uintptr_t)page_address(page)); +} + #define alloc_pages_node(node, mask, order) alloc_pages(mask, order) #define kmalloc_node(chunk, mask, node) kmalloc(chunk, mask) Modified: stable/9/sys/ofed/include/linux/in.h ============================================================================== --- stable/9/sys/ofed/include/linux/in.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/in.h Tue May 5 20:59:43 2015 (r282514) @@ -31,6 +31,9 @@ #include "opt_inet.h" +#include +#include +#include #include #include Modified: stable/9/sys/ofed/include/linux/io.h ============================================================================== --- stable/9/sys/ofed/include/linux/io.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/io.h Tue May 5 20:59:43 2015 (r282514) @@ -31,6 +31,7 @@ #define _LINUX_IO_H_ #include +#include static inline uint32_t __raw_readl(const volatile void *addr) @@ -89,6 +90,20 @@ writew(uint16_t b, void *addr) *(volatile uint16_t *)addr = b; } +#undef ioread32be +static inline uint32_t +ioread32be(const volatile void *addr) +{ + return be32toh(*(const volatile uint32_t *)addr); +} + +#undef iowrite32be +static inline void +iowrite32be(uint32_t v, volatile void *addr) +{ + *(volatile uint32_t *)addr = htobe32(v); +} + void *_ioremap_attr(vm_paddr_t phys_addr, unsigned long size, int attr); #define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) Modified: stable/9/sys/ofed/include/linux/jiffies.h ============================================================================== --- stable/9/sys/ofed/include/linux/jiffies.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/jiffies.h Tue May 5 20:59:43 2015 (r282514) @@ -45,14 +45,12 @@ msecs_to_jiffies(int msec) return (tvtohz(&tv)); } - #define jiffies ticks #define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz) - -#define time_after(a, b) ((long)(b) - (long)(a) < 0) +#define time_after(a, b) ((int)((b) - (a)) < 0) #define time_before(a, b) time_after(b,a) -#define time_after_eq(a, b) ((long)(a) - (long)(b) >= 0) +#define time_after_eq(a, b) ((int)((a) - (b)) >= 0) #define time_before_eq(a, b) time_after_eq(b, a) #define HZ hz Modified: stable/9/sys/ofed/include/linux/kernel.h ============================================================================== --- stable/9/sys/ofed/include/linux/kernel.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/kernel.h Tue May 5 20:59:43 2015 (r282514) @@ -29,6 +29,8 @@ #ifndef _LINUX_KERNEL_H_ #define _LINUX_KERNEL_H_ +#include +#include #include #include #include @@ -57,6 +59,8 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" +#define BUILD_BUG_ON(x) CTASSERT(!(x)) + #define BUG() panic("BUG") #define BUG_ON(condition) do { if (condition) BUG(); } while(0) #define WARN_ON BUG_ON @@ -66,6 +70,7 @@ #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define DIV_ROUND_UP howmany +#define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) #define printk(X...) printf(X) @@ -86,6 +91,7 @@ #endif #define udelay(t) DELAY(t) +#define usleep_range(min,max) DELAY(min) #ifndef pr_fmt #define pr_fmt(fmt) fmt @@ -172,6 +178,7 @@ #define round_down(x, y) ((x) & ~__round_mask(x, y)) #define num_possible_cpus() mp_ncpus +#define num_online_cpus() mp_ncpus typedef struct pm_message { int event; Modified: stable/9/sys/ofed/include/linux/kref.h ============================================================================== --- stable/9/sys/ofed/include/linux/kref.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/kref.h Tue May 5 20:59:43 2015 (r282514) @@ -29,6 +29,7 @@ #ifndef _LINUX_KREF_H_ #define _LINUX_KREF_H_ +#include #include struct kref { Modified: stable/9/sys/ofed/include/linux/ktime.h ============================================================================== --- stable/9/sys/ofed/include/linux/ktime.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/ktime.h Tue May 5 20:59:43 2015 (r282514) @@ -288,4 +288,13 @@ static inline s64 ktime_to_ns(const ktim #endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ +static inline s64 ktime_get_ns(void) +{ + struct timespec ts; + ktime_t kt; + ktime_get_ts(&ts); + kt = timespec_to_ktime(ts); + return (ktime_to_ns(kt)); +} + #endif /* _LINUX_KTIME_H */ Modified: stable/9/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/9/sys/ofed/include/linux/linux_compat.c Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/linux_compat.c Tue May 5 20:59:43 2015 (r282514) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -55,6 +57,8 @@ #include #include #include +#include +#include #include @@ -66,20 +70,17 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux #undef file #undef cdev #define RB_ROOT(head) (head)->rbh_root -#undef LIST_HEAD -/* From sys/queue.h */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} struct kobject class_root; struct device linux_rootdev; struct class miscclass; struct list_head pci_drivers; struct list_head pci_devices; +struct net init_net; spinlock_t pci_lock; +unsigned long linux_timer_hz_mask; + int panic_cmp(struct rb_node *one, struct rb_node *two) { @@ -595,7 +596,9 @@ struct vmmap { unsigned long vm_size; }; -LIST_HEAD(vmmaphd, vmmap); +struct vmmaphd { + struct vmmap *lh_first; +}; #define VMMAP_HASH_SIZE 64 #define VMMAP_HASH_MASK (VMMAP_HASH_SIZE - 1) #define VM_HASH(addr) ((uintptr_t)(addr) >> PAGE_SHIFT) & VMMAP_HASH_MASK @@ -686,6 +689,185 @@ vunmap(void *addr) kfree(vmmap); } + +char * +kasprintf(gfp_t gfp, const char *fmt, ...) +{ + va_list ap; + char *p; + + va_start(ap, fmt); + p = kvasprintf(gfp, fmt, ap); + va_end(ap); + + return p; +} + +static int +linux_timer_jiffies_until(unsigned long expires) +{ + int delta = expires - jiffies; + /* guard against already expired values */ + if (delta < 1) + delta = 1; + return (delta); +} + +static void +linux_timer_callback_wrapper(void *context) +{ + struct timer_list *timer; + + timer = context; + timer->function(timer->data); +} + +void +mod_timer(struct timer_list *timer, unsigned long expires) +{ + + timer->expires = expires; + callout_reset(&timer->timer_callout, + linux_timer_jiffies_until(expires), + &linux_timer_callback_wrapper, timer); +} + +void +add_timer(struct timer_list *timer) +{ + + callout_reset(&timer->timer_callout, + linux_timer_jiffies_until(timer->expires), + &linux_timer_callback_wrapper, timer); +} + +static void +linux_timer_init(void *arg) +{ + + /* + * Compute an internal HZ value which can divide 2**32 to + * avoid timer rounding problems when the tick value wraps + * around 2**32: + */ + linux_timer_hz_mask = 1; + while (linux_timer_hz_mask < (unsigned long)hz) + linux_timer_hz_mask *= 2; + linux_timer_hz_mask--; +} +SYSINIT(linux_timer, SI_SUB_DRIVERS, SI_ORDER_FIRST, linux_timer_init, NULL); + +void +linux_complete_common(struct completion *c, int all) +{ + int wakeup_swapper; + + sleepq_lock(c); + c->done++; + if (all) + wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); + else + wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); + sleepq_release(c); + if (wakeup_swapper) + kick_proc0(); +} + +/* + * Indefinite wait for done != 0 with or without signals. + */ +long +linux_wait_for_common(struct completion *c, int flags) +{ + + if (flags != 0) + flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; + else + flags = SLEEPQ_SLEEP; + for (;;) { + sleepq_lock(c); + if (c->done) + break; + sleepq_add(c, NULL, "completion", flags, 0); + if (flags & SLEEPQ_INTERRUPTIBLE) { + if (sleepq_wait_sig(c, 0) != 0) + return (-ERESTARTSYS); + } else + sleepq_wait(c, 0); + } + c->done--; + sleepq_release(c); + + return (0); +} + +/* + * Time limited wait for done != 0 with or without signals. + */ +long +linux_wait_for_timeout_common(struct completion *c, long timeout, int flags) +{ + long end = jiffies + timeout; + + if (flags != 0) + flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; + else + flags = SLEEPQ_SLEEP; + for (;;) { + int ret; + + sleepq_lock(c); + if (c->done) + break; + sleepq_add(c, NULL, "completion", flags, 0); + sleepq_set_timeout(c, linux_timer_jiffies_until(end)); + if (flags & SLEEPQ_INTERRUPTIBLE) + ret = sleepq_timedwait_sig(c, 0); + else + ret = sleepq_timedwait(c, 0); + if (ret != 0) { + /* check for timeout or signal */ + if (ret == EWOULDBLOCK) + return (0); + else + return (-ERESTARTSYS); + } + } + c->done--; + sleepq_release(c); + + /* return how many jiffies are left */ + return (linux_timer_jiffies_until(end)); +} + +int +linux_try_wait_for_completion(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done) + c->done--; + else + isdone = 0; + sleepq_release(c); + return (isdone); +} + +int +linux_completion_done(struct completion *c) +{ + int isdone; + + isdone = 1; + sleepq_lock(c); + if (c->done == 0) + isdone = 0; + sleepq_release(c); + return (isdone); +} + static void linux_compat_init(void *arg) { Modified: stable/9/sys/ofed/include/linux/log2.h ============================================================================== --- stable/9/sys/ofed/include/linux/log2.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/log2.h Tue May 5 20:59:43 2015 (r282514) @@ -167,4 +167,6 @@ int __ilog2_u64(u64 n) __ilog2_u64(n) \ ) +#define order_base_2(x) ilog2(roundup_pow_of_two(x)) + #endif /* _LINUX_LOG2_H_ */ Modified: stable/9/sys/ofed/include/linux/pci.h ============================================================================== --- stable/9/sys/ofed/include/linux/pci.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/pci.h Tue May 5 20:59:43 2015 (r282514) @@ -270,6 +270,14 @@ pci_set_master(struct pci_dev *pdev) } static inline int +pci_clear_master(struct pci_dev *pdev) +{ + + pci_disable_busmaster(pdev->dev.bsddev); + return (0); +} + +static inline int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name) { int rid; @@ -592,6 +600,30 @@ pci_enable_msix(struct pci_dev *pdev, st return (0); } +#define pci_enable_msix_range linux_pci_enable_msix_range +static inline int +pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, + int minvec, int maxvec) +{ + int nvec = maxvec; + int rc; + + if (maxvec < minvec) + return (-ERANGE); + + do { + rc = pci_enable_msix(dev, entries, nvec); + if (rc < 0) { + return (rc); + } else if (rc > 0) { + if (rc < minvec) + return (-ENOSPC); + nvec = rc; + } + } while (rc); + return (nvec); +} + static inline int pci_channel_offline(struct pci_dev *pdev) { return false; Modified: stable/9/sys/ofed/include/linux/slab.h ============================================================================== --- stable/9/sys/ofed/include/linux/slab.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/slab.h Tue May 5 20:59:43 2015 (r282514) @@ -40,6 +40,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) +#define kvmalloc(size) kmalloc((size), 0) #define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO) #define kzalloc_node(size, flags, node) kzalloc(size, flags) #define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) @@ -47,6 +48,7 @@ MALLOC_DECLARE(M_KMALLOC); #define kcalloc(n, size, flags) kmalloc((n) * (size), flags | M_ZERO) #define vzalloc(size) kzalloc(size, GFP_KERNEL | __GFP_NOWARN) #define vfree(arg) kfree(arg) +#define kvfree(arg) kfree(arg) #define vmalloc(size) kmalloc(size, GFP_KERNEL) #define vmalloc_node(size, node) kmalloc(size, GFP_KERNEL) Modified: stable/9/sys/ofed/include/linux/timer.h ============================================================================== --- stable/9/sys/ofed/include/linux/timer.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/linux/timer.h Tue May 5 20:59:43 2015 (r282514) @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _LINUX_TIMER_H_ -#define _LINUX_TIMER_H_ +#define _LINUX_TIMER_H_ #include @@ -36,20 +36,13 @@ #include struct timer_list { - struct callout timer_callout; - void (*function)(unsigned long); - unsigned long data; - unsigned long expires; + struct callout timer_callout; + void (*function) (unsigned long); + unsigned long data; + unsigned long expires; }; -static inline void -_timer_fn(void *context) -{ - struct timer_list *timer; - - timer = context; - timer->function(timer->data); -} +extern unsigned long linux_timer_hz_mask; #define setup_timer(timer, func, dat) \ do { \ @@ -65,28 +58,15 @@ do { \ callout_init(&(timer)->timer_callout, CALLOUT_MPSAFE); \ } while (0) -#define mod_timer(timer, exp) \ -do { \ - (timer)->expires = (exp); \ - callout_reset(&(timer)->timer_callout, (exp) - jiffies, \ - _timer_fn, (timer)); \ -} while (0) - -#define add_timer(timer) \ - callout_reset(&(timer)->timer_callout, \ - (timer)->expires - jiffies, _timer_fn, (timer)) +extern void mod_timer(struct timer_list *, unsigned long); +extern void add_timer(struct timer_list *); #define del_timer(timer) callout_stop(&(timer)->timer_callout) #define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) - #define timer_pending(timer) callout_pending(&(timer)->timer_callout) +#define round_jiffies(j) \ + ((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) +#define round_jiffies_relative(j) \ + round_jiffies(j) -static inline unsigned long -round_jiffies(unsigned long j) -{ - return roundup(j, hz); -} - -#define round_jiffies_relative(j) round_jiffies(j) - -#endif /* _LINUX_TIMER_H_ */ +#endif /* _LINUX_TIMER_H_ */ Modified: stable/9/sys/ofed/include/net/ip.h ============================================================================== --- stable/9/sys/ofed/include/net/ip.h Tue May 5 20:58:12 2015 (r282513) +++ stable/9/sys/ofed/include/net/ip.h Tue May 5 20:59:43 2015 (r282514) @@ -42,13 +42,17 @@ #include #include -#ifdef INET static inline void inet_get_local_port_range(int *low, int *high) { +#ifdef INET CURVNET_SET_QUIET(TD_TO_VNET(curthread)); *low = V_ipport_firstauto; *high = V_ipport_lastauto; CURVNET_RESTORE(); +#else + *low = IPPORT_EPHEMERALFIRST; /* 10000 */ + *high = IPPORT_EPHEMERALLAST; /* 65535 */ +#endif } static inline void @@ -79,6 +83,5 @@ ip_ib_mc_map(uint32_t addr, const unsign buf[18] = (addr >> 8) & 0xff; buf[19] = addr & 0xff; } -#endif #endif /* _LINUX_NET_IP_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue May 5 21:08:52 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 369F5A3; Tue, 5 May 2015 21:08: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 0B64E1B19; Tue, 5 May 2015 21:08: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 t45L8pAF013108; Tue, 5 May 2015 21:08:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45L8pFw013105; Tue, 5 May 2015 21:08:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201505052108.t45L8pFw013105@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 5 May 2015 21:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282515 - in head/release: arm tools/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 21:08:52 -0000 Author: gjb Date: Tue May 5 21:08:50 2015 New Revision: 282515 URL: https://svnweb.freebsd.org/changeset/base/282515 Log: Fix building BEAGLEBONE images with Crochet using the sysutils/u-boot-beaglebone port: - In arm/BEAGLEBONE.conf, set EMBEDDEDPORTS to the sysutils/u-boot-beaglebone port. - In arm/release.sh, remove BEAGLEBONE from setting WANT_UBOOT - In tools/arm/crochet-BEAGLEBONE.conf, override the beaglebone_check_uboot(), and set BEAGLEBONE_UBOOT to /tmp/external/u-boot-beaglebone, and create symlinks to the u-boot files in /usr/local/share/u-boot-beaglebone and the uEnv.txt file in crochet/board/Beaglebone/files. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/release.sh head/release/tools/arm/crochet-BEAGLEBONE.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Tue May 5 20:59:43 2015 (r282514) +++ head/release/arm/BEAGLEBONE.conf Tue May 5 21:08:50 2015 (r282515) @@ -13,6 +13,7 @@ export WORLD_FLAGS="-j $(sysctl -n hw.nc export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" export CHROOTDIR="/scratch" export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="sysutils/u-boot-beaglebone" # Build chroot configuration load_chroot_env() { Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Tue May 5 20:59:43 2015 (r282514) +++ head/release/arm/release.sh Tue May 5 21:08:50 2015 (r282515) @@ -42,11 +42,6 @@ before_build() { KNOWNHASH= UBOOT_VERSION= case ${KERNEL} in - BEAGLEBONE) - WANT_UBOOT=1 - KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31" - UBOOT_VERSION="u-boot-2014.04" - ;; PANDABOARD) WANT_UBOOT=1 KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496" Modified: head/release/tools/arm/crochet-BEAGLEBONE.conf ============================================================================== --- head/release/tools/arm/crochet-BEAGLEBONE.conf Tue May 5 20:59:43 2015 (r282514) +++ head/release/tools/arm/crochet-BEAGLEBONE.conf Tue May 5 21:08:50 2015 (r282515) @@ -27,3 +27,14 @@ FREEBSD_WORLD_EXTRA_ARGS="" FREEBSD_KERNEL_EXTRA_ARGS="" FREEBSD_EXTRA_ARGS="" IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img +BEAGLEBONE_UBOOT=/tmp/external/u-boot-beaglebone + +beaglebone_check_uboot() { + mkdir -p "${BEAGLEBONE_UBOOT}" + ln -fs /usr/local/share/u-boot/u-boot-beaglebone/MLO \ + ${BEAGLEBONE_UBOOT}/MLO + ln -fs /usr/local/share/u-boot/u-boot-beaglebone/u-boot.img \ + ${BEAGLEBONE_UBOOT}/bb-uboot.img + ln -fs ${BOARDDIR}/files/uEnv.txt \ + ${BEAGLEBONE_UBOOT}/bb-uenv.txt +} From owner-svn-src-all@FreeBSD.ORG Tue May 5 23:27:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8687D23; Tue, 5 May 2015 23:27: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 89D7A1B09; Tue, 5 May 2015 23:27: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 t45NRpgt081281; Tue, 5 May 2015 23:27:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45NRo7t081277; Tue, 5 May 2015 23:27:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505052327.t45NRo7t081277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 May 2015 23:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282516 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 23:27:51 -0000 Author: ian Date: Tue May 5 23:27:49 2015 New Revision: 282516 URL: https://svnweb.freebsd.org/changeset/base/282516 Log: Add the code necessary to run the imx6 chip at its lowest clock/power operating point (396MHz/950mV). Modified: head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx6_anatop.c Tue May 5 23:27:49 2015 (r282516) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -116,12 +117,16 @@ static struct imx6_anatop_softc *imx6_an /* * Table of "operating points". * These are combinations of frequency and voltage blessed by Freescale. + * While the datasheet says the ARM voltage can be as low as 925mV at + * 396MHz, it also says that the ARM and SOC voltages can't differ by + * more than 200mV, and the minimum SOC voltage is 1150mV, so that + * dictates the 950mV entry in this table. */ static struct oppt { uint32_t mhz; uint32_t mv; } imx6_oppt_table[] = { -/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 396, 950}, { 792, 1150}, { 852, 1225}, { 996, 1225}, @@ -158,14 +163,15 @@ imx6_anatop_write_4(bus_size_t offset, u static void vdd_set(struct imx6_anatop_softc *sc, int mv) { - int newtarg, oldtarg; + int newtarg, newtargSoc, oldtarg; uint32_t delay, pmureg; static boolean_t init_done = false; /* * The datasheet says VDD_PU and VDD_SOC must be equal, and VDD_ARM - * can't be more than 50mV above or 200mV below them. For now to keep - * things simple we set all three to the same value. + * can't be more than 50mV above or 200mV below them. We keep them the + * same except in the case of the lowest operating point, which is + * handled as a special case below. */ pmureg = imx6_anatop_read_4(IMX6_ANALOG_PMU_REG_CORE); @@ -180,19 +186,29 @@ vdd_set(struct imx6_anatop_softc *sc, in newtarg = (mv - 700) / 25; /* + * The SOC voltage can't go below 1150mV, and thus because of the 200mV + * rule, the ARM voltage can't go below 950mV. The 950 is encoded in + * our oppt table, here we handle the SOC 1150 rule as a special case. + * (1150-700/25=18). + */ + newtargSoc = (newtarg < 18) ? 18 : newtarg; + + /* * The first time through the 3 voltages might not be equal so use a * long conservative delay. After that we need to delay 3uS for every - * 25mV step upward. No need to delay at all when lowering. + * 25mV step upward; we actually delay 6uS because empirically, it works + * and the 3uS per step recommended by the docs doesn't (3uS fails when + * going from 400->1200, but works for smaller changes). */ if (init_done) { if (newtarg == oldtarg) return; else if (newtarg > oldtarg) - delay = (newtarg - oldtarg) * 3; + delay = (newtarg - oldtarg) * 6; else delay = 0; } else { - delay = 700 / 25 * 3; + delay = (700 / 25) * 6; init_done = true; } @@ -205,7 +221,7 @@ vdd_set(struct imx6_anatop_softc *sc, in pmureg |= newtarg << IMX6_ANALOG_PMU_REG0_TARG_SHIFT; pmureg |= newtarg << IMX6_ANALOG_PMU_REG1_TARG_SHIFT; - pmureg |= newtarg << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; + pmureg |= newtargSoc << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); @@ -213,24 +229,29 @@ vdd_set(struct imx6_anatop_softc *sc, in } static inline uint32_t -cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t corediv, + uint32_t plldiv) { - return (sc->refosc_mhz * (div / 2)); + return ((sc->refosc_mhz * (plldiv / 2)) / (corediv + 1)); } -static inline uint32_t -cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) +static inline void +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz, + uint32_t *corediv, uint32_t *plldiv) { - return (cpu_mhz / (sc->refosc_mhz / 2)); + *corediv = (cpu_mhz < 650) ? 1 : 0; + *plldiv = ((*corediv + 1) * cpu_mhz) / (sc->refosc_mhz / 2); } static inline uint32_t cpufreq_actual_mhz(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { + uint32_t corediv, plldiv; - return (cpufreq_mhz_from_div(sc, cpufreq_mhz_to_div(sc, cpu_mhz))); + cpufreq_mhz_to_div(sc, cpu_mhz, &corediv, &plldiv); + return (cpufreq_mhz_from_div(sc, corediv, plldiv)); } static struct oppt * @@ -256,7 +277,7 @@ cpufreq_nearest_oppt(struct imx6_anatop_ static void cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) { - uint32_t timeout, wrk32; + uint32_t corediv, plldiv, timeout, wrk32; /* If increasing the frequency, we must first increase the voltage. */ if (op->mhz > sc->cpu_curmhz) { @@ -272,6 +293,7 @@ cpufreq_set_clock(struct imx6_anatop_sof * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. * - Turn off bypass mode; cpu should now be running at the new speed. */ + cpufreq_mhz_to_div(sc, op->mhz, &corediv, &plldiv); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_SET, @@ -279,7 +301,7 @@ cpufreq_set_clock(struct imx6_anatop_sof wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - wrk32 |= cpufreq_mhz_to_div(sc, op->mhz); + wrk32 |= plldiv; imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); timeout = 10000; @@ -290,6 +312,7 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + imx_ccm_set_cacrr(corediv); /* If lowering the frequency, it is now safe to lower the voltage. */ if (op->mhz < sc->cpu_curmhz) @@ -297,7 +320,7 @@ cpufreq_set_clock(struct imx6_anatop_sof sc->cpu_curmhz = op->mhz; /* Tell the mpcore timer that its frequency has changed. */ - arm_tmr_change_frequency( + arm_tmr_change_frequency( cpufreq_actual_mhz(sc, sc->cpu_curmhz) * 1000000 / 2); } @@ -748,11 +771,12 @@ imx6_anatop_probe(device_t dev) uint32_t imx6_get_cpu_clock() { - uint32_t div; + uint32_t corediv, plldiv; - div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + corediv = imx_ccm_get_cacrr(); + plldiv = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - return (cpufreq_mhz_from_div(imx6_anatop_sc, div)); + return (cpufreq_mhz_from_div(imx6_anatop_sc, corediv, plldiv)); } static device_method_t imx6_anatop_methods[] = { Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx6_ccm.c Tue May 5 23:27:49 2015 (r282516) @@ -320,6 +320,20 @@ imx_ccm_ahb_hz(void) return (132000000); } +uint32_t +imx_ccm_get_cacrr(void) +{ + + return (RD4(ccm_sc, CCM_CACCR)); +} + +void +imx_ccm_set_cacrr(uint32_t divisor) +{ + + WR4(ccm_sc, CCM_CACCR, divisor); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Tue May 5 23:27:49 2015 (r282516) @@ -29,6 +29,7 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H +#define CCM_CACCR 0x010 #define CCM_CSCMR1 0x01C #define SSI1_CLK_SEL_S 10 #define SSI2_CLK_SEL_S 12 @@ -64,6 +65,5 @@ #define CCM_CCGR5 0x07C #define CCM_CCGR6 0x080 #define CCM_CMEOR 0x088 - #endif Modified: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_ccmvar.h Tue May 5 21:08:50 2015 (r282515) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Tue May 5 23:27:49 2015 (r282516) @@ -53,4 +53,8 @@ void imx_ccm_usb_enable(device_t _usbdev void imx_ccm_usbphy_enable(device_t _phydev); void imx_ccm_ssi_configure(device_t _ssidev); +/* Routines to get and set the arm clock root divisor register. */ +uint32_t imx_ccm_get_cacrr(void); +void imx_ccm_set_cacrr(uint32_t _divisor); + #endif From owner-svn-src-all@FreeBSD.ORG Wed May 6 01:08:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15836DB8; Wed, 6 May 2015 01:08: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 EBE6E157B; Wed, 6 May 2015 01:08: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 t46180jb031264; Wed, 6 May 2015 01:08:00 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46180mi031257; Wed, 6 May 2015 01:08:00 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201505060108.t46180mi031257@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 6 May 2015 01:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282517 - head/sys/arm/amlogic/aml8726 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 01:08:01 -0000 Author: ganbold Date: Wed May 6 01:07:59 2015 New Revision: 282517 URL: https://svnweb.freebsd.org/changeset/base/282517 Log: This patch adds support for the extended baud rate register available on the aml8726-m6 (and later) SoC which allows for lower speeds. Differential Revision: https://reviews.freebsd.org/D2433 Submitted by: John Wehle Modified: head/sys/arm/amlogic/aml8726/aml8726_uart.h head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c Modified: head/sys/arm/amlogic/aml8726/aml8726_uart.h ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_uart.h Tue May 5 23:27:49 2015 (r282516) +++ head/sys/arm/amlogic/aml8726/aml8726_uart.h Wed May 6 01:07:59 2015 (r282517) @@ -94,4 +94,14 @@ #define AML_UART_MISC_RECV_IRQ_CNT_MASK 0xff #define AML_UART_MISC_RECV_IRQ_CNT_SHIFT 0 +/* + * The new baud rate register is available on the + * aml8726-m6 and later. + */ +#define AML_UART_NEW_BAUD_REG 20 +#define AML_UART_NEW_BAUD_USE_XTAL_CLK (1 << 24) +#define AML_UART_NEW_BAUD_RATE_EN (1 << 23) +#define AML_UART_NEW_BAUD_RATE_MASK (0x7fffff << 0) +#define AML_UART_NEW_BAUD_RATE_SHIFT 0 + #endif /* _ARM_AMLOGIC_AML8726_UART_H */ Modified: head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c ============================================================================== --- head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c Tue May 5 23:27:49 2015 (r282516) +++ head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c Wed May 6 01:07:59 2015 (r282517) @@ -31,8 +31,8 @@ * uarts. For example ... though UART A as a 128 byte FIFO, the * others only have a 64 byte FIFO. * - * Also, it's assumed that register 5 (the new baud rate register - * present on the aml8726-m6) has not been activated. + * Also, it's assumed that the USE_XTAL_CLK feature (available on + * the aml8726-m6 and later) has not been activated. */ #include @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "uart_if.h" @@ -89,7 +90,7 @@ aml8726_uart_divisor(int rclk, int baudr /* integer version of (rclk / baudrate + .5) */ divisor = ((rclk << 1) + baudrate) / (baudrate << 1); - if (divisor == 0 || divisor >= 65536) + if (divisor == 0) return (0); actual_baud = rclk / divisor; @@ -109,6 +110,7 @@ aml8726_uart_param(struct uart_bas *bas, { uint32_t cr; uint32_t mr; + uint32_t nbr; int divisor; cr = uart_getreg(bas, AML_UART_CONTROL_REG); @@ -147,8 +149,29 @@ aml8726_uart_param(struct uart_bas *bas, /* Set baudrate. */ if (baudrate > 0 && bas->rclk != 0) { divisor = aml8726_uart_divisor(bas->rclk / 4, baudrate) - 1; - if (divisor > 0xffff) - return (EINVAL); + + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + if (divisor > (AML_UART_NEW_BAUD_RATE_MASK >> + AML_UART_NEW_BAUD_RATE_SHIFT)) + return (EINVAL); + + nbr = uart_getreg(bas, AML_UART_NEW_BAUD_REG); + nbr &= ~(AML_UART_NEW_BAUD_USE_XTAL_CLK | + AML_UART_NEW_BAUD_RATE_MASK); + nbr |= AML_UART_NEW_BAUD_RATE_EN | + (divisor << AML_UART_NEW_BAUD_RATE_SHIFT); + uart_setreg(bas, AML_UART_NEW_BAUD_REG, nbr); + + divisor = 0; + break; + default: + if (divisor > 0xffff) + return (EINVAL); + break; + } cr &= ~AML_UART_CONTROL_BAUD_MASK; cr |= (divisor & AML_UART_CONTROL_BAUD_MASK); @@ -187,7 +210,7 @@ aml8726_uart_init(struct uart_bas *bas, uint32_t cr; uint32_t mr; - aml8726_uart_param(bas, baudrate, databits, stopbits, parity); + (void)aml8726_uart_param(bas, baudrate, databits, stopbits, parity); cr = uart_getreg(bas, AML_UART_CONTROL_REG); /* Disable all interrupt sources. */ @@ -466,7 +489,7 @@ aml8726_uart_bus_ioctl(struct uart_softc { struct uart_bas *bas; int baudrate, divisor, error; - uint32_t cr, mr; + uint32_t cr, mr, nbr; bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); @@ -483,6 +506,20 @@ aml8726_uart_bus_ioctl(struct uart_softc divisor = ((mr >> AML_UART_MISC_BAUD_EXT_SHIFT) << AML_UART_CONTROL_BAUD_WIDTH) | cr; + switch (aml8726_soc_hw_rev) { + case AML_SOC_HW_REV_M6: + case AML_SOC_HW_REV_M8: + case AML_SOC_HW_REV_M8B: + nbr = uart_getreg(bas, AML_UART_NEW_BAUD_REG); + if ((nbr & AML_UART_NEW_BAUD_RATE_EN) != 0) { + divisor = (nbr & AML_UART_NEW_BAUD_RATE_MASK) >> + AML_UART_NEW_BAUD_RATE_SHIFT; + } + break; + default: + break; + } + baudrate = bas->rclk / 4 / (divisor + 1); if (baudrate > 0) *(int*)data = baudrate; From owner-svn-src-all@FreeBSD.ORG Wed May 6 01:29:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A5313F6; Wed, 6 May 2015 01:29: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 68B99176B; Wed, 6 May 2015 01:29: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 t461TWbu041490; Wed, 6 May 2015 01:29:32 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t461TWir041489; Wed, 6 May 2015 01:29:32 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201505060129.t461TWir041489@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Wed, 6 May 2015 01:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282518 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 01:29:32 -0000 Author: osa (ports committer) Date: Wed May 6 01:29:31 2015 New Revision: 282518 URL: https://svnweb.freebsd.org/changeset/base/282518 Log: Fix DragonFly 4.0.5 release date. Reported by: vangyzen Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed May 6 01:07:59 2015 (r282517) +++ head/share/misc/bsd-family-tree Wed May 6 01:29:31 2015 (r282518) @@ -670,7 +670,7 @@ DragonFly 4.0.1 2014-11-25 [DFB] DragonFly 4.0.2 2015-01-07 [DFB] DragonFly 4.0.3 2015-01-21 [DFB] DragonFly 4.0.4 2015-03-09 [DFB] -DragonFly 4.0.5 2015-01-23 [DFB] +DragonFly 4.0.5 2015-03-23 [DFB] OpenBSD 5.7 2015-05-01 [OBD] Bibliography From owner-svn-src-all@FreeBSD.ORG Wed May 6 04:57:31 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 251E57C3; Wed, 6 May 2015 04:57:31 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 150181DCA; Wed, 6 May 2015 04:57:30 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-241-118.lns20.per4.internode.on.net [121.45.241.118]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t464vOq1041460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 5 May 2015 21:57:27 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <55499F2F.2000806@freebsd.org> Date: Wed, 06 May 2015 12:57:19 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282468 - head/usr.bin/checknr References: <201505050954.t459slxm078725@svn.freebsd.org> In-Reply-To: <201505050954.t459slxm078725@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 04:57:31 -0000 On 5/5/15 5:54 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Tue May 5 09:54:47 2015 > New Revision: 282468 > URL: https://svnweb.freebsd.org/changeset/base/282468 > > Log: > Enlarge the buffer for storing macros as some macros can be longer than 5 > > Modified: > head/usr.bin/checknr/checknr.c > > Modified: head/usr.bin/checknr/checknr.c > ============================================================================== > --- head/usr.bin/checknr/checknr.c Tue May 5 09:50:21 2015 (r282467) > +++ head/usr.bin/checknr/checknr.c Tue May 5 09:54:47 2015 (r282468) > @@ -313,7 +313,7 @@ static void > process(FILE *f) > { > int i, n; > - char mac[5]; /* The current macro or nroff command */ > + char mac[512]; /* The current macro or nroff command */ 5 to 512 ?? if 5 was almost enough. why not 64 or 50? > char *line; > size_t linecap; > int pl; > > > From owner-svn-src-all@FreeBSD.ORG Wed May 6 05:04:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24B6298B; Wed, 6 May 2015 05:04:15 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C44541EA4; Wed, 6 May 2015 05:04:14 +0000 (UTC) Received: by wief7 with SMTP id f7so116372697wie.0; Tue, 05 May 2015 22:04:12 -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=4xiSbmAJo/45WNBqAVxbDHYg09ll4dqecUWSlBgc650=; b=v2raEgNt9hM5rurt6kHJEG3x1TLwStS6rGEP25V7ocYaoYALOUnJSLDzTb444ssOqr fuVFHsLmrjJukHXjDYGmfT9UWbefNNwBpDf877lraN+19Nsv/9NKC2awyCpw1wGooLip M3RfnAnOueSOVhN1tymY0+nsM2k3F09EbfJ7RCH6oFigMblBwdxNBcAW7Cd0rAC3sIAl jRezkeqVg5x/wytiPggSEAH2koG09TUSHS4fx1gfm2l375Dciy3sN/E4F6BtpWNFWNeF 9doIPxwtvrqd5RoOgvLtddPiBs2wsTAG9zA296aTidDx8ak/FM2DcBuZFySNdTjFyt6t YBZg== MIME-Version: 1.0 X-Received: by 10.195.11.165 with SMTP id ej5mr12398452wjd.127.1430888652219; Tue, 05 May 2015 22:04:12 -0700 (PDT) Received: by 10.27.52.18 with HTTP; Tue, 5 May 2015 22:04:12 -0700 (PDT) In-Reply-To: <201505041955.t44Jt28d008533@svn.freebsd.org> References: <201505041955.t44Jt28d008533@svn.freebsd.org> Date: Tue, 5 May 2015 22:04:12 -0700 Message-ID: Subject: Re: svn commit: r282429 - head/usr.sbin/bhyve From: Neel Natu To: Alexander Motin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:04:15 -0000 Hi Alexander, I am getting the following error(?) messages with an ahci-cd device on Centos 6.4 x86_64: ata1.00: qc timeout (cmd 0xa0) ata1: limiting SATA link speed to 1.5 Gbps ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen ata1.00: irq_stat 0x40000001 sr 0:0:0:0: [sr0] CDB: Get configuration: 46 00 00 00 00 00 00 00 08 00 ata1.00: cmd a0/00:00:00:08:00/00:00:00:00:00/a0 tag 0 pio 16392 in res 41/50:00:03:08:00/00:00:00:00:00/a0 Emask 0x5 (timeout) ata1.00: status: { DRDY ERR } ata1: hard resetting link ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata1.00: configured for UDMA/133 ata1: EH complete I have the boot log for the r282364 (working) and r282429 (not working) here: https://people.freebsd.org/~neel/bhyve/r282364_working.txt https://people.freebsd.org/~neel/bhyve/r282429_not_working.txt Any idea what the problem is? best Neel On Mon, May 4, 2015 at 12:55 PM, Alexander Motin wrote: > Author: mav > Date: Mon May 4 19:55:01 2015 > New Revision: 282429 > URL: https://svnweb.freebsd.org/changeset/base/282429 > > Log: > Implement in-order execution of non-NCQ commands. > > Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. > This can be a performance penalization for non-NCQ commands, but it is > required for proper error recovery and standard compliance. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/bhyve/pci_ahci.c > > Modified: head/usr.sbin/bhyve/pci_ahci.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:34:59 2015 (r282428) > +++ head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:55:01 2015 (r282429) > @@ -140,6 +140,7 @@ struct ahci_port { > uint8_t err_cfis[20]; > uint8_t sense_key; > uint8_t asc; > + u_int ccs; > uint32_t pending; > > uint32_t clb; > @@ -204,6 +205,8 @@ struct pci_ahci_softc { > }; > #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) > > +static void ahci_handle_port(struct ahci_port *p); > + > static inline void lba_to_msf(uint8_t *buf, int lba) > { > lba += 150; > @@ -406,6 +409,7 @@ ahci_check_stopped(struct ahci_port *p) > */ > if (!(p->cmd & AHCI_P_CMD_ST)) { > if (p->pending == 0) { > + p->ccs = 0; > p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); > p->ci = 0; > p->sact = 0; > @@ -783,6 +787,8 @@ next: > ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); > p->pending &= ~(1 << slot); > ahci_check_stopped(p); > + if (!first) > + ahci_handle_port(p); > return; > } > goto next; > @@ -1754,20 +1760,21 @@ ahci_handle_slot(struct ahci_port *p, in > static void > ahci_handle_port(struct ahci_port *p) > { > - int i; > > if (!(p->cmd & AHCI_P_CMD_ST)) > return; > > /* > * Search for any new commands to issue ignoring those that > - * are already in-flight. > + * are already in-flight. Stop if device is busy or in error. > */ > - for (i = 0; (i < 32) && p->ci; i++) { > - if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) { > + for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { > + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) > + break; > + if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { > p->cmd &= ~AHCI_P_CMD_CCS_MASK; > - p->cmd |= i << AHCI_P_CMD_CCS_SHIFT; > - ahci_handle_slot(p, i); > + p->cmd |= p->ccs << AHCI_P_CMD_CCS_SHIFT; > + ahci_handle_slot(p, p->ccs); > } > } > } > @@ -1844,6 +1851,7 @@ ata_ioreq_cb(struct blockif_req *br, int > p->pending &= ~(1 << slot); > > ahci_check_stopped(p); > + ahci_handle_port(p); > out: > pthread_mutex_unlock(&sc->mtx); > DPRINTF("%s exit\n", __func__); > @@ -1905,6 +1913,7 @@ atapi_ioreq_cb(struct blockif_req *br, i > p->pending &= ~(1 << slot); > > ahci_check_stopped(p); > + ahci_handle_port(p); > out: > pthread_mutex_unlock(&sc->mtx); > DPRINTF("%s exit\n", __func__); > From owner-svn-src-all@FreeBSD.ORG Wed May 6 05:12:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E1E4BD9; Wed, 6 May 2015 05:12: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 5C7381F79; Wed, 6 May 2015 05:12: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 t465CUIS053375; Wed, 6 May 2015 05:12:30 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t465CU6f053374; Wed, 6 May 2015 05:12:30 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505060512.t465CU6f053374@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 05:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282519 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:12:30 -0000 Author: neel Date: Wed May 6 05:12:29 2015 New Revision: 282519 URL: https://svnweb.freebsd.org/changeset/base/282519 Log: Add macros for AMD-specific bits in MSR_EFER: LMSLE, FFXSR and TCE. AMDID_FFXSR is at bit 25 so correct its value to 0x02000000. MFC after: 1 week Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed May 6 01:29:31 2015 (r282518) +++ head/sys/x86/include/specialreg.h Wed May 6 05:12:29 2015 (r282519) @@ -82,6 +82,9 @@ #define EFER_LMA 0x000000400 /* Long mode active (R) */ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ #define EFER_SVM 0x000001000 /* SVM enable bit for AMD, reserved for Intel */ +#define EFER_LMSLE 0x000002000 /* Long Mode Segment Limit Enable */ +#define EFER_FFXSR 0x000004000 /* Fast FXSAVE/FSRSTOR */ +#define EFER_TCE 0x000008000 /* Translation Cache Extension */ /* * Intel Extended Features registers @@ -191,7 +194,7 @@ #define AMDID_MP 0x00080000 #define AMDID_NX 0x00100000 #define AMDID_EXT_MMX 0x00400000 -#define AMDID_FFXSR 0x01000000 +#define AMDID_FFXSR 0x02000000 #define AMDID_PAGE1GB 0x04000000 #define AMDID_RDTSCP 0x08000000 #define AMDID_LM 0x20000000 From owner-svn-src-all@FreeBSD.ORG Wed May 6 05:40:22 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F5AF592; Wed, 6 May 2015 05:40:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20F0111CC; Wed, 6 May 2015 05:40:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t465eLTr064088; Wed, 6 May 2015 05:40:21 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t465eLva064083; Wed, 6 May 2015 05:40:21 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505060540.t465eLva064083@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 05:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282520 - in head/sys/amd64/vmm: . amd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:40:22 -0000 Author: neel Date: Wed May 6 05:40:20 2015 New Revision: 282520 URL: https://svnweb.freebsd.org/changeset/base/282520 Log: Do a proper emulation of guest writes to MSR_EFER. - Must-Be-Zero bits cannot be set. - EFER_LME and EFER_LMA should respect the long mode consistency checks. - EFER_NXE, EFER_FFXSR, EFER_TCE can be set if allowed by CPUID capabilities. - Flag an error if guest tries to set EFER_LMSLE since bhyve doesn't enforce segment limits in 64-bit mode. MFC after: 2 weeks Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/x86.c head/sys/amd64/vmm/x86.h Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed May 6 05:12:29 2015 (r282519) +++ head/sys/amd64/vmm/amd/svm.c Wed May 6 05:40:20 2015 (r282520) @@ -564,6 +564,19 @@ svm_vminit(struct vm *vm, pmap_t pmap) return (svm_sc); } +/* + * Collateral for a generic SVM VM-exit. + */ +static void +vm_exit_svm(struct vm_exit *vme, uint64_t code, uint64_t info1, uint64_t info2) +{ + + vme->exitcode = VM_EXITCODE_SVM; + vme->u.svm.exitcode = code; + vme->u.svm.exitinfo1 = info1; + vme->u.svm.exitinfo2 = info2; +} + static int svm_cpl(struct vmcb_state *state) { @@ -1080,6 +1093,76 @@ clear_nmi_blocking(struct svm_softc *sc, KASSERT(!error, ("%s: error %d setting intr_shadow", __func__, error)); } +#define EFER_MBZ_BITS 0xFFFFFFFFFFFF0200UL + +static int +svm_write_efer(struct svm_softc *sc, int vcpu, uint64_t newval, bool *retu) +{ + struct vm_exit *vme; + struct vmcb_state *state; + uint64_t changed, lma, oldval; + int error; + + state = svm_get_vmcb_state(sc, vcpu); + + oldval = state->efer; + VCPU_CTR2(sc->vm, vcpu, "wrmsr(efer) %#lx/%#lx", oldval, newval); + + newval &= ~0xFE; /* clear the Read-As-Zero (RAZ) bits */ + changed = oldval ^ newval; + + if (newval & EFER_MBZ_BITS) + goto gpf; + + /* APMv2 Table 14-5 "Long-Mode Consistency Checks" */ + if (changed & EFER_LME) { + if (state->cr0 & CR0_PG) + goto gpf; + } + + /* EFER.LMA = EFER.LME & CR0.PG */ + if ((newval & EFER_LME) != 0 && (state->cr0 & CR0_PG) != 0) + lma = EFER_LMA; + else + lma = 0; + + if ((newval & EFER_LMA) != lma) + goto gpf; + + if (newval & EFER_NXE) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_NO_EXECUTE)) + goto gpf; + } + + /* + * XXX bhyve does not enforce segment limits in 64-bit mode. Until + * this is fixed flag guest attempt to set EFER_LMSLE as an error. + */ + if (newval & EFER_LMSLE) { + vme = vm_exitinfo(sc->vm, vcpu); + vm_exit_svm(vme, VMCB_EXIT_MSR, 1, 0); + *retu = true; + return (0); + } + + if (newval & EFER_FFXSR) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_FFXSR)) + goto gpf; + } + + if (newval & EFER_TCE) { + if (!vm_cpuid_capability(sc->vm, vcpu, VCC_TCE)) + goto gpf; + } + + error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, newval); + KASSERT(error == 0, ("%s: error %d updating efer", __func__, error)); + return (0); +gpf: + vm_inject_gp(sc->vm, vcpu); + return (0); +} + static int emulate_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, bool *retu) @@ -1089,7 +1172,7 @@ emulate_wrmsr(struct svm_softc *sc, int if (lapic_msr(num)) error = lapic_wrmsr(sc->vm, vcpu, num, val, retu); else if (num == MSR_EFER) - error = svm_setreg(sc, vcpu, VM_REG_GUEST_EFER, val); + error = svm_write_efer(sc, vcpu, val, retu); else error = svm_wrmsr(sc, vcpu, num, val, retu); @@ -1189,19 +1272,6 @@ nrip_valid(uint64_t exitcode) } } -/* - * Collateral for a generic SVM VM-exit. - */ -static void -vm_exit_svm(struct vm_exit *vme, uint64_t code, uint64_t info1, uint64_t info2) -{ - - vme->exitcode = VM_EXITCODE_SVM; - vme->u.svm.exitcode = code; - vme->u.svm.exitinfo1 = info1; - vme->u.svm.exitinfo2 = info2; -} - static int svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit) { Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Wed May 6 05:12:29 2015 (r282519) +++ head/sys/amd64/vmm/x86.c Wed May 6 05:40:20 2015 (r282520) @@ -488,3 +488,34 @@ x86_emulate_cpuid(struct vm *vm, int vcp return (1); } + +bool +vm_cpuid_capability(struct vm *vm, int vcpuid, enum vm_cpuid_capability cap) +{ + bool rv; + + KASSERT(cap > 0 && cap < VCC_LAST, ("%s: invalid vm_cpu_capability %d", + __func__, cap)); + + /* + * Simply passthrough the capabilities of the host cpu for now. + */ + rv = false; + switch (cap) { + case VCC_NO_EXECUTE: + if (amd_feature & AMDID_NX) + rv = true; + break; + case VCC_FFXSR: + if (amd_feature & AMDID_FFXSR) + rv = true; + break; + case VCC_TCE: + if (amd_feature2 & AMDID2_TCE) + rv = true; + break; + default: + panic("%s: unknown vm_cpu_capability %d", __func__, cap); + } + return (rv); +} Modified: head/sys/amd64/vmm/x86.h ============================================================================== --- head/sys/amd64/vmm/x86.h Wed May 6 05:12:29 2015 (r282519) +++ head/sys/amd64/vmm/x86.h Wed May 6 05:40:20 2015 (r282520) @@ -62,4 +62,17 @@ int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); +enum vm_cpuid_capability { + VCC_NONE, + VCC_NO_EXECUTE, + VCC_FFXSR, + VCC_TCE, + VCC_LAST +}; + +/* + * Return 'true' if the capability 'cap' is enabled in this virtual cpu + * and 'false' otherwise. + */ +bool vm_cpuid_capability(struct vm *vm, int vcpuid, enum vm_cpuid_capability); #endif From owner-svn-src-all@FreeBSD.ORG Wed May 6 07:53:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DD50C2B; Wed, 6 May 2015 07:53: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 1CE531048; Wed, 6 May 2015 07: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 t467rhq5032817; Wed, 6 May 2015 07:53:43 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t467rh9v032816; Wed, 6 May 2015 07:53:43 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201505060753.t467rh9v032816@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 6 May 2015 07:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282521 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 07:53:44 -0000 Author: melifaro Date: Wed May 6 07:53:43 2015 New Revision: 282521 URL: https://svnweb.freebsd.org/changeset/base/282521 Log: Fix panic when prepare_batch_buffer() returns error. Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Wed May 6 05:40:20 2015 (r282520) +++ head/sys/netpfil/ipfw/ip_fw_table.c Wed May 6 07:53:43 2015 (r282521) @@ -597,19 +597,21 @@ restart: /* Pass stack buffer by default */ ta_buf_m = ta_buf; error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m); - if (error != 0) - goto cleanup; IPFW_UH_WLOCK(ch); + del_toperation_state(ch, &ts); /* Drop reference we've used in first search */ tc->no.refcnt--; + /* Check prepare_batch_buffer() error */ + if (error != 0) + goto cleanup; + /* * Check if table swap has happened. * (so table algo might be changed). * Restart operation to achieve consistent behavior. */ - del_toperation_state(ch, &ts); if (ts.modified != 0) goto restart; From owner-svn-src-all@FreeBSD.ORG Wed May 6 08:07:11 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D443AFD1; Wed, 6 May 2015 08:07:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2E501188; Wed, 6 May 2015 08:07:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4687B60038459; Wed, 6 May 2015 08:07:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4687B52038458; Wed, 6 May 2015 08:07:11 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505060807.t4687B52038458@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 6 May 2015 08:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282522 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 08:07:11 -0000 Author: glebius Date: Wed May 6 08:07:11 2015 New Revision: 282522 URL: https://svnweb.freebsd.org/changeset/base/282522 Log: Fix the KASSERT and improve wording in r282426. Submitted by: alc Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed May 6 07:53:43 2015 (r282521) +++ head/sys/vm/vnode_pager.c Wed May 6 08:07:11 2015 (r282522) @@ -342,12 +342,12 @@ vnode_pager_haspage(vm_object_t object, if (after) { /* * The BMAP vop can report a partial block in the - * 'after', but must not count blocks after EOF. + * 'after', but must not report blocks after EOF. * Assert the latter, and truncate 'after' in case * of the former. */ - KASSERT(reqblock + *after <= - object->size * pagesperblock, + KASSERT((reqblock + *after) * pagesperblock < + roundup2(object->size, pagesperblock), ("%s: reqblock %jd after %d size %ju", __func__, (intmax_t )reqblock, *after, (uintmax_t )object->size)); From owner-svn-src-all@FreeBSD.ORG Wed May 6 09:38:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42CD9113; Wed, 6 May 2015 09:38: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 3120D1B91; Wed, 6 May 2015 09:38: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 t469cj91083160; Wed, 6 May 2015 09:38:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t469cjpq083159; Wed, 6 May 2015 09:38:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201505060938.t469cjpq083159@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 May 2015 09:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282523 - stable/10/libexec/getty X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 09:38:45 -0000 Author: kib Date: Wed May 6 09:38:44 2015 New Revision: 282523 URL: https://svnweb.freebsd.org/changeset/base/282523 Log: MFC r282245: Remove the #ifdef DEBUG code, which is not compilable on 64bit architectures. PR: 199767 Modified: stable/10/libexec/getty/subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/getty/subr.c ============================================================================== --- stable/10/libexec/getty/subr.c Wed May 6 08:07:11 2015 (r282522) +++ stable/10/libexec/getty/subr.c Wed May 6 09:38:44 2015 (r282523) @@ -38,9 +38,6 @@ static const char rcsid[] = /* * Melbourne getty. */ -#ifdef DEBUG -#include -#endif #include #include #include @@ -160,17 +157,6 @@ gettable(const char *name, char *buf) fp->value = 1 ^ fp->invrt; } } - -#ifdef DEBUG - printf("name=\"%s\", buf=\"%s\"\r\n", name, buf); - for (sp = gettystrs; sp->field; sp++) - printf("cgetstr: %s=%s\r\n", sp->field, sp->value); - for (np = gettynums; np->field; np++) - printf("cgetnum: %s=%d\r\n", np->field, np->value); - for (fp = gettyflags; fp->field; fp++) - printf("cgetflags: %s='%c' set='%c'\r\n", fp->field, - fp->value + '0', fp->set + '0'); -#endif /* DEBUG */ } void From owner-svn-src-all@FreeBSD.ORG Wed May 6 09:59:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A5F185F; Wed, 6 May 2015 09:59:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F5621E1F; Wed, 6 May 2015 09:59:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t469xJHo092905; Wed, 6 May 2015 09:59:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t469xJLN092904; Wed, 6 May 2015 09:59:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505060959.t469xJLN092904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 09:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282524 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 09:59:20 -0000 Author: mav Date: Wed May 6 09:59:19 2015 New Revision: 282524 URL: https://svnweb.freebsd.org/changeset/base/282524 Log: Reimplement queue freeze on error, added in r282429: It is not required to use CLO to recover from task file error, it should be enough to do only stop/start, that does not clear the PxTFD.STS.ERR. MFC after: 13 days Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Wed May 6 09:38:44 2015 (r282523) +++ head/usr.sbin/bhyve/pci_ahci.c Wed May 6 09:59:19 2015 (r282524) @@ -135,6 +135,7 @@ struct ahci_port { char ident[20 + 1]; int atapi; int reset; + int waitforclear; int mult_sectors; uint8_t xfermode; uint8_t err_cfis[20]; @@ -288,8 +289,10 @@ ahci_write_fis(struct ahci_port *p, enum WPRINTF("unsupported fis type %d\n", ft); return; } - if (fis[2] & ATA_S_ERROR) + if (fis[2] & ATA_S_ERROR) { + p->waitforclear = 1; irq |= AHCI_P_IX_TFE; + } memcpy(p->rfis + offset, fis, len); if (irq) { p->is |= irq; @@ -413,6 +416,7 @@ ahci_check_stopped(struct ahci_port *p) p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); p->ci = 0; p->sact = 0; + p->waitforclear = 0; } } } @@ -1769,7 +1773,9 @@ ahci_handle_port(struct ahci_port *p) * are already in-flight. Stop if device is busy or in error. */ for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { - if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ)) != 0) + break; + if (p->waitforclear) break; if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { p->cmd &= ~AHCI_P_CMD_CCS_MASK; @@ -2010,7 +2016,7 @@ pci_ahci_port_write(struct pci_ahci_soft } if (value & AHCI_P_CMD_CLO) { - p->tfd = 0; + p->tfd &= ~(ATA_S_BUSY | ATA_S_DRQ); p->cmd &= ~AHCI_P_CMD_CLO; } From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:00:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26BD59C0; Wed, 6 May 2015 10:00:21 +0000 (UTC) Received: from mail-la0-x231.google.com (mail-la0-x231.google.com [IPv6:2a00:1450:4010:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A546F1E2D; Wed, 6 May 2015 10:00:20 +0000 (UTC) Received: by labbd9 with SMTP id bd9so3497677lab.2; Wed, 06 May 2015 03:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=4wvECfF+R9GUGKjipOuYyLdFCpf/5wUKjZKt5H0jooI=; b=PhE9Ph6Meyb1uzCmaghIvCB3kb3QLwYPw67a+W25hTuguZWaoJN6GyQOasJmlnrtp9 17nBxG7S/VidBRHkdfTbnt8/WdKeGemzMrRgpZMX6umSneeGQETePoztHtcXw1hClN5Y ZMl33LENmNYbVkOWsvmg2PhC8StR7Mm315NFJaylLGvbDpKjpS/ykjYrIsqLQKX7/Xib ykVaGnmuu2Smn9WHu5+WMBN+pIS6CzH+P7KwLQrxH7E4c8zda7VgVjYWJ43FsX2+j8dS EZXKbNfWKO2KreaxGxc2xSXaTpb+cUf+cOZNRJg75de3SJa5Znxc5OIAhUKazHYbwg1q twdA== X-Received: by 10.152.224.164 with SMTP id rd4mr4961835lac.77.1430906418707; Wed, 06 May 2015 03:00:18 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([91.198.175.1]) by mx.google.com with ESMTPSA id xx2sm261304lbb.13.2015.05.06.03.00.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 03:00:17 -0700 (PDT) Sender: Alexander Motin Message-ID: <5549E62F.8000508@FreeBSD.org> Date: Wed, 06 May 2015 13:00:15 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Neel Natu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r282429 - head/usr.sbin/bhyve References: <201505041955.t44Jt28d008533@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:00:21 -0000 On 06.05.2015 08:04, Neel Natu wrote: > Hi Alexander, > > I am getting the following error(?) messages with an ahci-cd device on > Centos 6.4 x86_64: Thanks for the report, r282524 should fix the issue. > On Mon, May 4, 2015 at 12:55 PM, Alexander Motin wrote: >> Author: mav >> Date: Mon May 4 19:55:01 2015 >> New Revision: 282429 >> URL: https://svnweb.freebsd.org/changeset/base/282429 >> >> Log: >> Implement in-order execution of non-NCQ commands. >> >> Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. >> This can be a performance penalization for non-NCQ commands, but it is >> required for proper error recovery and standard compliance. >> >> MFC after: 2 weeks >> >> Modified: >> head/usr.sbin/bhyve/pci_ahci.c -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:32:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8CDDF21; Wed, 6 May 2015 10:32: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 A6B5E1246; Wed, 6 May 2015 10:32: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 t46AWSpv011711; Wed, 6 May 2015 10:32:28 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AWRDS011708; Wed, 6 May 2015 10:32:27 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061032.t46AWRDS011708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282525 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:32:28 -0000 Author: kadesai Date: Wed May 6 10:32:27 2015 New Revision: 282525 URL: https://svnweb.freebsd.org/changeset/base/282525 Log: This patch adds the feature to provide PCI information via IOCTL query. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_ioctl.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 09:59:19 2015 (r282524) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:32:27 2015 (r282525) @@ -87,6 +87,8 @@ mrsas_get_ctrl_info(struct mrsas_softc * static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); +static struct mrsas_softc *mrsas_get_softc_instance(struct cdev *dev, + u_long cmd, caddr_t arg); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, @@ -1231,6 +1233,39 @@ mrsas_resume(device_t dev) return (0); } +/** + * mrsas_get_softc_instance: Find softc instance based on cmd type + * + * This function will return softc instance based on cmd type. + * In some case, application fire ioctl on required management instance and + * do not provide host_no. Use cdev->si_drv1 to get softc instance for those + * case, else get the softc instance from host_no provided by application in + * user data. + */ + +static struct mrsas_softc * +mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg) +{ + struct mrsas_softc *sc = NULL; + struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; + if (cmd == MRSAS_IOC_GET_PCI_INFO){ + sc = dev->si_drv1; + } else { + /* get the Host number & the softc from data sent by the Application */ + sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; + if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { + if (sc == NULL) + mrsas_dprint(sc, MRSAS_FAULT, + "There is no Controller number %d .\n", user_ioc->host_no); + else + mrsas_dprint(sc, MRSAS_FAULT, + "Invalid Controller number %d .\n", user_ioc->host_no); + } + } + + return sc; +} + /* * mrsas_ioctl: IOCtl commands entry point. * @@ -1243,19 +1278,12 @@ mrsas_ioctl(struct cdev *dev, u_long cmd { struct mrsas_softc *sc; int ret = 0, i = 0; + MRSAS_DRV_PCI_INFORMATION *pciDrvInfo; - struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; - - /* get the Host number & the softc from data sent by the Application */ - sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; - - if ((mrsas_mgmt_info.max_index == user_ioc->host_no) || (sc == NULL)) { - printf("Please check the controller number\n"); - if (sc == NULL) - printf("There is NO such Host no. %d\n", user_ioc->host_no); - + sc = mrsas_get_softc_instance(dev, cmd, arg); + if (!sc) return ENOENT; - } + if (sc->remove_in_progress) { mrsas_dprint(sc, MRSAS_INFO, "Driver remove or shutdown called.\n"); @@ -1299,6 +1327,22 @@ do_ioctl: case MRSAS_IOC_SCAN_BUS: ret = mrsas_bus_scan(sc); break; + + case MRSAS_IOC_GET_PCI_INFO: + pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *)arg; + memset (pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); + pciDrvInfo->busNumber = pci_get_bus(sc->mrsas_dev); + pciDrvInfo->deviceNumber = pci_get_slot(sc->mrsas_dev); + pciDrvInfo->functionNumber = pci_get_function(sc->mrsas_dev); + pciDrvInfo->domainID = pci_get_domain(sc->mrsas_dev); + mrsas_dprint (sc, MRSAS_INFO, "pci bus no: %d," + "pci device no: %d, pci function no: %d," + "pci domain ID: %d\n", + pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, + pciDrvInfo->functionNumber, pciDrvInfo->domainID); + ret = 0; + break; + default: mrsas_dprint(sc, MRSAS_TRACE, "IOCTL command 0x%lx is not handled\n", cmd); ret = ENOENT; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 09:59:19 2015 (r282524) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:32:27 2015 (r282525) @@ -2413,6 +2413,167 @@ struct mrsas_mgmt_info { int max_index; }; +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 + +typedef struct _MRSAS_DRV_PCI_COMMON_HEADER +{ + u_int16_t vendorID; // (ro) + u_int16_t deviceID; // (ro) + u_int16_t command; // Device control + u_int16_t status; + u_int8_t revisionID; // (ro) + u_int8_t progIf; // (ro) + u_int8_t subClass; // (ro) + u_int8_t baseClass; // (ro) + u_int8_t cacheLineSize; // (ro+) + u_int8_t latencyTimer; // (ro+) + u_int8_t headerType; // (ro) + u_int8_t bist; // Built in self test + + union + { + struct _MRSAS_DRV_PCI_HEADER_TYPE_0 + { + u_int32_t baseAddresses[PCI_TYPE0_ADDRESSES]; + u_int32_t cis; + u_int16_t subVendorID; + u_int16_t subSystemID; + u_int32_t romBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t reserved2; + u_int8_t interruptLine; + u_int8_t interruptPin; // (ro) + u_int8_t minimumGrant; // (ro) + u_int8_t maximumLatency; // (ro) + } type0; + + /* + * PCI to PCI Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_1 + { + u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + u_int8_t ioBase; + u_int8_t ioLimit; + u_int16_t secondaryStatus; + u_int16_t memoryBase; + u_int16_t memoryLimit; + u_int16_t prefetchBase; + u_int16_t prefetchLimit; + u_int32_t prefetchBaseUpper32; + u_int32_t prefetchLimitUpper32; + u_int16_t ioBaseUpper16; + u_int16_t ioLimitUpper16; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t romBaseAddress; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type1; + + /* + * PCI to CARDBUS Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_2 + { + u_int32_t socketRegistersBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved; + u_int16_t secondaryStatus; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + struct + { + u_int32_t base; + u_int32_t limit; + } range[PCI_TYPE2_ADDRESSES-1]; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type2; + } u; + +} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; + +#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes + +typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY +{ + union + { + struct + { + u_int32_t linkSpeed :4; + u_int32_t linkWidth :6; + u_int32_t aspmSupport :2; + u_int32_t losExitLatency :3; + u_int32_t l1ExitLatency :3; + u_int32_t rsvdp :6; + u_int32_t portNumber :8; + }bits; + + u_int32_t asUlong; + }u; +}MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; + +#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) + +typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY +{ + union + { + struct + { + u_int16_t linkSpeed :4; + u_int16_t negotiatedLinkWidth :6; + u_int16_t linkTrainingError :1; + u_int16_t linkTraning :1; + u_int16_t slotClockConfig :1; + u_int16_t rsvdZ :3; + }bits; + + u_int16_t asUshort; + }u; + u_int16_t reserved; +} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; + +#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) + + +typedef struct _MRSAS_DRV_PCI_CAPABILITIES +{ + MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; + MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; +}MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; + +#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) + +/* PCI information */ +typedef struct _MRSAS_DRV_PCI_INFORMATION +{ + u_int32_t busNumber; + u_int8_t deviceNumber; + u_int8_t functionNumber; + u_int8_t interruptVector; + u_int8_t reserved1; + MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; + MRSAS_DRV_PCI_CAPABILITIES capability; + u_int32_t domainID; + u_int8_t reserved2[28]; +}MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; + /******************************************************************* * per-instance data ********************************************************************/ Modified: head/sys/dev/mrsas/mrsas_ioctl.h ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 09:59:19 2015 (r282524) +++ head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 10:32:27 2015 (r282525) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); * into a somewhat unique, 32-bit value. */ +#define MRSAS_IOC_GET_PCI_INFO _IOR('M', 7, MRSAS_DRV_PCI_INFORMATION) #define MRSAS_IOC_FIRMWARE_PASS_THROUGH64 _IOWR('M', 1, struct mrsas_iocpacket) #ifdef COMPAT_FREEBSD32 #define MRSAS_IOC_FIRMWARE_PASS_THROUGH32 _IOWR('M', 1, struct mrsas_iocpacket32) From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:36:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 996151DF; Wed, 6 May 2015 10:36: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 86F761280; Wed, 6 May 2015 10:36: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 t46AasKt012361; Wed, 6 May 2015 10:36:54 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46Aar4o012358; Wed, 6 May 2015 10:36:53 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061036.t46Aar4o012358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282526 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:36:54 -0000 Author: kadesai Date: Wed May 6 10:36:53 2015 New Revision: 282526 URL: https://svnweb.freebsd.org/changeset/base/282526 Log: Now Driver expose Secure Jbod Support via driver_operations in MFI INIT Frame. FW expose Secure Jbod support via Controller properity. Firmware expect IOs to be received from different IO path than conventional fast path queue, in case of SED drives. To have Secure jbod support user need driver and firmware support. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:32:27 2015 (r282525) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:36:53 2015 (r282526) @@ -2095,6 +2095,12 @@ mrsas_init_fw(struct mrsas_softc *sc) if (mrsas_get_ctrl_info(sc, ctrl_info)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); } + sc->secure_jbod_support = + (u_int8_t) ctrl_info->adapterOperations3.supportSecurityonJBOD; + + if (sc->secure_jbod_support) + device_printf(sc->mrsas_dev, "FW supports SED \n"); + sc->max256vdSupport = (u_int8_t)ctrl_info->adapterOperations3.supportMaxExtLDs; @@ -2326,6 +2332,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_ver_hi = 0; } init_frame->driver_operations.mfi_capabilities.support_max_255lds = 1; + init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; init_frame->queue_info_new_phys_addr_lo = phys_addr; init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:32:27 2015 (r282525) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:36:53 2015 (r282526) @@ -1315,6 +1315,13 @@ typedef enum _REGION_TYPE { #define MRSAS_REQ_STATE_TRAN 2 #define MRSAS_REQ_STATE_COMPLETE 3 +typedef enum _MR_SCSI_CMD_TYPE { + READ_WRITE_LDIO = 0, + NON_READ_WRITE_LDIO = 1, + READ_WRITE_SYSPDIO = 2, + NON_READ_WRITE_SYSPDIO = 3, +} MR_SCSI_CMD_TYPE; + enum mrsas_req_flags { MRSAS_DIR_UNKNOWN = 0x1, MRSAS_DIR_IN = 0x2, @@ -1897,10 +1904,27 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ - u_int32_t resrved:5; - u_int32_t supportMaxExtLDs:1; - u_int32_t reserved1:26; - } adapterOperations3; + u_int32_t supportPersonalityChange:2; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportCrashDump:1; + u_int32_t supportSwZone:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportForceFlash:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t reserved:12; + } adapterOperations3; u_int8_t pad[0x800 - 0x7EC]; /* 0x7EC */ } __packed; @@ -1970,8 +1994,11 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_additional_msix:1; u_int32_t support_fastpath_wb:1; u_int32_t support_max_255lds:1; - u_int32_t reserved:28; - } mfi_capabilities; + u_int32_t support_ndrive_r1_lb:1; + u_int32_t support_core_affinity:1; + u_int32_t security_protocol_cmds_fw:1; + u_int32_t reserved:25; + } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2710,6 +2737,7 @@ struct mrsas_softc { LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; + u_int8_t secure_jbod_support; u_int8_t max256vdSupport; u_int16_t fw_supported_vd_count; u_int16_t fw_supported_pd_count; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:32:27 2015 (r282525) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:36:53 2015 (r282526) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ int mrsas_cam_attach(struct mrsas_softc *sc); -int mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb); +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); int mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); @@ -499,7 +499,9 @@ mrsas_startio(struct mrsas_softc *sc, st bcopy(csio->cdb_io.cdb_bytes, cmd->io_request->CDB.CDB32, csio->cdb_len); mtx_lock(&sc->raidmap_lock); - if (mrsas_ldio_inq(sim, ccb)) { + /* Check for IO type READ-WRITE targeted for Logical Volume */ + if (mrsas_find_io_type(sim, ccb) == READ_WRITE_LDIO) { + /* Build READ-WRITE IO for Logical Volume */ if (mrsas_build_ldio(sc, cmd, ccb)) { device_printf(sc->mrsas_dev, "Build LDIO failed.\n"); mtx_unlock(&sc->raidmap_lock); @@ -546,20 +548,16 @@ done: } /* - * mrsas_ldio_inq: Determines if IO is read/write or inquiry + * mrsas_find_io_type: Determines if IO is read/write or inquiry * input: pointer to CAM Control Block * * This function determines if the IO is read/write or inquiry. It returns a 1 * if the IO is read/write and 0 if it is inquiry. */ -int -mrsas_ldio_inq(struct cam_sim *sim, union ccb *ccb) +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) { struct ccb_scsiio *csio = &(ccb->csio); - if (cam_sim_bus(sim) == 1) - return (0); - switch (csio->cdb_io.cdb_bytes[0]) { case READ_10: case WRITE_10: @@ -569,9 +567,11 @@ mrsas_ldio_inq(struct cam_sim *sim, unio case WRITE_6: case READ_16: case WRITE_16: - return 1; + return (cam_sim_bus(sim) ? + READ_WRITE_SYSPDIO : READ_WRITE_LDIO); default: - return 0; + return (cam_sim_bus(sim) ? + NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); } } @@ -876,35 +876,54 @@ mrsas_build_dcdb(struct mrsas_softc *sc, device_id = ccb_h->target_id; map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; - /* Check if this is for system PD */ + /* + * Check if this is RW for system PD or + * it's a NON RW for sys PD and there is NO secure jbod FW support + */ if (cam_sim_bus(sim) == 1 && - sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM) { - io_request->Function = 0; - io_request->DevHandle = map_ptr->raidMap.devHndlInfo[device_id]. - curDevHdl; - io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; - io_request->RaidContext.regLockFlags = 0; - io_request->RaidContext.regLockRowLBA = 0; - io_request->RaidContext.regLockLength = 0; + sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM){ - io_request->RaidContext.RAIDFlags = MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD - << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) - io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; - cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - cmd->request_desc->SCSIIO.DevHandle = - map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + io_request->DevHandle = + map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + io_request->RaidContext.RAIDFlags = + MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << + MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; + cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; cmd->request_desc->SCSIIO.MSIxIndex = - sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + + if(sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { + /* system pd firmware path */ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + } else { + /* system pd fast path */ + io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; + io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; + io_request->RaidContext.regLockFlags = 0; + io_request->RaidContext.regLockRowLBA = 0; + io_request->RaidContext.regLockLength = 0; + + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + /* + * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH + * Because the NON RW cmds will now go via FW Queue + * and not the Exception queue + */ + if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; + } } else { - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + /* FW path for SysPD or LD Non-RW (SCSI management commands)*/ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } io_request->RaidContext.VirtualDiskTgtId = device_id; From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:41:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A362D3B7; Wed, 6 May 2015 10:41: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 9113C1362; Wed, 6 May 2015 10:41: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 t46AfTre015896; Wed, 6 May 2015 10:41:29 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AfSHm015890; Wed, 6 May 2015 10:41:28 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061041.t46AfSHm015890@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282527 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:41:29 -0000 Author: kadesai Date: Wed May 6 10:41:27 2015 New Revision: 282527 URL: https://svnweb.freebsd.org/changeset/base/282527 Log: Current driver does fast path read load balancing between arm and mirror disk for two Drive Raid-1 configuration only. Now, Driver support fast path read load balancing for all (any number of disk) Raid-1 configuration. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:41:27 2015 (r282527) @@ -462,6 +462,11 @@ mrsas_get_tunables(struct mrsas_softc *s */ TUNABLE_INT_FETCH("hw.mrsas.debug_level", &sc->mrsas_debug); + /* + * Grab the global variables. + */ + TUNABLE_INT_FETCH("hw.mrsas.lb_pending_cmds", &sc->lb_pending_cmds); + /* Grab the unit-instance variables */ snprintf(tmpstr, sizeof(tmpstr), "dev.mrsas.%d.debug_level", device_get_unit(sc->mrsas_dev)); @@ -1468,7 +1473,7 @@ mrsas_complete_cmd(struct mrsas_softc *s MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; struct mrsas_mpt_cmd *cmd_mpt; struct mrsas_mfi_cmd *cmd_mfi; - u_int8_t arm, reply_descript_type; + u_int8_t reply_descript_type; u_int16_t smid, num_completed; u_int8_t status, extStatus; union desc_value desc_val; @@ -1506,8 +1511,7 @@ mrsas_complete_cmd(struct mrsas_softc *s device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) { - arm = lbinfo->raid1DevHandle[0] == scsi_io_req->DevHandle ? 0 : 1; - mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[arm]); + mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[cmd_mpt->pd_r1_lb]); cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG; } /* Fall thru and complete IO */ @@ -2331,6 +2335,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_ver_lo = (bus_addr_t)sc->verbuf_phys_addr; init_frame->driver_ver_hi = 0; } + init_frame->driver_operations.mfi_capabilities.support_ndrive_r1_lb = 1; init_frame->driver_operations.mfi_capabilities.support_max_255lds = 1; init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:41:27 2015 (r282527) @@ -813,9 +813,8 @@ typedef struct _MR_DRV_RAID_MAP_ALL { typedef struct _LD_LOAD_BALANCE_INFO { u_int8_t loadBalanceFlag; u_int8_t reserved1; - u_int16_t raid1DevHandle[2]; - mrsas_atomic_t scsi_pending_cmds[2]; - u_int64_t last_accessed_block[2]; + mrsas_atomic_t scsi_pending_cmds[MAX_PHYSICAL_DEVICES]; + u_int64_t last_accessed_block[MAX_PHYSICAL_DEVICES]; } LD_LOAD_BALANCE_INFO, *PLD_LOAD_BALANCE_INFO; /* SPAN_SET is info caclulated from span info from Raid map per ld */ @@ -858,6 +857,9 @@ struct IO_REQUEST_INFO { u_int8_t start_span; u_int8_t reserved; u_int64_t start_row; + /* span[7:5], arm[4:0] */ + u_int8_t span_arm; + u_int8_t pd_after_lb; }; typedef struct _MR_LD_TARGET_SYNC { @@ -1357,6 +1359,7 @@ struct mrsas_mpt_cmd { u_int32_t sync_cmd_idx; u_int32_t index; u_int8_t flags; + u_int8_t pd_r1_lb; u_int8_t load_balance; bus_size_t length; u_int32_t error_code; @@ -2734,6 +2737,7 @@ struct mrsas_softc { struct task ev_task; u_int32_t CurLdCount; u_int64_t reset_flags; + int lb_pending_cmds; LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:41:27 2015 (r282527) @@ -112,9 +112,8 @@ MR_BuildRaidContext(struct mrsas_softc * extern u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -extern u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info); +extern u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); @@ -824,9 +823,10 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->load_balance_info[device_id].loadBalanceFlag) && (io_info.isRead)) { io_info.devHandle = - mrsas_get_updated_dev_handle(&sc->load_balance_info[device_id], - &io_info); + mrsas_get_updated_dev_handle(sc, + &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; + cmd->pd_r1_lb = io_info.pd_after_lb; } else cmd->load_balance = 0; cmd->request_desc->SCSIIO.DevHandle = io_info.devHandle; Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:36:53 2015 (r282526) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:41:27 2015 (r282527) @@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ u_int8_t MR_ValidateMapInfo(struct mrsas_softc *sc); -u_int8_t -mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, - u_int64_t block, u_int32_t count); +u_int8_t mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int8_t MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, @@ -69,17 +68,15 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int16_t MR_GetLDTgtId(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); -u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info); +u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int32_t mega_mod64(u_int64_t dividend, u_int32_t divisor); u_int32_t MR_GetSpanBlock(u_int32_t ld, u_int64_t row, u_int64_t *span_blk, MR_DRV_RAID_MAP_ALL * map, int *div_error); u_int64_t mega_div64_32(u_int64_t dividend, u_int32_t divisor); -void -mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, - PLD_LOAD_BALANCE_INFO lbInfo); +void mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL *map, PLD_LOAD_BALANCE_INFO lbInfo); void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, @@ -146,6 +143,8 @@ typedef u_int32_t REGION_LEN; #define FALSE 0 #define TRUE 1 +#define LB_PENDING_CMDS_DEFAULT 4 + /* * Related Macros @@ -379,7 +378,7 @@ MR_ValidateMapInfo(struct mrsas_softc *s printf("Updating span set\n\n"); mr_update_span_set(drv_map, ldSpanInfo); } - mrsas_update_load_balance_params(drv_map, sc->load_balance_info); + mrsas_update_load_balance_params(sc, drv_map, sc->load_balance_info); return 0; } @@ -723,9 +722,11 @@ get_arm(struct mrsas_softc *sc, u_int32_ * This routine calculates the arm, span and block for the specified stripe and * reference in stripe using spanset * - * Inputs : Logical drive number - * stripRow: Stripe number - * stripRef: Reference in stripe + * Inputs : + * sc - HBA instance + * ld - Logical drive number + * stripRow: Stripe number + * stripRef: Reference in stripe * * Outputs : span - Span number block - Absolute Block * number in the physical disk @@ -785,6 +786,7 @@ mr_spanset_get_phy_params(struct mrsas_s *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; pRAID_Context->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; + io_info->span_arm = pRAID_Context->spanArm; return retval; } @@ -1097,46 +1099,39 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL * /* * mrsas_update_load_balance_params: Update load balance parmas - * Inputs: map pointer - * Load balance info + * Inputs: + * sc - driver softc instance + * drv_map - driver RAID map + * lbInfo - Load balance info * * This function updates the load balance parameters for the LD config of a two * drive optimal RAID-1. */ void -mrsas_update_load_balance_params(MR_DRV_RAID_MAP_ALL * map, - PLD_LOAD_BALANCE_INFO lbInfo) +mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL * drv_map, PLD_LOAD_BALANCE_INFO lbInfo) { int ldCount; u_int16_t ld; - u_int32_t pd, arRef; MR_LD_RAID *raid; - for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES; ldCount++) { - ld = MR_TargetIdToLdGet(ldCount, map); - if (ld >= MAX_LOGICAL_DRIVES) { + if(sc->lb_pending_cmds > 128 || sc->lb_pending_cmds < 1) + sc-> lb_pending_cmds = LB_PENDING_CMDS_DEFAULT; + + for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) { + ld = MR_TargetIdToLdGet(ldCount, drv_map); + if (ld >= MAX_LOGICAL_DRIVES_EXT) { lbInfo[ldCount].loadBalanceFlag = 0; continue; } - raid = MR_LdRaidGet(ld, map); - /* Two drive Optimal RAID 1 */ - if ((raid->level == 1) && (raid->rowSize == 2) && - (raid->spanDepth == 1) - && raid->ldState == MR_LD_STATE_OPTIMAL) { - lbInfo[ldCount].loadBalanceFlag = 1; - - /* Get the array on which this span is present */ - arRef = MR_LdSpanArrayGet(ld, 0, map); - - /* Get the PD */ - pd = MR_ArPdGet(arRef, 0, map); - /* Get dev handle from PD */ - lbInfo[ldCount].raid1DevHandle[0] = MR_PdDevHandleGet(pd, map); - pd = MR_ArPdGet(arRef, 1, map); - lbInfo[ldCount].raid1DevHandle[1] = MR_PdDevHandleGet(pd, map); - } else + raid = MR_LdRaidGet(ld, drv_map); + if ((raid->level != 1) || + (raid->ldState != MR_LD_STATE_OPTIMAL)) { lbInfo[ldCount].loadBalanceFlag = 0; + continue; + } + lbInfo[ldCount].loadBalanceFlag = 1; } } @@ -1332,57 +1327,92 @@ mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQU } /* - * mrsas_get_best_arm: Determine the best spindle arm - * Inputs: Load balance info + * mrsas_get_best_arm_pd: Determine the best spindle arm + * Inputs: + * sc - HBA instance + * lbInfo - Load balance info + * io_info - IO request info * * This function determines and returns the best arm by looking at the * parameters of the last PD access. */ -u_int8_t -mrsas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, - u_int64_t block, u_int32_t count) +u_int8_t mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info) { - u_int16_t pend0, pend1; + MR_LD_RAID *raid; + MR_DRV_RAID_MAP_ALL *drv_map; + u_int16_t pend0, pend1, ld; u_int64_t diff0, diff1; - u_int8_t bestArm; + u_int8_t bestArm, pd0, pd1, span, arm; + u_int32_t arRef, span_row_size; + + u_int64_t block = io_info->ldStartBlock; + u_int32_t count = io_info->numBlocks; + + span = ((io_info->span_arm & RAID_CTX_SPANARM_SPAN_MASK) + >> RAID_CTX_SPANARM_SPAN_SHIFT); + arm = (io_info->span_arm & RAID_CTX_SPANARM_ARM_MASK); + + drv_map = sc->ld_drv_map[(sc->map_id & 1)]; + ld = MR_TargetIdToLdGet(io_info->ldTgtId, drv_map); + raid = MR_LdRaidGet(ld, drv_map); + span_row_size = sc->UnevenSpanSupport ? + SPAN_ROW_SIZE(drv_map, ld, span) : raid->rowSize; + + arRef = MR_LdSpanArrayGet(ld, span, drv_map); + pd0 = MR_ArPdGet(arRef, arm, drv_map); + pd1 = MR_ArPdGet(arRef, (arm + 1) >= span_row_size ? + (arm + 1 - span_row_size): arm + 1, drv_map); /* get the pending cmds for the data and mirror arms */ - pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[0]); - pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[1]); + pend0 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[pd0]); + pend1 = mrsas_atomic_read(&lbInfo->scsi_pending_cmds[pd1]); /* Determine the disk whose head is nearer to the req. block */ - diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[0]); - diff1 = ABS_DIFF(block, lbInfo->last_accessed_block[1]); - bestArm = (diff0 <= diff1 ? 0 : 1); + diff0 = ABS_DIFF(block, lbInfo->last_accessed_block[pd0]); + diff1 = ABS_DIFF(block, lbInfo->last_accessed_block[pd1]); + bestArm = (diff0 <= diff1 ? arm : arm ^ 1); - if ((bestArm == arm && pend0 > pend1 + 16) || (bestArm != arm && pend1 > pend0 + 16)) + if ((bestArm == arm && pend0 > pend1 + sc->lb_pending_cmds) || + (bestArm != arm && pend1 > pend0 + sc->lb_pending_cmds)) bestArm ^= 1; /* Update the last accessed block on the correct pd */ - lbInfo->last_accessed_block[bestArm] = block + count - 1; + lbInfo->last_accessed_block[bestArm==arm ? pd0 : pd1] = block + count - 1; + io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | bestArm; + io_info->pd_after_lb = (bestArm == arm) ? pd0:pd1; +#if SPAN_DEBUG + if(arm != bestArm) + printf("LSI Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " + "io_info->span_arm 0x%x\n", + span, arm, bestArm, io_info->span_arm); +#endif - return bestArm; + return io_info->pd_after_lb; } /* * mrsas_get_updated_dev_handle: Get the update dev handle - * Inputs: Load balance info io_info pointer + * Inputs: + * sc - Adapter instance soft state + * lbInfo - Load balance info + * io_info - io_info pointer * * This function determines and returns the updated dev handle. */ -u_int16_t -mrsas_get_updated_dev_handle(PLD_LOAD_BALANCE_INFO lbInfo, - struct IO_REQUEST_INFO *io_info) +u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info) { - u_int8_t arm, old_arm; + u_int8_t arm_pd; u_int16_t devHandle; + MR_DRV_RAID_MAP_ALL *drv_map; - old_arm = lbInfo->raid1DevHandle[0] == io_info->devHandle ? 0 : 1; + drv_map = sc->ld_drv_map[(sc->map_id & 1)]; /* get best new arm */ - arm = mrsas_get_best_arm(lbInfo, old_arm, io_info->ldStartBlock, io_info->numBlocks); - devHandle = lbInfo->raid1DevHandle[arm]; - mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm]); + arm_pd = mrsas_get_best_arm_pd(sc, lbInfo, io_info); + devHandle = MR_PdDevHandleGet(arm_pd, drv_map); + mrsas_atomic_inc(&lbInfo->scsi_pending_cmds[arm_pd]); return devHandle; } @@ -1471,6 +1501,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; pRAID_Context->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; + io_info->span_arm = pRAID_Context->spanArm; return retval; } From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:42:46 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3D07517; Wed, 6 May 2015 10: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 E1B4C136E; Wed, 6 May 2015 10: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 t46AgjNQ016760; Wed, 6 May 2015 10:42:45 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46Agjxr016757; Wed, 6 May 2015 10:42:45 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061042.t46Agjxr016757@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282528 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:42:46 -0000 Author: kadesai Date: Wed May 6 10:42:44 2015 New Revision: 282528 URL: https://svnweb.freebsd.org/changeset/base/282528 Log: In OCR(Online Controller Reset) path, driver sets adapter state to MEGASAS_HBA_OPERATIONAL before getting new RAID map. There will be a small window where IO will come from OS with old RAID map. This patch will update adapter state to MEGASAS_HBA_OPERATIONAL, only after driver has new RAID map to avoid any IOs getting build using old RAID map. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:41:27 2015 (r282527) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:42:44 2015 (r282528) @@ -81,9 +81,8 @@ static int mrsas_init_fw(struct mrsas_so static int mrsas_setup_raidmap(struct mrsas_softc *sc); static int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); static int mrsas_clear_intr(struct mrsas_softc *sc); -static int -mrsas_get_ctrl_info(struct mrsas_softc *sc, - struct mrsas_ctrl_info *ctrl_info); +static int mrsas_get_ctrl_info(struct mrsas_softc *sc); +static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); @@ -1170,6 +1169,12 @@ mrsas_free_mem(struct mrsas_softc *sc) */ if (sc->mrsas_parent_tag != NULL) bus_dma_tag_destroy(sc->mrsas_parent_tag); + + /* + * Free ctrl_info memory + */ + if (sc->ctrl_info != NULL) + free(sc->ctrl_info, M_MRSAS); } /* @@ -1909,34 +1914,6 @@ mrsas_setup_raidmap(struct mrsas_softc * { int i; - sc->drv_supported_vd_count = - MRSAS_MAX_LD_CHANNELS * MRSAS_MAX_DEV_PER_CHANNEL; - sc->drv_supported_pd_count = - MRSAS_MAX_PD_CHANNELS * MRSAS_MAX_DEV_PER_CHANNEL; - - if (sc->max256vdSupport) { - sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; - sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; - } else { - sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES; - sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; - } - -#if VD_EXT_DEBUG - device_printf(sc->mrsas_dev, "FW supports: max256vdSupport = %s\n", - sc->max256vdSupport ? "YES" : "NO"); - device_printf(sc->mrsas_dev, "FW supports %dVDs %dPDs\n" - "DRIVER supports %dVDs %dPDs \n", - sc->fw_supported_vd_count, sc->fw_supported_pd_count, - sc->drv_supported_vd_count, sc->drv_supported_pd_count); -#endif - - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * (sc->drv_supported_vd_count - 1)); - for (i = 0; i < 2; i++) { sc->ld_drv_map[i] = (void *)malloc(sc->drv_map_sz, M_MRSAS, M_NOWAIT); @@ -1951,14 +1928,6 @@ mrsas_setup_raidmap(struct mrsas_softc * } } - sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); - - if (sc->max256vdSupport) - sc->current_map_sz = sc->new_map_sz; - else - sc->current_map_sz = sc->old_map_sz; - - for (int i = 0; i < 2; i++) { if (bus_dma_tag_create(sc->mrsas_parent_tag, 4, 0, @@ -2026,7 +1995,6 @@ mrsas_init_fw(struct mrsas_softc *sc) u_int32_t max_sectors_1; u_int32_t max_sectors_2; u_int32_t tmp_sectors; - struct mrsas_ctrl_info *ctrl_info; u_int32_t scratch_pad_2; int msix_enable = 0; int fw_msix_count = 0; @@ -2088,29 +2056,26 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); return (1); } + + sc->ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); + if (!sc->ctrl_info) { + device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); + return(1); + } /* * Get the controller info from FW, so that the MAX VD support * availability can be decided. */ - ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); - if (!ctrl_info) - device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); - - if (mrsas_get_ctrl_info(sc, ctrl_info)) { + if (mrsas_get_ctrl_info(sc)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); + return(1); } sc->secure_jbod_support = - (u_int8_t) ctrl_info->adapterOperations3.supportSecurityonJBOD; + (u_int8_t) sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; if (sc->secure_jbod_support) device_printf(sc->mrsas_dev, "FW supports SED \n"); - sc->max256vdSupport = - (u_int8_t)ctrl_info->adapterOperations3.supportMaxExtLDs; - - if (ctrl_info->max_lds > 64) { - sc->max256vdSupport = 1; - } if (mrsas_setup_raidmap(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Set up RAID map failed.\n"); return (1); @@ -2134,9 +2099,9 @@ mrsas_init_fw(struct mrsas_softc *sc) * calculate max_sectors_1. So the number ended up as zero always. */ tmp_sectors = 0; - max_sectors_1 = (1 << ctrl_info->stripe_sz_ops.min) * - ctrl_info->max_strips_per_io; - max_sectors_2 = ctrl_info->max_request_size; + max_sectors_1 = (1 << sc->ctrl_info->stripe_sz_ops.min) * + sc->ctrl_info->max_strips_per_io; + max_sectors_2 = sc->ctrl_info->max_request_size; tmp_sectors = min(max_sectors_1, max_sectors_2); sc->max_sectors_per_req = sc->max_num_sge * MRSAS_PAGE_SIZE / 512; @@ -2144,9 +2109,9 @@ mrsas_init_fw(struct mrsas_softc *sc) sc->max_sectors_per_req = tmp_sectors; sc->disableOnlineCtrlReset = - ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; sc->UnevenSpanSupport = - ctrl_info->adapterOperations2.supportUnevenSpans; + sc->ctrl_info->adapterOperations2.supportUnevenSpans; if (sc->UnevenSpanSupport) { device_printf(sc->mrsas_dev, "FW supports: UnevenSpanSupport=%x\n\n", sc->UnevenSpanSupport); @@ -2156,8 +2121,6 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } - if (ctrl_info) - free(ctrl_info, M_MRSAS); return (0); } @@ -2877,6 +2840,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); + if (mrsas_get_ctrl_info(sc)) { + sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; + mrsas_kill_hba(sc); + retval = -1; + } + if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); @@ -3001,8 +2970,7 @@ mrsas_release_mfi_cmd(struct mrsas_mfi_c * supported by the FW. */ static int -mrsas_get_ctrl_info(struct mrsas_softc *sc, - struct mrsas_ctrl_info *ctrl_info) +mrsas_get_ctrl_info(struct mrsas_softc *sc) { int retcode = 0; struct mrsas_mfi_cmd *cmd; @@ -3035,16 +3003,59 @@ mrsas_get_ctrl_info(struct mrsas_softc * dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); if (!mrsas_issue_polled(sc, cmd)) - memcpy(ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); else retcode = 1; + mrsas_update_ext_vd_details(sc); + mrsas_free_ctlr_info_cmd(sc); mrsas_release_mfi_cmd(cmd); return (retcode); } /* + * mrsas_update_ext_vd_details : Update details w.r.t Extended VD + * input: + * sc - Controller's softc +*/ +static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) +{ + sc->max256vdSupport = + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + /* Below is additional check to address future FW enhancement */ + if (sc->ctrl_info->max_lds > 64) + sc->max256vdSupport = 1; + + sc->drv_supported_vd_count = MRSAS_MAX_LD_CHANNELS + * MRSAS_MAX_DEV_PER_CHANNEL; + sc->drv_supported_pd_count = MRSAS_MAX_PD_CHANNELS + * MRSAS_MAX_DEV_PER_CHANNEL; + if (sc->max256vdSupport) { + sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; + sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; + } else { + sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES; + sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; + } + + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->drv_supported_vd_count - 1)); + + sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); + + if (sc->max256vdSupport) + sc->current_map_sz = sc->new_map_sz; + else + sc->current_map_sz = sc->old_map_sz; +} + +/* * mrsas_alloc_ctlr_info_cmd: Allocates memory for controller info command * input: Adapter soft state * Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:41:27 2015 (r282527) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:42:44 2015 (r282528) @@ -2710,6 +2710,7 @@ struct mrsas_softc { bus_dmamap_t evt_detail_dmamap; struct mrsas_evt_detail *evt_detail_mem; bus_addr_t evt_detail_phys_addr; + struct mrsas_ctrl_info *ctrl_info; bus_dma_tag_t ctlr_info_tag; bus_dmamap_t ctlr_info_dmamap; void *ctlr_info_mem; From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:43:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB9A065A; Wed, 6 May 2015 10:43: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 AD0131371; Wed, 6 May 2015 10:43: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 t46AhK27016895; Wed, 6 May 2015 10:43:20 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AhKkB016894; Wed, 6 May 2015 10:43:20 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061043.t46AhKkB016894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282529 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:43:21 -0000 Author: kadesai Date: Wed May 6 10:43:19 2015 New Revision: 282529 URL: https://svnweb.freebsd.org/changeset/base/282529 Log: Driver calls mrsas_complete_cmd() to call mrsas_wakeup() for each MFI frame that was issued through the ioctl() interface prior to the kill adapter. This ensures userspace ioctl() system calls issued just before a kill adapter don't get stuck in wait state and IOCTLs are returned to application. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:42:44 2015 (r282528) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:43:19 2015 (r282529) @@ -92,6 +92,7 @@ u_int32_t mrsas_read_reg(struct mrsas_so u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd); +void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc); int mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr); int mrsas_init_adapter(struct mrsas_softc *sc); int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc); @@ -2722,7 +2723,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) /* Reset not supported, kill adapter */ mrsas_dprint(sc, MRSAS_OCR, "Reset not supported, killing adapter.\n"); mrsas_kill_hba(sc); - sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; retval = FAIL; goto out; } @@ -2841,7 +2841,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); if (mrsas_get_ctrl_info(sc)) { - sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; mrsas_kill_hba(sc); retval = -1; } @@ -2879,11 +2878,41 @@ out: void mrsas_kill_hba(struct mrsas_softc *sc) { + sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; + pause("mrsas_kill_hba", 1000); mrsas_dprint(sc, MRSAS_OCR, "%s\n", __func__); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_STOP_ADP); /* Flush */ mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)); + mrsas_complete_outstanding_ioctls (sc); +} + +/** + * mrsas_complete_outstanding_ioctls Complete pending IOCTLS after kill_hba + * input: Controller softc + * + * Returns void + */ +void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc){ + int i; + struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mfi_cmd *cmd_mfi; + u_int32_t count, MSIxIndex; + + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + for (i=0; imax_fw_cmds; i++){ + cmd_mpt = sc->mpt_cmd_list[i]; + + if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX){ + cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; + if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT){ + for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) + mrsas_complete_mptmfi_passthru(sc, cmd_mfi, + cmd_mpt->io_request->RaidContext.status); + } + } + } } /* From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:44:09 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EF787A7; Wed, 6 May 2015 10: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 4CEFE1376; Wed, 6 May 2015 10: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 t46Ai9Q3017082; Wed, 6 May 2015 10:44:09 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46Ai80e017077; Wed, 6 May 2015 10:44:08 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061044.t46Ai80e017077@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282530 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:44:09 -0000 Author: kadesai Date: Wed May 6 10:44:08 2015 New Revision: 282530 URL: https://svnweb.freebsd.org/changeset/base/282530 Log: Bug fixes found internally as detailed below: 1. While disabling interrupt the FW disables interrupts for only 16 vectors. In case of Invader which supports 96 MSI-x vectors, some spurious interrupts may come on other vectors even after interrupt disable. So, driver uses a flag and ignores the spurious interrupts. 2. Reply queue depth is made double the number of commands supported by FW. 3. Misplaced interrupt enable code is now moved down in the OCR path. 4. Updated error handling code in OCR path. 5. Removed un-necessary print. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:43:19 2015 (r282529) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:44:08 2015 (r282530) @@ -274,6 +274,7 @@ mrsas_disable_intr(struct mrsas_softc *s u_int32_t mask = 0xFFFFFFFF; u_int32_t status; + sc->mask_interrupts=1; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); /* Dummy read to force pci flush */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); @@ -285,6 +286,7 @@ mrsas_enable_intr(struct mrsas_softc *sc u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; u_int32_t status; + sc->mask_interrupts=0; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); @@ -1442,6 +1444,9 @@ mrsas_isr(void *arg) struct mrsas_softc *sc = irq_context->sc; int status = 0; + if (sc->mask_interrupts) + return; + if (!sc->msix_vectors) { status = mrsas_clear_intr(sc); if (!status) @@ -2154,7 +2159,7 @@ mrsas_init_adapter(struct mrsas_softc *s max_cmd = sc->max_fw_cmds; /* Determine allocation size of command frames */ - sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16); + sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16) * 2; sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); @@ -2807,9 +2812,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n"); continue; } - mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); - mrsas_enable_intr(sc); - sc->adprecovery = MRSAS_HBA_OPERATIONAL; /* Re-fire management commands */ for (j = 0; j < sc->max_fw_cmds; j++) { @@ -2842,12 +2844,17 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) if (mrsas_get_ctrl_info(sc)) { mrsas_kill_hba(sc); - retval = -1; + retval = FAIL; + goto out; } if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); + mrsas_enable_intr(sc); + sc->adprecovery = MRSAS_HBA_OPERATIONAL; + /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:43:19 2015 (r282529) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:44:08 2015 (r282530) @@ -2667,6 +2667,7 @@ struct mrsas_softc { int msix_vectors; int msix_enable; uint32_t msix_reg_offset[16]; + uint8_t mask_interrupts; struct mrsas_mpt_cmd **mpt_cmd_list; struct mrsas_mfi_cmd **mfi_cmd_list; TAILQ_HEAD(, mrsas_mpt_cmd) mrsas_mpt_cmd_list_head; Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:43:19 2015 (r282529) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:44:08 2015 (r282530) @@ -375,7 +375,6 @@ MR_ValidateMapInfo(struct mrsas_softc *s return 1; } if (sc->UnevenSpanSupport) { - printf("Updating span set\n\n"); mr_update_span_set(drv_map, ldSpanInfo); } mrsas_update_load_balance_params(sc, drv_map, sc->load_balance_info); From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:45:16 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EB51900; Wed, 6 May 2015 10:45: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 0B9A91381; Wed, 6 May 2015 10:45: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 t46AjGkZ017321; Wed, 6 May 2015 10:45:16 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AjEWo017314; Wed, 6 May 2015 10:45:14 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061045.t46AjEWo017314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282531 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:45:16 -0000 Author: kadesai Date: Wed May 6 10:45:13 2015 New Revision: 282531 URL: https://svnweb.freebsd.org/changeset/base/282531 Log: 1. All LSI namings are converted to AVAGO Tech. 2. Fix in AEN path(suggested by John Baldwin). 3. Fix IOCTL path w.r.t Sense key handling Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c head/sys/dev/mrsas/mrsas_ioctl.c head/sys/dev/mrsas/mrsas_ioctl.h head/sys/dev/mrsas/mrsas_linux.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -177,9 +178,9 @@ typedef struct mrsas_ident { } MRSAS_CTLR_ID; MRSAS_CTLR_ID device_table[] = { - {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "LSI Thunderbolt SAS Controller"}, - {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "LSI Invader SAS Controller"}, - {0x1000, MRSAS_FURY, 0xffff, 0xffff, "LSI Fury SAS Controller"}, + {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "AVAGO Thunderbolt SAS Controller"}, + {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "AVAGO Invader SAS Controller"}, + {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -356,7 +357,7 @@ mrsas_probe(device_t dev) if ((id = mrsas_find_ident(dev)) != NULL) { if (first_ctrl) { - printf("LSI MegaRAID SAS FreeBSD mrsas driver version: %s\n", + printf("AVAGO MegaRAID SAS FreeBSD mrsas driver version: %s\n", MRSAS_VERSION); first_ctrl = 0; } @@ -1385,8 +1386,10 @@ mrsas_poll(struct cdev *dev, int poll_ev } if (revents == 0) { if (poll_events & (POLLIN | POLLRDNORM)) { + mtx_lock(&sc->aen_lock); sc->mrsas_poll_waiting = 1; selrecord(td, &sc->mrsas_select); + mtx_unlock(&sc->aen_lock); } } return revents; @@ -4099,10 +4102,12 @@ mrsas_complete_aen(struct mrsas_softc *s */ if ((!cmd->abort_aen) && (sc->remove_in_progress == 0)) { sc->mrsas_aen_triggered = 1; + mtx_lock(&sc->aen_lock); if (sc->mrsas_poll_waiting) { sc->mrsas_poll_waiting = 0; selwakeup(&sc->mrsas_select); } + mtx_unlock(&sc->aen_lock); } else cmd->abort_aen = 0; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Authors: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Authors: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -322,7 +323,7 @@ mrsas_action(struct cam_sim *sim, union ccb->cpi.initiator_id = MRSAS_SCSI_INITIATOR_ID; ccb->cpi.base_transfer_speed = 150000; strncpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(ccb->cpi.hba_vid, "LSI", HBA_IDLEN); + strncpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN); strncpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN); ccb->cpi.transport = XPORT_SPI; ccb->cpi.transport_version = 2; Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -564,12 +565,12 @@ get_row_from_strip(struct mrsas_softc *s else break; } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : Strip 0x%llx, span_set_Strip 0x%llx, span_set_Row 0x%llx " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : Strip 0x%llx, span_set_Strip 0x%llx, span_set_Row 0x%llx " "data width 0x%llx span offset 0x%llx\n", (unsigned long long)strip, (unsigned long long)span_set_Strip, (unsigned long long)span_set_Row, (unsigned long long)span_set->span_row_data_width, (unsigned long long)span_offset); - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : For strip 0x%llx row is 0x%llx\n", (unsigned long long)strip, + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : For strip 0x%llx row is 0x%llx\n", (unsigned long long)strip, (unsigned long long)span_set->data_row_start + (unsigned long long)span_set_Row + (span_offset - 1)); return (span_set->data_row_start + span_set_Row + (span_offset - 1)); @@ -629,7 +630,7 @@ get_strip_from_row(struct mrsas_softc *s } } } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug - get_strip_from_row: returns invalid " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug - get_strip_from_row: returns invalid " "strip for ld=%x, row=%lx\n", ld, (long unsigned int)row); return -1; } @@ -677,13 +678,13 @@ get_arm_from_strip(struct mrsas_softc *s else break; } - mrsas_dprint(sc, MRSAS_PRL11, "LSI PRL11: get_arm_from_strip: " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO PRL11: get_arm_from_strip: " "for ld=0x%x strip=0x%lx arm is 0x%x\n", ld, (long unsigned int)strip, (strip_offset - span_offset)); return (strip_offset - span_offset); } - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: - get_arm_from_strip: returns invalid arm" + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: - get_arm_from_strip: returns invalid arm" " for ld=%x strip=%lx\n", ld, (long unsigned int)strip); return -1; @@ -832,7 +833,7 @@ MR_BuildRaidContext(struct mrsas_softc * else if (sc->UnevenSpanSupport) { io_info->IoforUnevenSpan = 1; } else { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x," + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: raid->rowDataSize is 0, but has SPAN[0] rowDataSize = 0x%0x," " but there is _NO_ UnevenSpanSupport\n", MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize); return FALSE; @@ -859,13 +860,13 @@ MR_BuildRaidContext(struct mrsas_softc * startlba_span = (u_int8_t)mr_spanset_get_span_block(sc, ld, start_row, pdBlock, map, &error_code); if (error_code == 1) { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from %s %d. Send IO w/o region lock.\n", + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from %s %d. Send IO w/o region lock.\n", __func__, __LINE__); return FALSE; } } if (startlba_span == SPAN_INVALID) { - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: return from %s %d for row 0x%llx," + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: return from %s %d for row 0x%llx," "start strip %llx endSrip %llx\n", __func__, __LINE__, (unsigned long long)start_row, (unsigned long long)start_strip, @@ -874,12 +875,12 @@ MR_BuildRaidContext(struct mrsas_softc * } io_info->start_span = startlba_span; io_info->start_row = start_row; - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug: Check Span number from %s %d for row 0x%llx, " + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug: Check Span number from %s %d for row 0x%llx, " " start strip 0x%llx endSrip 0x%llx span 0x%x\n", __func__, __LINE__, (unsigned long long)start_row, (unsigned long long)start_strip, (unsigned long long)endStrip, startlba_span); - mrsas_dprint(sc, MRSAS_PRL11, "LSI Debug : 1. start_row 0x%llx endRow 0x%llx Start span 0x%x\n", + mrsas_dprint(sc, MRSAS_PRL11, "AVAGO Debug : 1. start_row 0x%llx endRow 0x%llx Start span 0x%x\n", (unsigned long long)start_row, (unsigned long long)endRow, startlba_span); } else { start_row = mega_div64_32(start_strip, raid->rowDataSize); @@ -1043,7 +1044,7 @@ mr_update_span_set(MR_DRV_RAID_MAP_ALL * span_row_width += MR_LdSpanPtrGet(ld, count, map)->spanRowDataSize; #if SPAN_DEBUG - printf("LSI Debug span %x rowDataSize %x\n", count, + printf("AVAGO Debug span %x rowDataSize %x\n", count, MR_LdSpanPtrGet(ld, count, map)->spanRowDataSize); #endif } @@ -1382,7 +1383,7 @@ u_int8_t mrsas_get_best_arm_pd(struct mr io_info->pd_after_lb = (bestArm == arm) ? pd0:pd1; #if SPAN_DEBUG if(arm != bestArm) - printf("LSI Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " + printf("AVAGO Debug R1 Load balance occur - span 0x%x arm 0x%x bestArm 0x%x " "io_info->span_arm 0x%x\n", span, arm, bestArm, io_info->span_arm); #endif Modified: head/sys/dev/mrsas/mrsas_ioctl.c ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_ioctl.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ @@ -238,7 +239,7 @@ mrsas_passthru(struct mrsas_softc *sc, v } sense_ptr = (unsigned long *)((unsigned long)cmd->frame + user_ioc->sense_off); - sense_ptr = ioctl_sense_mem; + *sense_ptr = ioctl_sense_phys_addr; } /* * Set the sync_cmd flag so that the ISR knows not to complete this @@ -296,12 +297,14 @@ out: /* * Release sense buffer */ - if (ioctl_sense_phys_addr) - bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap); - if (ioctl_sense_mem != NULL) - bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, ioctl_sense_dmamap); - if (ioctl_sense_tag != NULL) - bus_dma_tag_destroy(ioctl_sense_tag); + if (user_ioc->sense_len) { + if (ioctl_sense_phys_addr) + bus_dmamap_unload(ioctl_sense_tag, ioctl_sense_dmamap); + if (ioctl_sense_mem != NULL) + bus_dmamem_free(ioctl_sense_tag, ioctl_sense_mem, ioctl_sense_dmamap); + if (ioctl_sense_tag != NULL) + bus_dma_tag_destroy(ioctl_sense_tag); + } /* * Release data buffers Modified: head/sys/dev/mrsas/mrsas_ioctl.h ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_ioctl.h Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Marian Choy * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Marian Choy - * Support: freebsdraid@lsi.com + * Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ Modified: head/sys/dev/mrsas/mrsas_linux.c ============================================================================== --- head/sys/dev/mrsas/mrsas_linux.c Wed May 6 10:44:08 2015 (r282530) +++ head/sys/dev/mrsas/mrsas_linux.c Wed May 6 10:45:13 2015 (r282531) @@ -1,6 +1,7 @@ /* + * Copyright (c) 2015, AVAGO Tech. All rights reserved. Author: Kashyap Desai, * Copyright (c) 2014, LSI Corp. All rights reserved. Author: Kashyap Desai, - * Sibananda Sahu Support: freebsdraid@lsi.com + * Sibananda Sahu Support: freebsdraid@avagotech.com * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,7 +32,7 @@ * those of the authors and should not be interpreted as representing * official policies,either expressed or implied, of the FreeBSD Project. * - * Send feedback to: Mail to: LSI Corporation, 1621 + * Send feedback to: Mail to: AVAGO TECHNOLOGIES, 1621 * Barber Lane, Milpitas, CA 95035 ATTN: MegaRaid FreeBSD * */ From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:45:57 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71887A5A; Wed, 6 May 2015 10:45:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52D6E138C; Wed, 6 May 2015 10:45: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 t46AjvPt017463; Wed, 6 May 2015 10:45:57 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AjuEd017461; Wed, 6 May 2015 10:45:56 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061045.t46AjuEd017461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282532 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:45:57 -0000 Author: kadesai Date: Wed May 6 10:45:56 2015 New Revision: 282532 URL: https://svnweb.freebsd.org/changeset/base/282532 Log: Configured the mrsas(4) driver to support UNMAPPED I/O and updated driver version. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:13 2015 (r282531) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:56 2015 (r282532) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.705.10.02-fbsd" +#define MRSAS_VERSION "06.707.04.03-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:13 2015 (r282531) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:56 2015 (r282532) @@ -61,7 +61,8 @@ int mrsas_cam_attach(struct mrsas_softc int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); -int mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); +int mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb); int mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); @@ -315,7 +316,11 @@ mrsas_action(struct cam_sim *sim, union ccb->cpi.version_num = 1; ccb->cpi.hba_inquiry = 0; ccb->cpi.target_sprt = 0; +#if (__FreeBSD_version >= 902001) + ccb->cpi.hba_misc = PIM_UNMAPPED; +#else ccb->cpi.hba_misc = 0; +#endif ccb->cpi.hba_eng_cnt = 0; ccb->cpi.max_lun = MRSAS_SCSI_MAX_LUNS; ccb->cpi.unit_number = cam_sim_unit(sim); @@ -378,8 +383,13 @@ mrsas_scsiio_timeout(void *data) * on OCR enable/disable property of Controller from ocr_thread * context. */ +#if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); +#else + callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + mrsas_scsiio_timeout, cmd); +#endif sc->do_timedout_reset = 1; if (sc->ocr_thread_active) wakeup(&sc->ocr_chan); @@ -425,8 +435,8 @@ mrsas_startio(struct mrsas_softc *sc, st } else cmd->flags = MRSAS_DIR_NONE; /* no data */ - /* For FreeBSD 10.0 and higher */ -#if (__FreeBSD_version >= 1000000) +/* For FreeBSD 9.2 and higher */ +#if (__FreeBSD_version >= 902001) /* * XXX We don't yet support physical addresses here. */ @@ -455,6 +465,11 @@ mrsas_startio(struct mrsas_softc *sc, st if (cmd->length) cmd->data = csio->data_ptr; break; + case CAM_DATA_BIO: + cmd->length = csio->dxfer_len; + if (cmd->length) + cmd->data = csio->data_ptr; + break; default: ccb->ccb_h.status = CAM_REQ_INVALID; goto done; @@ -532,8 +547,13 @@ mrsas_startio(struct mrsas_softc *sc, st /* * Start timer for IO timeout. Default timeout value is 90 second. */ - callout_reset_sbt(&cmd->cm_callout, SBT_1MS * sc->mrsas_io_timeout, 0, - mrsas_scsiio_timeout, cmd, 0); +#if (__FreeBSD_version >= 1000510) + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + mrsas_scsiio_timeout, cmd, 0); +#else + callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + mrsas_scsiio_timeout, cmd); +#endif mrsas_atomic_inc(&sc->fw_outstanding); if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) @@ -677,7 +697,7 @@ mrsas_build_ldio(struct mrsas_softc *sc, io_request->DataLength = cmd->length; - if (mrsas_map_request(sc, cmd) == SUCCESS) { + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { if (cmd->sge_count > MRSAS_MAX_SGL) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); @@ -931,7 +951,7 @@ mrsas_build_dcdb(struct mrsas_softc *sc, io_request->LUN[1] = ccb_h->target_lun & 0xF; io_request->DataLength = cmd->length; - if (mrsas_map_request(sc, cmd) == SUCCESS) { + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { if (cmd->sge_count > sc->max_num_sge) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); @@ -954,20 +974,24 @@ mrsas_build_dcdb(struct mrsas_softc *sc, * is built in the callback. If the bus dmamap load is not successful, * cmd->error_code will contain the error code and a 1 is returned. */ -int -mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd) +int mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb) { u_int32_t retcode = 0; struct cam_sim *sim; - int flag = BUS_DMA_NOWAIT; sim = xpt_path_sim(cmd->ccb_ptr->ccb_h.path); if (cmd->data != NULL) { - mtx_lock(&sc->io_lock); /* Map data buffer into bus space */ + mtx_lock(&sc->io_lock); +#if (__FreeBSD_version >= 902001) + retcode = bus_dmamap_load_ccb(sc->data_tag, cmd->data_dmamap, ccb, + mrsas_data_load_cb, cmd, 0); +#else retcode = bus_dmamap_load(sc->data_tag, cmd->data_dmamap, cmd->data, - cmd->length, mrsas_data_load_cb, cmd, flag); + cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); +#endif mtx_unlock(&sc->io_lock); if (retcode) device_printf(sc->mrsas_dev, "bus_dmamap_load(): retcode = %d\n", retcode); From owner-svn-src-all@FreeBSD.ORG Wed May 6 10:46:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96EC0BA7; Wed, 6 May 2015 10:46: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 84B481398; Wed, 6 May 2015 10:46: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 t46AkU2Q017614; Wed, 6 May 2015 10:46:30 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46AkTIg017605; Wed, 6 May 2015 10:46:29 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201505061046.t46AkTIg017605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 6 May 2015 10:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282533 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 10:46:30 -0000 Author: kadesai Date: Wed May 6 10:46:28 2015 New Revision: 282533 URL: https://svnweb.freebsd.org/changeset/base/282533 Log: Corrected indentation on conflicted source files. Reviewed by: ambrisko MFC after: 2 weeks Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c head/sys/dev/mrsas/mrsas_ioctl.c head/sys/dev/mrsas/mrsas_ioctl.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas.c Wed May 6 10:46:28 2015 (r282533) @@ -84,16 +84,17 @@ static int mrsas_complete_cmd(struct mrs static int mrsas_clear_intr(struct mrsas_softc *sc); static int mrsas_get_ctrl_info(struct mrsas_softc *sc); static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); -static int +static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); -static struct mrsas_softc *mrsas_get_softc_instance(struct cdev *dev, - u_long cmd, caddr_t arg); +static struct mrsas_softc * +mrsas_get_softc_instance(struct cdev *dev, + u_long cmd, caddr_t arg); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); -u_int8_t +u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd); -void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc); +void mrsas_complete_outstanding_ioctls(struct mrsas_softc *sc); int mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr); int mrsas_init_adapter(struct mrsas_softc *sc); int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc); @@ -105,10 +106,10 @@ int mrsas_issue_dcmd(struct mrsas_softc int mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); int mrsas_reset_ctrl(struct mrsas_softc *sc); int mrsas_wait_for_outstanding(struct mrsas_softc *sc); -int +int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); -int +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, int size); void mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd); @@ -125,17 +126,17 @@ void mrsas_teardown_intr(struct mrsas_so void mrsas_addr_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); void mrsas_kill_hba(struct mrsas_softc *sc); void mrsas_aen_handler(struct mrsas_softc *sc); -void +void mrsas_write_reg(struct mrsas_softc *sc, int offset, u_int32_t value); -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi); void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); -void +void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd, u_int8_t status); -void +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t extStatus); struct mrsas_mfi_cmd *mrsas_get_mfi_cmd(struct mrsas_softc *sc); @@ -275,7 +276,7 @@ mrsas_disable_intr(struct mrsas_softc *s u_int32_t mask = 0xFFFFFFFF; u_int32_t status; - sc->mask_interrupts=1; + sc->mask_interrupts = 1; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); /* Dummy read to force pci flush */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); @@ -287,7 +288,7 @@ mrsas_enable_intr(struct mrsas_softc *sc u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; u_int32_t status; - sc->mask_interrupts=0; + sc->mask_interrupts = 0; mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); @@ -1262,18 +1263,22 @@ mrsas_get_softc_instance(struct cdev *de { struct mrsas_softc *sc = NULL; struct mrsas_iocpacket *user_ioc = (struct mrsas_iocpacket *)arg; - if (cmd == MRSAS_IOC_GET_PCI_INFO){ - sc = dev->si_drv1; + + if (cmd == MRSAS_IOC_GET_PCI_INFO) { + sc = dev->si_drv1; } else { - /* get the Host number & the softc from data sent by the Application */ - sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; + /* + * get the Host number & the softc from data sent by the + * Application + */ + sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { if (sc == NULL) mrsas_dprint(sc, MRSAS_FAULT, - "There is no Controller number %d .\n", user_ioc->host_no); + "There is no Controller number %d .\n", user_ioc->host_no); else mrsas_dprint(sc, MRSAS_FAULT, - "Invalid Controller number %d .\n", user_ioc->host_no); + "Invalid Controller number %d .\n", user_ioc->host_no); } } @@ -1343,17 +1348,17 @@ do_ioctl: break; case MRSAS_IOC_GET_PCI_INFO: - pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *)arg; - memset (pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); + pciDrvInfo = (MRSAS_DRV_PCI_INFORMATION *) arg; + memset(pciDrvInfo, 0, sizeof(MRSAS_DRV_PCI_INFORMATION)); pciDrvInfo->busNumber = pci_get_bus(sc->mrsas_dev); pciDrvInfo->deviceNumber = pci_get_slot(sc->mrsas_dev); pciDrvInfo->functionNumber = pci_get_function(sc->mrsas_dev); pciDrvInfo->domainID = pci_get_domain(sc->mrsas_dev); - mrsas_dprint (sc, MRSAS_INFO, "pci bus no: %d," - "pci device no: %d, pci function no: %d," - "pci domain ID: %d\n", - pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, - pciDrvInfo->functionNumber, pciDrvInfo->domainID); + mrsas_dprint(sc, MRSAS_INFO, "pci bus no: %d," + "pci device no: %d, pci function no: %d," + "pci domain ID: %d\n", + pciDrvInfo->busNumber, pciDrvInfo->deviceNumber, + pciDrvInfo->functionNumber, pciDrvInfo->domainID); ret = 0; break; @@ -1670,8 +1675,8 @@ mrsas_map_mpt_cmd_status(struct mrsas_mp static int mrsas_alloc_mem(struct mrsas_softc *sc) { - u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, chain_frame_size, - evt_detail_size, count; + u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, + chain_frame_size, evt_detail_size, count; /* * Allocate parent DMA tag @@ -1996,7 +2001,7 @@ ABORT: * get_pdlist, get_ld_list and max_sectors are currently not being used, it * is left here as placeholder. */ -static int +static int mrsas_init_fw(struct mrsas_softc *sc) { @@ -2065,11 +2070,10 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); return (1); } - sc->ctrl_info = malloc(sizeof(struct mrsas_ctrl_info), M_MRSAS, M_NOWAIT); if (!sc->ctrl_info) { device_printf(sc->mrsas_dev, "Malloc for ctrl_info failed.\n"); - return(1); + return (1); } /* * Get the controller info from FW, so that the MAX VD support @@ -2077,10 +2081,10 @@ mrsas_init_fw(struct mrsas_softc *sc) */ if (mrsas_get_ctrl_info(sc)) { device_printf(sc->mrsas_dev, "Unable to get FW ctrl_info.\n"); - return(1); + return (1); } sc->secure_jbod_support = - (u_int8_t) sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; + (u_int8_t)sc->ctrl_info->adapterOperations3.supportSecurityonJBOD; if (sc->secure_jbod_support) device_printf(sc->mrsas_dev, "FW supports SED \n"); @@ -2109,7 +2113,7 @@ mrsas_init_fw(struct mrsas_softc *sc) */ tmp_sectors = 0; max_sectors_1 = (1 << sc->ctrl_info->stripe_sz_ops.min) * - sc->ctrl_info->max_strips_per_io; + sc->ctrl_info->max_strips_per_io; max_sectors_2 = sc->ctrl_info->max_request_size; tmp_sectors = min(max_sectors_1, max_sectors_2); sc->max_sectors_per_req = sc->max_num_sge * MRSAS_PAGE_SIZE / 512; @@ -2118,9 +2122,9 @@ mrsas_init_fw(struct mrsas_softc *sc) sc->max_sectors_per_req = tmp_sectors; sc->disableOnlineCtrlReset = - sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; sc->UnevenSpanSupport = - sc->ctrl_info->adapterOperations2.supportUnevenSpans; + sc->ctrl_info->adapterOperations2.supportUnevenSpans; if (sc->UnevenSpanSupport) { device_printf(sc->mrsas_dev, "FW supports: UnevenSpanSupport=%x\n\n", sc->UnevenSpanSupport); @@ -2130,7 +2134,6 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } - return (0); } @@ -2451,7 +2454,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc * This functions fires the command to Firmware by writing to the * inbound_low_queue_port and inbound_high_queue_port. */ -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { @@ -2815,7 +2818,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n"); continue; } - /* Re-fire management commands */ for (j = 0; j < sc->max_fw_cmds; j++) { mpt_cmd = sc->mpt_cmd_list[j]; @@ -2850,7 +2852,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) retval = FAIL; goto out; } - if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); @@ -2895,7 +2896,7 @@ mrsas_kill_hba(struct mrsas_softc *sc) MFI_STOP_ADP); /* Flush */ mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)); - mrsas_complete_outstanding_ioctls (sc); + mrsas_complete_outstanding_ioctls(sc); } /** @@ -2904,22 +2905,24 @@ mrsas_kill_hba(struct mrsas_softc *sc) * * Returns void */ -void mrsas_complete_outstanding_ioctls (struct mrsas_softc *sc){ +void +mrsas_complete_outstanding_ioctls(struct mrsas_softc *sc) +{ int i; - struct mrsas_mpt_cmd *cmd_mpt; - struct mrsas_mfi_cmd *cmd_mfi; - u_int32_t count, MSIxIndex; + struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mfi_cmd *cmd_mfi; + u_int32_t count, MSIxIndex; count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; - for (i=0; imax_fw_cmds; i++){ + for (i = 0; i < sc->max_fw_cmds; i++) { cmd_mpt = sc->mpt_cmd_list[i]; - if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX){ + if (cmd_mpt->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; - if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT){ - for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) + if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_mptmfi_passthru(sc, cmd_mfi, - cmd_mpt->io_request->RaidContext.status); + cmd_mpt->io_request->RaidContext.status); } } } @@ -3058,18 +3061,19 @@ mrsas_get_ctrl_info(struct mrsas_softc * * input: * sc - Controller's softc */ -static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) +static void +mrsas_update_ext_vd_details(struct mrsas_softc *sc) { sc->max256vdSupport = - sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; /* Below is additional check to address future FW enhancement */ if (sc->ctrl_info->max_lds > 64) sc->max256vdSupport = 1; sc->drv_supported_vd_count = MRSAS_MAX_LD_CHANNELS - * MRSAS_MAX_DEV_PER_CHANNEL; + * MRSAS_MAX_DEV_PER_CHANNEL; sc->drv_supported_pd_count = MRSAS_MAX_PD_CHANNELS - * MRSAS_MAX_DEV_PER_CHANNEL; + * MRSAS_MAX_DEV_PER_CHANNEL; if (sc->max256vdSupport) { sc->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT; sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; @@ -3078,13 +3082,13 @@ static void mrsas_update_ext_vd_details( sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; } - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->drv_supported_vd_count - 1)); + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * + (sc->drv_supported_vd_count - 1)); sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); @@ -3869,7 +3873,7 @@ mrsas_get_ld_list(struct mrsas_softc *sc * memory is initialized to all zeros upon successful loading of the dma * mapped memory. */ -int +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, int size) { Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas.h Wed May 6 10:46:28 2015 (r282533) @@ -1323,7 +1323,7 @@ typedef enum _MR_SCSI_CMD_TYPE { NON_READ_WRITE_LDIO = 1, READ_WRITE_SYSPDIO = 2, NON_READ_WRITE_SYSPDIO = 3, -} MR_SCSI_CMD_TYPE; +} MR_SCSI_CMD_TYPE; enum mrsas_req_flags { MRSAS_DIR_UNKNOWN = 0x1, @@ -1908,27 +1908,27 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ - u_int32_t supportPersonalityChange:2; - u_int32_t supportThermalPollInterval:1; - u_int32_t supportDisableImmediateIO:1; - u_int32_t supportT10RebuildAssist:1; - u_int32_t supportMaxExtLDs:1; - u_int32_t supportCrashDump:1; - u_int32_t supportSwZone:1; - u_int32_t supportDebugQueue:1; - u_int32_t supportNVCacheErase:1; - u_int32_t supportForceTo512e:1; - u_int32_t supportHOQRebuild:1; - u_int32_t supportAllowedOpsforDrvRemoval:1; - u_int32_t supportDrvActivityLEDSetting:1; - u_int32_t supportNVDRAM:1; - u_int32_t supportForceFlash:1; - u_int32_t supportDisableSESMonitoring:1; - u_int32_t supportCacheBypassModes:1; - u_int32_t supportSecurityonJBOD:1; - u_int32_t discardCacheDuringLDDelete:1; - u_int32_t reserved:12; - } adapterOperations3; + u_int32_t supportPersonalityChange:2; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportCrashDump:1; + u_int32_t supportSwZone:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportForceFlash:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t reserved:12; + } adapterOperations3; u_int8_t pad[0x800 - 0x7EC]; /* 0x7EC */ } __packed; @@ -2002,7 +2002,7 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_core_affinity:1; u_int32_t security_protocol_cmds_fw:1; u_int32_t reserved:25; - } mfi_capabilities; + } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2444,29 +2444,37 @@ struct mrsas_mgmt_info { int max_index; }; -#define PCI_TYPE0_ADDRESSES 6 -#define PCI_TYPE1_ADDRESSES 2 -#define PCI_TYPE2_ADDRESSES 5 - -typedef struct _MRSAS_DRV_PCI_COMMON_HEADER -{ - u_int16_t vendorID; // (ro) - u_int16_t deviceID; // (ro) - u_int16_t command; // Device control +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 + +typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { + u_int16_t vendorID; + //(ro) + u_int16_t deviceID; + //(ro) + u_int16_t command; + //Device control u_int16_t status; - u_int8_t revisionID; // (ro) - u_int8_t progIf; // (ro) - u_int8_t subClass; // (ro) - u_int8_t baseClass; // (ro) - u_int8_t cacheLineSize; // (ro+) - u_int8_t latencyTimer; // (ro+) - u_int8_t headerType; // (ro) - u_int8_t bist; // Built in self test - - union - { - struct _MRSAS_DRV_PCI_HEADER_TYPE_0 - { + u_int8_t revisionID; + //(ro) + u_int8_t progIf; + //(ro) + u_int8_t subClass; + //(ro) + u_int8_t baseClass; + //(ro) + u_int8_t cacheLineSize; + //(ro +) + u_int8_t latencyTimer; + //(ro +) + u_int8_t headerType; + //(ro) + u_int8_t bist; + //Built in self test + + union { + struct _MRSAS_DRV_PCI_HEADER_TYPE_0 { u_int32_t baseAddresses[PCI_TYPE0_ADDRESSES]; u_int32_t cis; u_int16_t subVendorID; @@ -2476,134 +2484,126 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEA u_int8_t reserved1[3]; u_int32_t reserved2; u_int8_t interruptLine; - u_int8_t interruptPin; // (ro) - u_int8_t minimumGrant; // (ro) - u_int8_t maximumLatency; // (ro) - } type0; - - /* - * PCI to PCI Bridge - */ - - struct _MRSAS_DRV_PCI_HEADER_TYPE_1 - { - u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; - u_int8_t primaryBus; - u_int8_t secondaryBus; - u_int8_t subordinateBus; - u_int8_t secondaryLatency; - u_int8_t ioBase; - u_int8_t ioLimit; - u_int16_t secondaryStatus; - u_int16_t memoryBase; - u_int16_t memoryLimit; - u_int16_t prefetchBase; - u_int16_t prefetchLimit; - u_int32_t prefetchBaseUpper32; - u_int32_t prefetchLimitUpper32; - u_int16_t ioBaseUpper16; - u_int16_t ioLimitUpper16; - u_int8_t capabilitiesPtr; - u_int8_t reserved1[3]; - u_int32_t romBaseAddress; - u_int8_t interruptLine; - u_int8_t interruptPin; - u_int16_t bridgeControl; - } type1; - - /* - * PCI to CARDBUS Bridge - */ - - struct _MRSAS_DRV_PCI_HEADER_TYPE_2 - { - u_int32_t socketRegistersBaseAddress; - u_int8_t capabilitiesPtr; - u_int8_t reserved; - u_int16_t secondaryStatus; - u_int8_t primaryBus; - u_int8_t secondaryBus; - u_int8_t subordinateBus; - u_int8_t secondaryLatency; - struct - { - u_int32_t base; - u_int32_t limit; - } range[PCI_TYPE2_ADDRESSES-1]; - u_int8_t interruptLine; - u_int8_t interruptPin; - u_int16_t bridgeControl; - } type2; - } u; + u_int8_t interruptPin; + //(ro) + u_int8_t minimumGrant; + //(ro) + u_int8_t maximumLatency; + //(ro) + } type0; + + /* + * PCI to PCI Bridge + */ + + struct _MRSAS_DRV_PCI_HEADER_TYPE_1 { + u_int32_t baseAddresses[PCI_TYPE1_ADDRESSES]; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + u_int8_t ioBase; + u_int8_t ioLimit; + u_int16_t secondaryStatus; + u_int16_t memoryBase; + u_int16_t memoryLimit; + u_int16_t prefetchBase; + u_int16_t prefetchLimit; + u_int32_t prefetchBaseUpper32; + u_int32_t prefetchLimitUpper32; + u_int16_t ioBaseUpper16; + u_int16_t ioLimitUpper16; + u_int8_t capabilitiesPtr; + u_int8_t reserved1[3]; + u_int32_t romBaseAddress; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type1; + + /* + * PCI to CARDBUS Bridge + */ -} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; + struct _MRSAS_DRV_PCI_HEADER_TYPE_2 { + u_int32_t socketRegistersBaseAddress; + u_int8_t capabilitiesPtr; + u_int8_t reserved; + u_int16_t secondaryStatus; + u_int8_t primaryBus; + u_int8_t secondaryBus; + u_int8_t subordinateBus; + u_int8_t secondaryLatency; + struct { + u_int32_t base; + u_int32_t limit; + } range [PCI_TYPE2_ADDRESSES - 1]; + u_int8_t interruptLine; + u_int8_t interruptPin; + u_int16_t bridgeControl; + } type2; + } u; -#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes +} MRSAS_DRV_PCI_COMMON_HEADER, *PMRSAS_DRV_PCI_COMMON_HEADER; -typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY -{ - union - { - struct - { - u_int32_t linkSpeed :4; - u_int32_t linkWidth :6; - u_int32_t aspmSupport :2; - u_int32_t losExitLatency :3; - u_int32_t l1ExitLatency :3; - u_int32_t rsvdp :6; - u_int32_t portNumber :8; - }bits; +#define MRSAS_DRV_PCI_COMMON_HEADER_SIZE sizeof(MRSAS_DRV_PCI_COMMON_HEADER) //64 bytes + +typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { + union { + struct { + u_int32_t linkSpeed:4; + u_int32_t linkWidth:6; + u_int32_t aspmSupport:2; + u_int32_t losExitLatency:3; + u_int32_t l1ExitLatency:3; + u_int32_t rsvdp:6; + u_int32_t portNumber:8; + } bits; u_int32_t asUlong; - }u; -}MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; + } u; +} MRSAS_DRV_PCI_LINK_CAPABILITY, *PMRSAS_DRV_PCI_LINK_CAPABILITY; -#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) +#define MRSAS_DRV_PCI_LINK_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_CAPABILITY) -typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY -{ - union - { - struct - { - u_int16_t linkSpeed :4; - u_int16_t negotiatedLinkWidth :6; - u_int16_t linkTrainingError :1; - u_int16_t linkTraning :1; - u_int16_t slotClockConfig :1; - u_int16_t rsvdZ :3; - }bits; +typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { + union { + struct { + u_int16_t linkSpeed:4; + u_int16_t negotiatedLinkWidth:6; + u_int16_t linkTrainingError:1; + u_int16_t linkTraning:1; + u_int16_t slotClockConfig:1; + u_int16_t rsvdZ:3; + } bits; u_int16_t asUshort; - }u; + } u; u_int16_t reserved; -} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; +} MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY, *PMRSAS_DRV_PCI_LINK_STATUS_CAPABILITY; -#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) +#define MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY_SIZE sizeof(MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY) -typedef struct _MRSAS_DRV_PCI_CAPABILITIES -{ - MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; - MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; -}MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; +typedef struct _MRSAS_DRV_PCI_CAPABILITIES { + MRSAS_DRV_PCI_LINK_CAPABILITY linkCapability; + MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY linkStatusCapability; +} MRSAS_DRV_PCI_CAPABILITIES, *PMRSAS_DRV_PCI_CAPABILITIES; -#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) +#define MRSAS_DRV_PCI_CAPABILITIES_SIZE sizeof(MRSAS_DRV_PCI_CAPABILITIES) /* PCI information */ -typedef struct _MRSAS_DRV_PCI_INFORMATION -{ - u_int32_t busNumber; - u_int8_t deviceNumber; - u_int8_t functionNumber; - u_int8_t interruptVector; - u_int8_t reserved1; - MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; - MRSAS_DRV_PCI_CAPABILITIES capability; - u_int32_t domainID; - u_int8_t reserved2[28]; -}MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; +typedef struct _MRSAS_DRV_PCI_INFORMATION { + u_int32_t busNumber; + u_int8_t deviceNumber; + u_int8_t functionNumber; + u_int8_t interruptVector; + u_int8_t reserved1; + MRSAS_DRV_PCI_COMMON_HEADER pciHeaderInfo; + MRSAS_DRV_PCI_CAPABILITIES capability; + u_int32_t domainID; + u_int8_t reserved2[28]; +} MRSAS_DRV_PCI_INFORMATION, *PMRSAS_DRV_PCI_INFORMATION; /******************************************************************* * per-instance data @@ -2668,7 +2668,7 @@ struct mrsas_softc { int msix_vectors; int msix_enable; uint32_t msix_reg_offset[16]; - uint8_t mask_interrupts; + uint8_t mask_interrupts; struct mrsas_mpt_cmd **mpt_cmd_list; struct mrsas_mfi_cmd **mfi_cmd_list; TAILQ_HEAD(, mrsas_mpt_cmd) mrsas_mpt_cmd_list_head; @@ -2740,7 +2740,7 @@ struct mrsas_softc { struct task ev_task; u_int32_t CurLdCount; u_int64_t reset_flags; - int lb_pending_cmds; + int lb_pending_cmds; LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas_cam.c Wed May 6 10:46:28 2015 (r282533) @@ -58,18 +58,19 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ int mrsas_cam_attach(struct mrsas_softc *sc); -int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); +int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb); int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); -int mrsas_map_request(struct mrsas_softc *sc, - struct mrsas_mpt_cmd *cmd, union ccb *ccb); int +mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb); +int mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); -int +int mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, struct cam_sim *sim); -int +int mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, u_int32_t device_id, MRSAS_RAID_SCSI_IO_REQUEST * io_request); @@ -79,10 +80,10 @@ void mrsas_cam_detach(struct mrsas_softc void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_unmap_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); -void +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi); -void +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, @@ -91,10 +92,10 @@ static void mrsas_freeze_simq(struct mrs static void mrsas_cam_poll(struct cam_sim *sim); static void mrsas_action(struct cam_sim *sim, union ccb *ccb); static void mrsas_scsiio_timeout(void *data); -static void +static void mrsas_data_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); -static int32_t +static int32_t mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim, union ccb *ccb); struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); @@ -114,8 +115,9 @@ MR_BuildRaidContext(struct mrsas_softc * extern u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -extern u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, - PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +extern u_int16_t +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); @@ -385,10 +387,10 @@ mrsas_scsiio_timeout(void *data) */ #if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); #else callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, - mrsas_scsiio_timeout, cmd); + mrsas_scsiio_timeout, cmd); #endif sc->do_timedout_reset = 1; if (sc->ocr_thread_active) @@ -549,10 +551,10 @@ mrsas_startio(struct mrsas_softc *sc, st */ #if (__FreeBSD_version >= 1000510) callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, - mrsas_scsiio_timeout, cmd, 0); + mrsas_scsiio_timeout, cmd, 0); #else callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, - mrsas_scsiio_timeout, cmd); + mrsas_scsiio_timeout, cmd); #endif mrsas_atomic_inc(&sc->fw_outstanding); @@ -574,7 +576,8 @@ done: * This function determines if the IO is read/write or inquiry. It returns a 1 * if the IO is read/write and 0 if it is inquiry. */ -int mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) +int +mrsas_find_io_type(struct cam_sim *sim, union ccb *ccb) { struct ccb_scsiio *csio = &(ccb->csio); @@ -588,10 +591,10 @@ int mrsas_find_io_type(struct cam_sim *s case READ_16: case WRITE_16: return (cam_sim_bus(sim) ? - READ_WRITE_SYSPDIO : READ_WRITE_LDIO); + READ_WRITE_SYSPDIO : READ_WRITE_LDIO); default: return (cam_sim_bus(sim) ? - NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); + NON_READ_WRITE_SYSPDIO : NON_READ_WRITE_LDIO); } } @@ -844,8 +847,8 @@ mrsas_setup_io(struct mrsas_softc *sc, s if ((sc->load_balance_info[device_id].loadBalanceFlag) && (io_info.isRead)) { io_info.devHandle = - mrsas_get_updated_dev_handle(sc, - &sc->load_balance_info[device_id], &io_info); + mrsas_get_updated_dev_handle(sc, + &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; cmd->pd_r1_lb = io_info.pd_after_lb; } else @@ -897,27 +900,27 @@ mrsas_build_dcdb(struct mrsas_softc *sc, device_id = ccb_h->target_id; map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; - /* - * Check if this is RW for system PD or - * it's a NON RW for sys PD and there is NO secure jbod FW support - */ + /* + * Check if this is RW for system PD or + * it's a NON RW for sys PD and there is NO secure jbod FW support + */ if (cam_sim_bus(sim) == 1 && - sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM){ + sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM) { io_request->DevHandle = - map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; io_request->RaidContext.RAIDFlags = - MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << - MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; + MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << + MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; cmd->request_desc->SCSIIO.MSIxIndex = - sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - if(sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { + if (sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { /* system pd firmware path */ - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } else { /* system pd fast path */ io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; @@ -927,8 +930,8 @@ mrsas_build_dcdb(struct mrsas_softc *sc, io_request->RaidContext.regLockLength = 0; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); /* * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH @@ -937,14 +940,14 @@ mrsas_build_dcdb(struct mrsas_softc *sc, */ if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; - } + } } else { - /* FW path for SysPD or LD Non-RW (SCSI management commands)*/ - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + /* FW path for SysPD or LD Non-RW (SCSI management commands) */ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } io_request->RaidContext.VirtualDiskTgtId = device_id; @@ -974,8 +977,9 @@ mrsas_build_dcdb(struct mrsas_softc *sc, * is built in the callback. If the bus dmamap load is not successful, * cmd->error_code will contain the error code and a 1 is returned. */ -int mrsas_map_request(struct mrsas_softc *sc, - struct mrsas_mpt_cmd *cmd, union ccb *ccb) +int +mrsas_map_request(struct mrsas_softc *sc, + struct mrsas_mpt_cmd *cmd, union ccb *ccb) { u_int32_t retcode = 0; struct cam_sim *sim; @@ -987,10 +991,10 @@ int mrsas_map_request(struct mrsas_softc mtx_lock(&sc->io_lock); #if (__FreeBSD_version >= 902001) retcode = bus_dmamap_load_ccb(sc->data_tag, cmd->data_dmamap, ccb, - mrsas_data_load_cb, cmd, 0); + mrsas_data_load_cb, cmd, 0); #else retcode = bus_dmamap_load(sc->data_tag, cmd->data_dmamap, cmd->data, - cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); + cmd->length, mrsas_data_load_cb, cmd, BUS_DMA_NOWAIT); #endif mtx_unlock(&sc->io_lock); if (retcode) Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:45:56 2015 (r282532) +++ head/sys/dev/mrsas/mrsas_fp.c Wed May 6 10:46:28 2015 (r282533) @@ -55,13 +55,14 @@ __FBSDID("$FreeBSD$"); * Function prototypes */ u_int8_t MR_ValidateMapInfo(struct mrsas_softc *sc); -u_int8_t mrsas_get_best_arm_pd(struct mrsas_softc *sc, - PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int8_t +mrsas_get_best_arm_pd(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +u_int8_t MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_REQUEST_INFO *io_info, RAID_CONTEXT * pRAID_Context, MR_DRV_RAID_MAP_ALL * map); -u_int8_t +u_int8_t MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, u_int64_t stripRow, u_int16_t stripRef, struct IO_REQUEST_INFO *io_info, RAID_CONTEXT * pRAID_Context, @@ -69,31 +70,33 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); u_int16_t MR_GetLDTgtId(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); -u_int16_t mrsas_get_updated_dev_handle(struct mrsas_softc *sc, - PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); +u_int16_t +mrsas_get_updated_dev_handle(struct mrsas_softc *sc, + PLD_LOAD_BALANCE_INFO lbInfo, struct IO_REQUEST_INFO *io_info); u_int32_t mega_mod64(u_int64_t dividend, u_int32_t divisor); -u_int32_t +u_int32_t MR_GetSpanBlock(u_int32_t ld, u_int64_t row, u_int64_t *span_blk, MR_DRV_RAID_MAP_ALL * map, int *div_error); u_int64_t mega_div64_32(u_int64_t dividend, u_int32_t divisor); -void mrsas_update_load_balance_params(struct mrsas_softc *sc, - MR_DRV_RAID_MAP_ALL *map, PLD_LOAD_BALANCE_INFO lbInfo); void +mrsas_update_load_balance_params(struct mrsas_softc *sc, + MR_DRV_RAID_MAP_ALL * map, PLD_LOAD_BALANCE_INFO lbInfo); +void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQUEST * io_request, u_int8_t cdb_len, struct IO_REQUEST_INFO *io_info, union ccb *ccb, MR_DRV_RAID_MAP_ALL * local_map_ptr, u_int32_t ref_tag, u_int32_t ld_block_size); -static u_int16_t +static u_int16_t MR_LdSpanArrayGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); static u_int16_t MR_PdDevHandleGet(u_int32_t pd, MR_DRV_RAID_MAP_ALL * map); -static u_int16_t +static u_int16_t MR_ArPdGet(u_int32_t ar, u_int32_t arm, MR_DRV_RAID_MAP_ALL * map); static MR_LD_SPAN * MR_LdSpanPtrGet(u_int32_t ld, u_int32_t span, MR_DRV_RAID_MAP_ALL * map); -static u_int8_t +static u_int8_t MR_LdDataArmGet(u_int32_t ld, u_int32_t armIdx, MR_DRV_RAID_MAP_ALL * map); static MR_SPAN_BLOCK_INFO * @@ -144,7 +147,7 @@ typedef u_int32_t REGION_LEN; #define FALSE 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed May 6 11:23:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B567FD; Wed, 6 May 2015 11:23: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 ED76217B3; Wed, 6 May 2015 11:23: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 t46BNERf036454; Wed, 6 May 2015 11:23:14 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46BNEd6036453; Wed, 6 May 2015 11:23:14 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201505061123.t46BNEd6036453@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 6 May 2015 11:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282534 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 11:23:15 -0000 Author: melifaro Date: Wed May 6 11:23:14 2015 New Revision: 282534 URL: https://svnweb.freebsd.org/changeset/base/282534 Log: Correctly print valtype for empty bitmask. Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Wed May 6 10:46:28 2015 (r282533) +++ head/sbin/ipfw/tables.c Wed May 6 11:23:14 2015 (r282534) @@ -715,6 +715,7 @@ table_print_valheader(char *buf, size_t return; } + memset(buf, 0, bufsize); print_flags_buffer(buf, bufsize, tablevaltypes, vmask); } From owner-svn-src-all@FreeBSD.ORG Wed May 6 14:02:58 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15097491; Wed, 6 May 2015 14:02: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 041AF1A8C; Wed, 6 May 2015 14:02: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 t46E2vOt015908; Wed, 6 May 2015 14:02:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46E2vuA015907; Wed, 6 May 2015 14:02:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201505061402.t46E2vuA015907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 6 May 2015 14:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282536 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 14:02:58 -0000 Author: ae Date: Wed May 6 14:02:57 2015 New Revision: 282536 URL: https://svnweb.freebsd.org/changeset/base/282536 Log: Pass mtag argument into m_tag_locate() to continue the search from the last found mtag. Modified: head/sys/net/if_me.c Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Wed May 6 11:50:30 2015 (r282535) +++ head/sys/net/if_me.c Wed May 6 14:02:57 2015 (r282536) @@ -477,7 +477,7 @@ me_check_nesting(struct ifnet *ifp, stru count = 1; mtag = NULL; - while ((mtag = m_tag_locate(m, MTAG_ME, 0, NULL)) != NULL) { + while ((mtag = m_tag_locate(m, MTAG_ME, 0, mtag)) != NULL) { if (*(struct ifnet **)(mtag + 1) == ifp) { log(LOG_NOTICE, "%s: loop detected\n", ifp->if_xname); return (EIO); From owner-svn-src-all@FreeBSD.ORG Wed May 6 14:09:55 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70C896CB; Wed, 6 May 2015 14:09:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E5AE1AFA; Wed, 6 May 2015 14:09:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46E9trw016821; Wed, 6 May 2015 14:09:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46E9tGQ016820; Wed, 6 May 2015 14:09:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505061409.t46E9tGQ016820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 6 May 2015 14:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282537 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 14:09:55 -0000 Author: andrew Date: Wed May 6 14:09:54 2015 New Revision: 282537 URL: https://svnweb.freebsd.org/changeset/base/282537 Log: If the power management timer is unsupported the PmTimerLength value will be zero. Modified: head/sys/dev/acpica/acpi_timer.c Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Wed May 6 14:02:57 2015 (r282536) +++ head/sys/dev/acpica/acpi_timer.c Wed May 6 14:09:54 2015 (r282537) @@ -128,7 +128,8 @@ acpi_timer_identify(driver_t *driver, de ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (acpi_disabled("timer") || (acpi_quirks & ACPI_Q_TIMER) || - acpi_timer_dev || acpi_timer_disabled) + acpi_timer_dev || acpi_timer_disabled || + AcpiGbl_FADT.PmTimerLength == 0) return_VOID; if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) { From owner-svn-src-all@FreeBSD.ORG Wed May 6 14:14:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8853595E; Wed, 6 May 2015 14:14: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 74E1C1C13; Wed, 6 May 2015 14:14: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 t46EEFSx021018; Wed, 6 May 2015 14:14:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46EEFCh021017; Wed, 6 May 2015 14:14:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505061414.t46EEFCh021017@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 6 May 2015 14:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282538 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 14:14:15 -0000 Author: andrew Date: Wed May 6 14:14:14 2015 New Revision: 282538 URL: https://svnweb.freebsd.org/changeset/base/282538 Log: AcpiGbl_FACS will not be defined when building using the reduced hardware model. This may be the case on ARM. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed May 6 14:09:54 2015 (r282537) +++ head/sys/dev/acpica/acpi.c Wed May 6 14:14:14 2015 (r282538) @@ -605,9 +605,11 @@ acpi_attach(device_t dev) if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) sc->acpi_handle_reboot = 1; +#if !ACPI_REDUCED_HARDWARE /* Only enable S4BIOS by default if the FACS says it is available. */ if (AcpiGbl_FACS != NULL && AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; +#endif /* Probe all supported sleep states. */ acpi_sleep_states[ACPI_STATE_S0] = TRUE; From owner-svn-src-all@FreeBSD.ORG Wed May 6 15:17:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6AA3F21; Wed, 6 May 2015 15:17: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 C51921376; Wed, 6 May 2015 15:17: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 t46FHT2G055503; Wed, 6 May 2015 15:17:29 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FHSb1055497; Wed, 6 May 2015 15:17:28 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201505061517.t46FHSb1055497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 6 May 2015 15:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282547 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:17:30 -0000 Author: zbb Date: Wed May 6 15:17:28 2015 New Revision: 282547 URL: https://svnweb.freebsd.org/changeset/base/282547 Log: Add new CP15 operations and DB_SHOW_COMMAND to print CP15 registers Submitted by: Wojciech Macek Reviewed by: imp, Michal Meloun Obtained from: Semihalf Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/armreg.h head/sys/arm/include/cpu-v6.h head/sys/arm/include/sysreg.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/arm/machdep.c Wed May 6 15:17:28 2015 (r282547) @@ -114,7 +114,57 @@ __FBSDID("$FreeBSD$"); #ifdef DDB #include -#endif + +#if __ARM_ARCH >= 6 +#include + +DB_SHOW_COMMAND(cp15, db_show_cp15) +{ + u_int reg; + + reg = cp15_midr_get(); + db_printf("Cpu ID: 0x%08x\n", reg); + reg = cp15_ctr_get(); + db_printf("Current Cache Lvl ID: 0x%08x\n",reg); + + reg = cp15_sctlr_get(); + db_printf("Ctrl: 0x%08x\n",reg); + reg = cp15_actlr_get(); + db_printf("Aux Ctrl: 0x%08x\n",reg); + + reg = cp15_id_pfr0_get(); + db_printf("Processor Feat 0: 0x%08x\n", reg); + reg = cp15_id_pfr1_get(); + db_printf("Processor Feat 1: 0x%08x\n", reg); + reg = cp15_id_dfr0_get(); + db_printf("Debug Feat 0: 0x%08x\n", reg); + reg = cp15_id_afr0_get(); + db_printf("Auxiliary Feat 0: 0x%08x\n", reg); + reg = cp15_id_mmfr0_get(); + db_printf("Memory Model Feat 0: 0x%08x\n", reg); + reg = cp15_id_mmfr1_get(); + db_printf("Memory Model Feat 1: 0x%08x\n", reg); + reg = cp15_id_mmfr2_get(); + db_printf("Memory Model Feat 2: 0x%08x\n", reg); + reg = cp15_id_mmfr3_get(); + db_printf("Memory Model Feat 3: 0x%08x\n", reg); + reg = cp15_ttbr_get(); + db_printf("TTB0: 0x%08x\n", reg); +} + +DB_SHOW_COMMAND(vtop, db_show_vtop) +{ + u_int reg; + + if (have_addr) { + cp15_ats1cpr_set(addr); + reg = cp15_par_get(); + db_printf("Physical address reg: 0x%08x\n",reg); + } else + db_printf("show vtop \n"); +} +#endif /* __ARM_ARCH >= 6 */ +#endif /* DDB */ #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/include/armreg.h Wed May 6 15:17:28 2015 (r282547) @@ -346,6 +346,9 @@ #define CPUV7_CT_xSIZE_ASSOC(x) (((x) >> 3) & 0x3ff) /* associativity */ #define CPUV7_CT_xSIZE_SET(x) (((x) >> 13) & 0x7fff) /* num sets */ +#define CPUV7_L2CTLR_NPROC_SHIFT 24 +#define CPUV7_L2CTLR_NPROC(r) ((((r) >> CPUV7_L2CTLR_NPROC_SHIFT) & 3) + 1) + #define CPU_CLIDR_CTYPE(reg,x) (((reg) >> ((x) * 3)) & 0x7) #define CPU_CLIDR_LOUIS(reg) (((reg) >> 21) & 0x7) #define CPU_CLIDR_LOC(reg) (((reg) >> 24) & 0x7) Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/include/cpu-v6.h Wed May 6 15:17:28 2015 (r282547) @@ -143,6 +143,13 @@ _RF0(cp15_ttbr_get, CP15_TTBR0(%0)) _RF0(cp15_dfar_get, CP15_DFAR(%0)) #if __ARM_ARCH >= 7 _RF0(cp15_ifar_get, CP15_IFAR(%0)) +_RF0(cp15_l2ctlr_get, CP15_L2CTLR(%0)) +#endif +#if __ARM_ARCH >= 6 +_RF0(cp15_actlr_get, CP15_ACTLR(%0)) +_WF1(cp15_ats1cpr_set, CP15_ATS1CPR(%0)); +_RF0(cp15_par_get, CP15_PAR); +_RF0(cp15_sctlr_get, CP15_SCTLR(%0)) #endif /*CPU id registers */ Modified: head/sys/arm/include/sysreg.h ============================================================================== --- head/sys/arm/include/sysreg.h Wed May 6 15:10:50 2015 (r282546) +++ head/sys/arm/include/sysreg.h Wed May 6 15:17:28 2015 (r282547) @@ -212,6 +212,7 @@ #if __ARM_ARCH == 6 && defined(CPU_ARM1176) #define CP15_PMCCNTR(rr) p15, 0, rr, c15, c12, 1 /* PM Cycle Count Register */ #elif __ARM_ARCH > 6 +#define CP15_L2CTLR(rr) p15, 1, rr, c9, c0, 2 /* L2 Control Register */ #define CP15_PMCR(rr) p15, 0, rr, c9, c12, 0 /* Performance Monitor Control Register */ #define CP15_PMCNTENSET(rr) p15, 0, rr, c9, c12, 1 /* PM Count Enable Set Register */ #define CP15_PMCNTENCLR(rr) p15, 0, rr, c9, c12, 2 /* PM Count Enable Clear Register */ From owner-svn-src-all@FreeBSD.ORG Wed May 6 15:20:51 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A443922B; Wed, 6 May 2015 15:20: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 78635139E; Wed, 6 May 2015 15:20: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 t46FKpd9056091; Wed, 6 May 2015 15:20:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FKpKo056088; Wed, 6 May 2015 15:20:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505061520.t46FKpKo056088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2015 15:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282549 - in head: . tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:20:51 -0000 Author: emaste Date: Wed May 6 15:20:50 2015 New Revision: 282549 URL: https://svnweb.freebsd.org/changeset/base/282549 Log: Fix make delete-old for gperf and GCC/CXX options - Optional components go in OptionalObsoleteFiles - Move gperf removal to be based on MK_GCC only, not MK_CXX and MK_GCC Reviewed by: imp, sbruno Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2421 Modified: head/ObsoleteFiles.inc head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed May 6 15:20:29 2015 (r282548) +++ head/ObsoleteFiles.inc Wed May 6 15:20:50 2015 (r282549) @@ -430,10 +430,6 @@ OLD_FILES+=usr/lib/debug/usr/lib32/i18n OLD_FILES+=usr/lib/debug/usr/lib32/private # 20141015: OpenSSL 1.0.1j import OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz -.if ${MK_GCC} == "no" -# 20141009: gperf disabled by default -OLD_FILES+=usr/bin/gperf -.endif # 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed May 6 15:20:29 2015 (r282548) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed May 6 15:20:50 2015 (r282549) @@ -1009,12 +1009,6 @@ OLD_FILES+=usr/bin/c++filt .endif OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus -.if ${MK_GCC} == no -OLD_FILES+=usr/bin/gperf -OLD_FILES+=usr/share/info/gperf.info.gz -OLD_FILES+=usr/share/man/man1/gperf.1.gz -OLD_FILES+=usr/share/man/man1/gperf.7.gz -.endif .endif .if ${MK_FMTREE} == no @@ -1729,6 +1723,7 @@ OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/bin/gcc OLD_FILES+=usr/bin/gcov OLD_FILES+=usr/bin/gcpp +OLD_FILES+=usr/bin/gperf .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_aes.h OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_pclmul.h @@ -1754,10 +1749,13 @@ OLD_FILES+=usr/share/info/cpp.info.gz OLD_FILES+=usr/share/info/cppinternals.info.gz OLD_FILES+=usr/share/info/gcc.info.gz OLD_FILES+=usr/share/info/gccint.info.gz +OLD_FILES+=usr/share/info/gperf.info.gz OLD_FILES+=usr/share/man/man1/g++.1.gz OLD_FILES+=usr/share/man/man1/gcc.1.gz OLD_FILES+=usr/share/man/man1/gcov.1.gz OLD_FILES+=usr/share/man/man1/gcpp.1.gz +OLD_FILES+=usr/share/man/man1/gperf.1.gz +OLD_FILES+=usr/share/man/man1/gperf.7.gz .endif .if ${MK_GCOV} == no From owner-svn-src-all@FreeBSD.ORG Wed May 6 15:25:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DF56467; Wed, 6 May 2015 15:25: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 F0C7E14DC; Wed, 6 May 2015 15:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46FPK4h060262; Wed, 6 May 2015 15:25:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FPKlE060261; Wed, 6 May 2015 15:25:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505061525.t46FPKlE060261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2015 15:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282550 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:25:21 -0000 Author: jhb Date: Wed May 6 15:25:20 2015 New Revision: 282550 URL: https://svnweb.freebsd.org/changeset/base/282550 Log: A few style fixes and expand the comment a bit on what _fixtelldir() is doing. Modified: head/lib/libc/gen/telldir.c Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Wed May 6 15:20:50 2015 (r282549) +++ head/lib/libc/gen/telldir.c Wed May 6 15:25:20 2015 (r282550) @@ -101,11 +101,12 @@ _seekdir(dirp, loc) return; if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) return; - /* If it's within the same chunk of data, don't bother reloading */ + + /* If it's within the same chunk of data, don't bother reloading. */ if (lp->loc_seek == dirp->dd_seek) { /* * If we go back to 0 don't make the next readdir - * trigger a call to getdirentries() + * trigger a call to getdirentries(). */ if (lp->loc_loc == 0) dirp->dd_flags |= __DTF_SKIPREAD; @@ -124,10 +125,13 @@ _seekdir(dirp, loc) } /* - * when we do a read and cross a boundary, any telldir we - * just did will have wrong information in it. - * We need to move it from "beyond the end of the previous chunk" - * to "the beginning of the new chunk" + * A call to telldir after readdir returns the last entry in a block + * returns a location that is after the end of the last entry in that + * block. However, that location doesn't refer to a valid directory + * entry. Instead, these locations should refer to the first entry in + * the next block. That location is not known until the next block is + * read, so readdir calls this function after fetching a new block to + * fix any such telldir locations. */ void _fixtelldir(DIR *dirp, long oldseek, long oldloc) From owner-svn-src-all@FreeBSD.ORG Wed May 6 15:29:12 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BDDF72E; Wed, 6 May 2015 15:29: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 4A08D1529; Wed, 6 May 2015 15:29: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 t46FTChP061062; Wed, 6 May 2015 15:29:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FTB1v061059; Wed, 6 May 2015 15:29:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201505061529.t46FTB1v061059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 May 2015 15:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282551 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:29:12 -0000 Author: emaste Date: Wed May 6 15:29:11 2015 New Revision: 282551 URL: https://svnweb.freebsd.org/changeset/base/282551 Log: Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in rtld. Reviewed by: imp, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2422 Modified: head/libexec/rtld-elf/debug.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/debug.h ============================================================================== --- head/libexec/rtld-elf/debug.h Wed May 6 15:25:20 2015 (r282550) +++ head/libexec/rtld-elf/debug.h Wed May 6 15:29:11 2015 (r282551) @@ -32,10 +32,6 @@ #ifndef DEBUG_H #define DEBUG_H 1 -#ifndef __GNUC__ -#error "This file must be compiled with GCC" -#endif - #include #include Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed May 6 15:25:20 2015 (r282550) +++ head/libexec/rtld-elf/rtld.c Wed May 6 15:29:11 2015 (r282551) @@ -34,10 +34,6 @@ * John Polstra . */ -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed May 6 15:30:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D01488F; Wed, 6 May 2015 15:30: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 3C12C1535; Wed, 6 May 2015 15:30: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 t46FU68C061318; Wed, 6 May 2015 15:30:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46FU6CA061317; Wed, 6 May 2015 15:30:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505061530.t46FU6CA061317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2015 15:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282552 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 15:30:06 -0000 Author: jhb Date: Wed May 6 15:30:05 2015 New Revision: 282552 URL: https://svnweb.freebsd.org/changeset/base/282552 Log: Remove the note about seekdir() removing telldir() cookies. That was removed back in r269204. MFC after: 3 days Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Wed May 6 15:29:11 2015 (r282551) +++ head/lib/libc/gen/directory.3 Wed May 6 15:30:05 2015 (r282552) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd May 6, 2015 .Dt DIRECTORY 3 .Os .Sh NAME @@ -263,12 +263,6 @@ function appeared in function appeared in .Fx 10.0 . .Sh BUGS -The invalidation of -.Fn telldir -tokens when calling -.Fn seekdir -is non-standard. This is a compile time option. -.Pp The behaviour of .Fn telldir and From owner-svn-src-all@FreeBSD.ORG Wed May 6 16:25:23 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 400039E8; Wed, 6 May 2015 16:25: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 2C4791C1F; Wed, 6 May 2015 16:25: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 t46GPN7R091149; Wed, 6 May 2015 16:25:23 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46GPKoN091132; Wed, 6 May 2015 16:25:20 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505061625.t46GPKoN091132@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 16:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282558 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:25:23 -0000 Author: neel Date: Wed May 6 16:25:20 2015 New Revision: 282558 URL: https://svnweb.freebsd.org/changeset/base/282558 Log: Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup(). Prior to this change both functions returned 0 for success, -1 for failure and +1 to indicate that an exception was injected into the guest. The numerical value of ERESTART also happens to be -1 so when these functions returned -1 it had to be translated to a positive errno value to prevent the VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce bugs when writing emulation code. Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if an exception was delivered to the guest. The return value is 0 or EFAULT so no additional translation is needed. Reviewed by: tychon MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D2428 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_instruction_emul.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/task_switch.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed May 6 16:21:12 2015 (r282557) +++ head/lib/libvmmapi/vmmapi.c Wed May 6 16:25:20 2015 (r282558) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -958,9 +959,9 @@ vm_get_hpet_capabilities(struct vmctx *c return (error); } -static int -gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, int *fault, uint64_t *gpa) +int +vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa, int *fault) { struct vm_gla2gpa gg; int error; @@ -979,29 +980,18 @@ gla2gpa(struct vmctx *ctx, int vcpu, str return (error); } -int -vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa) -{ - int error, fault; - - error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, gpa); - if (fault) - error = fault; - return (error); -} - #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, + int *fault) { void *va; uint64_t gpa; - int error, fault, i, n, off; + int error, i, n, off; for (i = 0; i < iovcnt; i++) { iov[i].iov_base = 0; @@ -1010,18 +1000,16 @@ vm_copy_setup(struct vmctx *ctx, int vcp while (len) { assert(iovcnt > 0); - error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, &gpa); - if (error) - return (-1); - if (fault) - return (1); + error = vm_gla2gpa(ctx, vcpu, paging, gla, prot, &gpa, fault); + if (error || *fault) + return (error); off = gpa & PAGE_MASK; n = min(len, PAGE_SIZE - off); va = vm_map_gpa(ctx, gpa, n); if (va == NULL) - return (-1); + return (EFAULT); iov->iov_base = va; iov->iov_len = n; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed May 6 16:21:12 2015 (r282557) +++ head/lib/libvmmapi/vmmapi.h Wed May 6 16:25:20 2015 (r282558) @@ -64,7 +64,7 @@ int vm_setup_memory(struct vmctx *ctx, s void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa); + uint64_t gla, int prot, uint64_t *gpa, int *fault); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); void vm_set_memflags(struct vmctx *ctx, int flags); @@ -131,10 +131,15 @@ int vm_get_hpet_capabilities(struct vmct /* * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. * The 'iovcnt' should be big enough to accomodate all GPA segments. - * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. + * + * retval fault Interpretation + * 0 0 Success + * 0 1 An exception was injected into the guest + * EFAULT N/A Error */ int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, - uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt, + int *fault); void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, void *host_dst, size_t len); void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/include/vmm.h Wed May 6 16:25:20 2015 (r282558) @@ -345,9 +345,10 @@ struct vm_copyinfo { * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for * a copyin or PROT_WRITE for a copyout. * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. + * retval is_fault Intepretation + * 0 0 Success + * 0 1 An exception was injected into the guest + * EFAULT N/A Unrecoverable error * * The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if * the return value is 0. The 'copyinfo[]' resources should be freed by calling @@ -355,7 +356,7 @@ struct vm_copyinfo { */ int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, - int num_copyinfo); + int num_copyinfo, int *is_fault); void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, int num_copyinfo); void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/include/vmm_instruction_emul.h Wed May 6 16:25:20 2015 (r282558) @@ -81,17 +81,19 @@ int vie_calculate_gla(enum vm_cpu_mode c */ int vmm_fetch_instruction(struct vm *vm, int cpuid, struct vm_guest_paging *guest_paging, - uint64_t rip, int inst_length, struct vie *vie); + uint64_t rip, int inst_length, struct vie *vie, + int *is_fault); /* * Translate the guest linear address 'gla' to a guest physical address. * - * Returns 0 on success and '*gpa' contains the result of the translation. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. + * retval is_fault Interpretation + * 0 0 'gpa' contains result of the translation + * 0 1 An exception was injected into the guest + * EFAULT N/A An unrecoverable hypervisor error occurred */ int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa); + uint64_t gla, int prot, uint64_t *gpa, int *is_fault); void vie_init(struct vie *vie, const char *inst_bytes, int inst_length); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/vmm/vmm.c Wed May 6 16:25:20 2015 (r282558) @@ -1256,7 +1256,7 @@ vm_handle_inst_emul(struct vm *vm, int v mem_region_read_t mread; mem_region_write_t mwrite; enum vm_cpu_mode cpu_mode; - int cs_d, error, length; + int cs_d, error, fault, length; vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; @@ -1279,19 +1279,15 @@ vm_handle_inst_emul(struct vm *vm, int v */ length = vme->inst_length ? vme->inst_length : VIE_INST_SIZE; error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip + - cs_base, length, vie); + cs_base, length, vie, &fault); } else { /* * The instruction bytes have already been copied into 'vie' */ - error = 0; + error = fault = 0; } - if (error == 1) - return (0); /* Resume guest to handle page fault */ - else if (error == -1) - return (EFAULT); - else if (error != 0) - panic("%s: vmm_fetch_instruction error %d", __func__, error); + if (error || fault) + return (error); if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, cs_d, vie) != 0) { VCPU_CTR1(vm, vcpuid, "Error decoding instruction at %#lx", @@ -2323,7 +2319,7 @@ vm_copy_teardown(struct vm *vm, int vcpu int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, - int num_copyinfo) + int num_copyinfo, int *fault) { int error, idx, nused; size_t n, off, remaining; @@ -2336,8 +2332,8 @@ vm_copy_setup(struct vm *vm, int vcpuid, remaining = len; while (remaining > 0) { KASSERT(nused < num_copyinfo, ("insufficient vm_copyinfo")); - error = vm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa); - if (error) + error = vm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa, fault); + if (error || *fault) return (error); off = gpa & PAGE_MASK; n = min(remaining, PAGE_SIZE - off); @@ -2359,8 +2355,9 @@ vm_copy_setup(struct vm *vm, int vcpuid, if (idx != nused) { vm_copy_teardown(vm, vcpuid, copyinfo, num_copyinfo); - return (-1); + return (EFAULT); } else { + *fault = 0; return (0); } } Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/vmm/vmm_dev.c Wed May 6 16:25:20 2015 (r282558) @@ -441,19 +441,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c CTASSERT(PROT_EXEC == VM_PROT_EXECUTE); gg = (struct vm_gla2gpa *)data; error = vm_gla2gpa(sc->vm, gg->vcpuid, &gg->paging, gg->gla, - gg->prot, &gg->gpa); - KASSERT(error == 0 || error == 1 || error == -1, + gg->prot, &gg->gpa, &gg->fault); + KASSERT(error == 0 || error == EFAULT, ("%s: vm_gla2gpa unknown error %d", __func__, error)); - if (error >= 0) { - /* - * error = 0: the translation was successful - * error = 1: a fault was injected into the guest - */ - gg->fault = error; - error = 0; - } else { - error = EFAULT; - } break; } case VM_ACTIVATE_CPU: Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed May 6 16:21:12 2015 (r282557) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed May 6 16:25:20 2015 (r282558) @@ -597,13 +597,11 @@ emulate_movx(void *vm, int vcpuid, uint6 /* * Helper function to calculate and validate a linear address. - * - * Returns 0 on success and 1 if an exception was injected into the guest. */ static int get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging, int opsize, int addrsize, int prot, enum vm_reg_name seg, - enum vm_reg_name gpr, uint64_t *gla) + enum vm_reg_name gpr, uint64_t *gla, int *fault) { struct seg_desc desc; uint64_t cr0, val, rflags; @@ -629,7 +627,7 @@ get_gla(void *vm, int vcpuid, struct vie vm_inject_ss(vm, vcpuid, 0); else vm_inject_gp(vm, vcpuid); - return (1); + goto guest_fault; } if (vie_canonical_check(paging->cpu_mode, *gla)) { @@ -637,14 +635,19 @@ get_gla(void *vm, int vcpuid, struct vie vm_inject_ss(vm, vcpuid, 0); else vm_inject_gp(vm, vcpuid); - return (1); + goto guest_fault; } if (vie_alignment_check(paging->cpl, opsize, cr0, rflags, *gla)) { vm_inject_ac(vm, vcpuid, 0); - return (1); + goto guest_fault; } + *fault = 0; + return (0); + +guest_fault: + *fault = 1; return (0); } @@ -660,7 +663,7 @@ emulate_movs(void *vm, int vcpuid, uint6 #endif uint64_t dstaddr, srcaddr, dstgpa, srcgpa, val; uint64_t rcx, rdi, rsi, rflags; - int error, opsize, seg, repeat; + int error, fault, opsize, seg, repeat; opsize = (vie->op.op_byte == 0xA4) ? 1 : vie->opsize; val = 0; @@ -683,8 +686,10 @@ emulate_movs(void *vm, int vcpuid, uint6 * The count register is %rcx, %ecx or %cx depending on the * address size of the instruction. */ - if ((rcx & vie_size2mask(vie->addrsize)) == 0) - return (0); + if ((rcx & vie_size2mask(vie->addrsize)) == 0) { + error = 0; + goto done; + } } /* @@ -705,13 +710,16 @@ emulate_movs(void *vm, int vcpuid, uint6 seg = vie->segment_override ? vie->segment_register : VM_REG_GUEST_DS; error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, - PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr); - if (error) + PROT_READ, seg, VM_REG_GUEST_RSI, &srcaddr, &fault); + if (error || fault) goto done; error = vm_copy_setup(vm, vcpuid, paging, srcaddr, opsize, PROT_READ, - copyinfo, nitems(copyinfo)); + copyinfo, nitems(copyinfo), &fault); if (error == 0) { + if (fault) + goto done; /* Resume guest to handle fault */ + /* * case (2): read from system memory and write to mmio. */ @@ -720,11 +728,6 @@ emulate_movs(void *vm, int vcpuid, uint6 error = memwrite(vm, vcpuid, gpa, val, opsize, arg); if (error) goto done; - } else if (error > 0) { - /* - * Resume guest execution to handle fault. - */ - goto done; } else { /* * 'vm_copy_setup()' is expected to fail for cases (3) and (4) @@ -732,13 +735,17 @@ emulate_movs(void *vm, int vcpuid, uint6 */ error = get_gla(vm, vcpuid, vie, paging, opsize, vie->addrsize, - PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr); - if (error) + PROT_WRITE, VM_REG_GUEST_ES, VM_REG_GUEST_RDI, &dstaddr, + &fault); + if (error || fault) goto done; error = vm_copy_setup(vm, vcpuid, paging, dstaddr, opsize, - PROT_WRITE, copyinfo, nitems(copyinfo)); + PROT_WRITE, copyinfo, nitems(copyinfo), &fault); if (error == 0) { + if (fault) + goto done; /* Resume guest to handle fault */ + /* * case (3): read from MMIO and write to system memory. * @@ -754,27 +761,29 @@ emulate_movs(void *vm, int vcpuid, uint6 vm_copyout(vm, vcpuid, &val, copyinfo, opsize); vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); - } else if (error > 0) { - /* - * Resume guest execution to handle fault. - */ - goto done; } else { /* * Case (4): read from and write to mmio. + * + * Commit to the MMIO read/write (with potential + * side-effects) only after we are sure that the + * instruction is not going to be restarted due + * to address translation faults. */ error = vm_gla2gpa(vm, vcpuid, paging, srcaddr, - PROT_READ, &srcgpa); - if (error) - goto done; - error = memread(vm, vcpuid, srcgpa, &val, opsize, arg); - if (error) + PROT_READ, &srcgpa, &fault); + if (error || fault) goto done; error = vm_gla2gpa(vm, vcpuid, paging, dstaddr, - PROT_WRITE, &dstgpa); + PROT_WRITE, &dstgpa, &fault); + if (error || fault) + goto done; + + error = memread(vm, vcpuid, srcgpa, &val, opsize, arg); if (error) goto done; + error = memwrite(vm, vcpuid, dstgpa, val, opsize, arg); if (error) goto done; @@ -819,10 +828,9 @@ emulate_movs(void *vm, int vcpuid, uint6 vm_restart_instruction(vm, vcpuid); } done: - if (error < 0) - return (EFAULT); - else - return (0); + KASSERT(error == 0 || error == EFAULT, ("%s: unexpected error %d", + __func__, error)); + return (error); } static int @@ -1185,7 +1193,7 @@ emulate_stack_op(void *vm, int vcpuid, u #endif struct seg_desc ss_desc; uint64_t cr0, rflags, rsp, stack_gla, val; - int error, size, stackaddrsize, pushop; + int error, fault, size, stackaddrsize, pushop; val = 0; size = vie->opsize; @@ -1251,18 +1259,10 @@ emulate_stack_op(void *vm, int vcpuid, u } error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, - pushop ? PROT_WRITE : PROT_READ, copyinfo, nitems(copyinfo)); - if (error == -1) { - /* - * XXX cannot return a negative error value here because it - * ends up being the return value of the VM_RUN() ioctl and - * is interpreted as a pseudo-error (for e.g. ERESTART). - */ - return (EFAULT); - } else if (error == 1) { - /* Resume guest execution to handle page fault */ - return (0); - } + pushop ? PROT_WRITE : PROT_READ, copyinfo, nitems(copyinfo), + &fault); + if (error || fault) + return (error); if (pushop) { error = memread(vm, vcpuid, mmio_gpa, &val, size, arg); @@ -1672,7 +1672,7 @@ ptp_hold(struct vm *vm, vm_paddr_t ptpph int vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa) + uint64_t gla, int prot, uint64_t *gpa, int *guest_fault) { int nlevels, pfcode, ptpshift, ptpindex, retval, usermode, writable; u_int retries; @@ -1680,6 +1680,8 @@ vm_gla2gpa(struct vm *vm, int vcpuid, st uint32_t *ptpbase32, pte32; void *cookie; + *guest_fault = 0; + usermode = (paging->cpl == 3 ? 1 : 0); writable = prot & VM_PROT_WRITE; cookie = NULL; @@ -1842,18 +1844,20 @@ restart: *gpa = pte | (gla & (pgsize - 1)); done: ptp_release(&cookie); + KASSERT(retval == 0 || retval == EFAULT, ("%s: unexpected retval %d", + __func__, retval)); return (retval); error: - retval = -1; + retval = EFAULT; goto done; fault: - retval = 1; + *guest_fault = 1; goto done; } int vmm_fetch_instruction(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, - uint64_t rip, int inst_length, struct vie *vie) + uint64_t rip, int inst_length, struct vie *vie, int *faultptr) { struct vm_copyinfo copyinfo[2]; int error, prot; @@ -1863,13 +1867,14 @@ vmm_fetch_instruction(struct vm *vm, int prot = PROT_READ | PROT_EXEC; error = vm_copy_setup(vm, vcpuid, paging, rip, inst_length, prot, - copyinfo, nitems(copyinfo)); - if (error == 0) { - vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); - vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); - vie->num_valid = inst_length; - } - return (error); + copyinfo, nitems(copyinfo), faultptr); + if (error || *faultptr) + return (error); + + vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); + vie->num_valid = inst_length; + return (0); } static int Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Wed May 6 16:21:12 2015 (r282557) +++ head/usr.sbin/bhyve/inout.c Wed May 6 16:25:20 2015 (r282558) @@ -107,7 +107,7 @@ emulate_inout(struct vmctx *ctx, int vcp uint32_t eax, val; inout_func_t handler; void *arg; - int error, retval; + int error, fault, retval; enum vm_reg_name idxreg; uint64_t gla, index, iterations, count; struct vm_inout_str *vis; @@ -163,11 +163,11 @@ emulate_inout(struct vmctx *ctx, int vcp } error = vm_copy_setup(ctx, vcpu, &vis->paging, gla, - bytes, prot, iov, nitems(iov)); - if (error == -1) { + bytes, prot, iov, nitems(iov), &fault); + if (error) { retval = -1; /* Unrecoverable error */ break; - } else if (error == 1) { + } else if (fault) { retval = 0; /* Resume guest to handle fault */ break; } Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Wed May 6 16:21:12 2015 (r282557) +++ head/usr.sbin/bhyve/task_switch.c Wed May 6 16:25:20 2015 (r282558) @@ -202,7 +202,8 @@ desc_table_limit_check(struct vmctx *ctx */ static int desc_table_rw(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc, bool doread) + uint16_t sel, struct user_segment_descriptor *desc, bool doread, + int *faultptr) { struct iovec iov[2]; uint64_t base; @@ -215,28 +216,30 @@ desc_table_rw(struct vmctx *ctx, int vcp assert(limit >= SEL_LIMIT(sel)); error = vm_copy_setup(ctx, vcpu, paging, base + SEL_START(sel), - sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov)); - if (error == 0) { - if (doread) - vm_copyin(ctx, vcpu, iov, desc, sizeof(*desc)); - else - vm_copyout(ctx, vcpu, desc, iov, sizeof(*desc)); - } - return (error); + sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov), + faultptr); + if (error || *faultptr) + return (error); + + if (doread) + vm_copyin(ctx, vcpu, iov, desc, sizeof(*desc)); + else + vm_copyout(ctx, vcpu, desc, iov, sizeof(*desc)); + return (0); } static int desc_table_read(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { - return (desc_table_rw(ctx, vcpu, paging, sel, desc, true)); + return (desc_table_rw(ctx, vcpu, paging, sel, desc, true, faultptr)); } static int desc_table_write(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { - return (desc_table_rw(ctx, vcpu, paging, sel, desc, false)); + return (desc_table_rw(ctx, vcpu, paging, sel, desc, false, faultptr)); } /* @@ -248,7 +251,7 @@ desc_table_write(struct vmctx *ctx, int */ static int read_tss_descriptor(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - uint16_t sel, struct user_segment_descriptor *desc) + uint16_t sel, struct user_segment_descriptor *desc, int *faultptr) { struct vm_guest_paging sup_paging; int error; @@ -267,7 +270,7 @@ read_tss_descriptor(struct vmctx *ctx, i sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ - error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc); + error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc, faultptr); return (error); } @@ -301,14 +304,10 @@ ldt_desc(int sd_type) /* * Validate the descriptor 'seg_desc' associated with 'segment'. - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int validate_seg_desc(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - int segment, struct seg_desc *seg_desc) + int segment, struct seg_desc *seg_desc, int *faultptr) { struct vm_guest_paging sup_paging; struct user_segment_descriptor usd; @@ -369,8 +368,8 @@ validate_seg_desc(struct vmctx *ctx, int /* Read the descriptor from the GDT/LDT */ sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ - error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd); - if (error) + error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd, faultptr); + if (error || *faultptr) return (error); /* Verify that the descriptor type is compatible with the segment */ @@ -476,14 +475,10 @@ update_seg_desc(struct vmctx *ctx, int v /* * Update the vcpu registers to reflect the state of the new task. - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, - uint16_t ot_sel, struct tss32 *tss, struct iovec *iov) + uint16_t ot_sel, struct tss32 *tss, struct iovec *iov, int *faultptr) { struct seg_desc seg_desc, seg_desc2; uint64_t *pdpte, maxphyaddr, reserved; @@ -565,8 +560,9 @@ tss32_restore(struct vmctx *ctx, int vcp vm_copyout(ctx, vcpu, tss, iov, sizeof(*tss)); /* Validate segment descriptors */ - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_LDTR, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_LDTR, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_LDTR, &seg_desc); @@ -579,33 +575,40 @@ tss32_restore(struct vmctx *ctx, int vcp * VM-entry checks so the guest can handle any exception injected * during task switch emulation. */ - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_CS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_CS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_SS, &seg_desc2); - if (error) + + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_SS, &seg_desc2, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_CS, &seg_desc); update_seg_desc(ctx, vcpu, VM_REG_GUEST_SS, &seg_desc2); ts->paging.cpl = tss->tss_cs & SEL_RPL_MASK; - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_DS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_DS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_DS, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_ES, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_ES, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_ES, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_FS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_FS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_FS, &seg_desc); - error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_GS, &seg_desc); - if (error) + error = validate_seg_desc(ctx, vcpu, ts, VM_REG_GUEST_GS, &seg_desc, + faultptr); + if (error || *faultptr) return (error); update_seg_desc(ctx, vcpu, VM_REG_GUEST_GS, &seg_desc); @@ -616,14 +619,10 @@ tss32_restore(struct vmctx *ctx, int vcp * Push an error code on the stack of the new task. This is needed if the * task switch was triggered by a hardware exception that causes an error * code to be saved (e.g. #PF). - * - * Returns 0 on success. - * Returns 1 if an exception was injected into the guest. - * Returns -1 otherwise. */ static int push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - int task_type, uint32_t errcode) + int task_type, uint32_t errcode, int *faultptr) { struct iovec iov[2]; struct seg_desc seg_desc; @@ -632,6 +631,8 @@ push_errcode(struct vmctx *ctx, int vcpu uint32_t esp; uint16_t stacksel; + *faultptr = 0; + cr0 = GETREG(ctx, vcpu, VM_REG_GUEST_CR0); rflags = GETREG(ctx, vcpu, VM_REG_GUEST_RFLAGS); stacksel = GETREG(ctx, vcpu, VM_REG_GUEST_SS); @@ -666,17 +667,19 @@ push_errcode(struct vmctx *ctx, int vcpu if (vie_calculate_gla(paging->cpu_mode, VM_REG_GUEST_SS, &seg_desc, esp, bytes, stacksize, PROT_WRITE, &gla)) { sel_exception(ctx, vcpu, IDT_SS, stacksel, 1); - return (1); + *faultptr = 1; + return (0); } if (vie_alignment_check(paging->cpl, bytes, cr0, rflags, gla)) { vm_inject_ac(ctx, vcpu, 1); - return (1); + *faultptr = 1; + return (0); } error = vm_copy_setup(ctx, vcpu, paging, gla, bytes, PROT_WRITE, - iov, nitems(iov)); - if (error) + iov, nitems(iov), faultptr); + if (error || *faultptr) return (error); vm_copyout(ctx, vcpu, &errcode, iov, bytes); @@ -687,16 +690,13 @@ push_errcode(struct vmctx *ctx, int vcpu /* * Evaluate return value from helper functions and potentially return to * the VM run loop. - * 0: success - * +1: an exception was injected into the guest vcpu - * -1: unrecoverable/programming error */ -#define CHKERR(x) \ +#define CHKERR(error,fault) \ do { \ - assert(((x) == 0) || ((x) == 1) || ((x) == -1)); \ - if ((x) == -1) \ + assert((error == 0) || (error == EFAULT)); \ + if (error) \ return (VMEXIT_ABORT); \ - else if ((x) == 1) \ + else if (fault) \ return (VMEXIT_CONTINUE); \ } while (0) @@ -711,7 +711,7 @@ vmexit_task_switch(struct vmctx *ctx, st struct iovec nt_iov[2], ot_iov[2]; uint64_t cr0, ot_base; uint32_t eip, ot_lim, access; - int error, ext, minlimit, nt_type, ot_type, vcpu; + int error, ext, fault, minlimit, nt_type, ot_type, vcpu; enum task_switch_reason reason; uint16_t nt_sel, ot_sel; @@ -739,8 +739,9 @@ vmexit_task_switch(struct vmctx *ctx, st sup_paging.cpl = 0; /* implicit supervisor mode */ /* Fetch the new TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc); - CHKERR(error); + error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc, + &fault); + CHKERR(error, fault); nt = usd_to_seg_desc(&nt_desc); @@ -792,8 +793,8 @@ vmexit_task_switch(struct vmctx *ctx, st /* Fetch the new TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, nt.base, minlimit + 1, - PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov)); - CHKERR(error); + PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov), &fault); + CHKERR(error, fault); vm_copyin(ctx, vcpu, nt_iov, &newtss, minlimit + 1); /* Get the old TSS selector from the guest's task register */ @@ -818,13 +819,14 @@ vmexit_task_switch(struct vmctx *ctx, st assert(ot_type == SDT_SYS386BSY || ot_type == SDT_SYS286BSY); /* Fetch the old TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc); - CHKERR(error); + error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc, + &fault); + CHKERR(error, fault); /* Get the old TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, ot_base, minlimit + 1, - PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov)); - CHKERR(error); + PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov), &fault); + CHKERR(error, fault); vm_copyin(ctx, vcpu, ot_iov, &oldtss, minlimit + 1); /* @@ -834,8 +836,8 @@ vmexit_task_switch(struct vmctx *ctx, st if (reason == TSR_IRET || reason == TSR_JMP) { ot_desc.sd_type &= ~0x2; error = desc_table_write(ctx, vcpu, &sup_paging, ot_sel, - &ot_desc); - CHKERR(error); + &ot_desc, &fault); + CHKERR(error, fault); } if (nt_type == SDT_SYS286BSY || nt_type == SDT_SYS286TSS) { @@ -853,8 +855,8 @@ vmexit_task_switch(struct vmctx *ctx, st if (reason != TSR_IRET) { nt_desc.sd_type |= 0x2; error = desc_table_write(ctx, vcpu, &sup_paging, nt_sel, - &nt_desc); - CHKERR(error); + &nt_desc, &fault); + CHKERR(error, fault); } /* Update task register to point at the new TSS */ @@ -877,8 +879,9 @@ vmexit_task_switch(struct vmctx *ctx, st assert(error == 0); /* Load processor state from new TSS */ - error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov); - CHKERR(error); + error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov, + &fault); + CHKERR(error, fault); /* * Section "Interrupt Tasks" in Intel SDM, Vol 3: if an exception @@ -889,8 +892,8 @@ vmexit_task_switch(struct vmctx *ctx, st assert(task_switch->ext); assert(task_switch->reason == TSR_IDT_GATE); error = push_errcode(ctx, vcpu, &task_switch->paging, nt_type, - task_switch->errcode); - CHKERR(error); + task_switch->errcode, &fault); + CHKERR(error, fault); } /* From owner-svn-src-all@FreeBSD.ORG Wed May 6 16:43:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 977ADDFD; Wed, 6 May 2015 16:43: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 85CBB1E3B; Wed, 6 May 2015 16:43: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 t46GhjIL000720; Wed, 6 May 2015 16:43:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46GhjFE000719; Wed, 6 May 2015 16:43:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505061643.t46GhjFE000719@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 6 May 2015 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282559 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:43:45 -0000 Author: glebius Date: Wed May 6 16:43:44 2015 New Revision: 282559 URL: https://svnweb.freebsd.org/changeset/base/282559 Log: Printing interface names: o Restore historical behaviour of appending '*' if interface is down, and we have enough space to print it (usually we don't). [1] o Do not truncate interface names when printing in encoded format. o Report interface flags into encoded format. PR: 199873 [1] Sponsored by: Nginx, Inc. Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Wed May 6 16:25:20 2015 (r282558) +++ head/usr.bin/netstat/if.c Wed May 6 16:43:44 2015 (r282559) @@ -315,7 +315,7 @@ intpr(int interval, void (*pfunc)(char * for (ifa = ifap; ifa; ifa = ifa->ifa_next) { bool network = false, link = false; - char *name; + char *name, *xname, buf[IFNAMSIZ+1]; if (interface != NULL && strcmp(ifa->ifa_name, interface) != 0) continue; @@ -341,10 +341,20 @@ intpr(int interval, void (*pfunc)(char * xo_open_instance("interface"); + if ((ifa->ifa_flags & IFF_UP) == 0) { + xname = stpcpy(buf, name); + *xname++ = '*'; + *xname = '\0'; + xname = buf; + } else + xname = name; + if (Wflag) - xo_emit("{tk:name/%-7.7s}", name); + xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%7.7s}", + name, ifa->ifa_flags, xname); else - xo_emit("{tk:name/%-5.5s}", name); + xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%5.5s}", + name, ifa->ifa_flags, xname); #define IFA_MTU(ifa) (((struct if_data *)(ifa)->ifa_data)->ifi_mtu) show_stat("lu", 6, "mtu", IFA_MTU(ifa), IFA_MTU(ifa)); From owner-svn-src-all@FreeBSD.ORG Wed May 6 16:45:45 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62908FFD; Wed, 6 May 2015 16:45:45 +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 BE9F01E5C; Wed, 6 May 2015 16:45:43 +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 t46GjdQ3057470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 May 2015 19:45:39 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t46Gjd8S057469; Wed, 6 May 2015 19:45:39 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 6 May 2015 19:45:39 +0300 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282559 - head/usr.bin/netstat Message-ID: <20150506164539.GD56147@FreeBSD.org> References: <201505061643.t46GhjFE000719@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201505061643.t46GhjFE000719@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:45:45 -0000 On Wed, May 06, 2015 at 04:43:45PM +0000, Gleb Smirnoff wrote: T> Printing interface names: T> T> o Do not truncate interface names when printing in encoded format. Note: now most of xo_emits in netstat(1) truncate in encoded format, which definitely isn't correct. Allan Jude promised to work on this. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed May 6 16:49:41 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06C1F309; Wed, 6 May 2015 16:49:41 +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 D6F0D1E90; Wed, 6 May 2015 16:49:40 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CAE0BB9C3; Wed, 6 May 2015 12:49:39 -0400 (EDT) From: John Baldwin To: Julian Elischer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r282485 - head/lib/libc/gen Date: Wed, 06 May 2015 11:41:22 -0400 Message-ID: <5998599.4tGHN4C7ck@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201505051452.t45EqXXv027613@svn.freebsd.org> References: <201505051452.t45EqXXv027613@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 06 May 2015 12:49:39 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 16:49:41 -0000 On Tuesday, May 05, 2015 02:52:33 PM Julian Elischer wrote: > Author: julian > Date: Tue May 5 14:52:33 2015 > New Revision: 282485 > URL: https://svnweb.freebsd.org/changeset/base/282485 > > Log: > Tweak seekdir, telldir and readdir so that when htere are deletes going on, > as seek to teh last location saved will still work. This is needed for Samba > to be able to correctly handle delete requests from windows. This does not > completely fix seekdir when deletes are present but fixes the worst of the > problems. The real solution must involve some changes to the API for eh VFS > and getdirentries(2). You really shouldn't be documenting Samba in this page. Also, your claim is wrong as it will still do the wrong thing if some _other_ process removes a file entry out from under you. I think it's fine to fix the implementation to cater to samba. I think it's very wrong to document it and encourage other people to rely on non-POSIX behavior. I would rather remove this entire block from BUGS and use much simpler language in IMPLEMENTATION NOTES to note that it is undefined if you will see or not see directory entries that are added or removed while scanning a directory. The language from here: http://pubs.opengroup.org/onlinepubs/009695399/functions/readdir.html Would work great, namely: If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed May 6 17:23:43 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A801D178; Wed, 6 May 2015 17:23: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 96C00134C; Wed, 6 May 2015 17:23: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 t46HNhr1020937; Wed, 6 May 2015 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46HNhQZ020935; Wed, 6 May 2015 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505061723.t46HNhQZ020935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 6 May 2015 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282560 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 17:23:43 -0000 Author: jhb Date: Wed May 6 17:23:42 2015 New Revision: 282560 URL: https://svnweb.freebsd.org/changeset/base/282560 Log: Tweak the comment here some more. In particular, the previous opening sentence was a bit confusing. Noted by: kib Modified: head/lib/libc/gen/telldir.c Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Wed May 6 16:43:44 2015 (r282559) +++ head/lib/libc/gen/telldir.c Wed May 6 17:23:42 2015 (r282560) @@ -125,13 +125,13 @@ _seekdir(dirp, loc) } /* - * A call to telldir after readdir returns the last entry in a block - * returns a location that is after the end of the last entry in that - * block. However, that location doesn't refer to a valid directory - * entry. Instead, these locations should refer to the first entry in - * the next block. That location is not known until the next block is - * read, so readdir calls this function after fetching a new block to - * fix any such telldir locations. + * After readdir returns the last entry in a block, a call to telldir + * returns a location that is after the end of that last entry. + * However, that location doesn't refer to a valid directory entry. + * Ideally, the call to telldir would return a location that refers to + * the first entry in the next block. That location is not known + * until the next block is read, so readdir calls this function after + * fetching a new block to fix any such telldir locations. */ void _fixtelldir(DIR *dirp, long oldseek, long oldloc) From owner-svn-src-all@FreeBSD.ORG Wed May 6 18:04:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DE9B32A; Wed, 6 May 2015 18:04: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 5BD3F187E; Wed, 6 May 2015 18:04: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 t46I4WIl042185; Wed, 6 May 2015 18:04:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46I4Wa1042184; Wed, 6 May 2015 18:04:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505061804.t46I4Wa1042184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 18:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282563 - 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.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 18:04:32 -0000 Author: mav Date: Wed May 6 18:04:31 2015 New Revision: 282563 URL: https://svnweb.freebsd.org/changeset/base/282563 Log: Add memory barrier to r281764. While race at this point may cause only a single packet delay and so was not really reproduced, it is better to not have it at all. MFC after: 1 week Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Wed May 6 17:44:42 2015 (r282562) +++ head/usr.sbin/bhyve/pci_virtio_net.c Wed May 6 18:04:31 2015 (r282563) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -453,7 +454,7 @@ pci_vtnet_tx_thread(void *param) { struct pci_vtnet_softc *sc = param; struct vqueue_info *vq; - int have_work, error; + int error; vq = &sc->vsc_queues[VTNET_TXQ]; @@ -467,20 +468,16 @@ pci_vtnet_tx_thread(void *param) for (;;) { /* note - tx mutex is locked here */ - do { + while (sc->resetting || !vq_has_descs(vq)) { vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; - if (sc->resetting) - have_work = 0; - else - have_work = vq_has_descs(vq); - - if (!have_work) { - sc->tx_in_progress = 0; - error = pthread_cond_wait(&sc->tx_cond, - &sc->tx_mtx); - assert(error == 0); - } - } while (!have_work); + mb(); + if (!sc->resetting && vq_has_descs(vq)) + break; + + sc->tx_in_progress = 0; + error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); + assert(error == 0); + } vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; sc->tx_in_progress = 1; pthread_mutex_unlock(&sc->tx_mtx); From owner-svn-src-all@FreeBSD.ORG Wed May 6 19:47:32 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B3176AC; Wed, 6 May 2015 19:47: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 59C9F1456; Wed, 6 May 2015 19:47: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 t46JlWt6093811; Wed, 6 May 2015 19:47:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46JlWdr093810; Wed, 6 May 2015 19:47:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505061947.t46JlWdr093810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 19:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282565 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 19:47:32 -0000 Author: mav Date: Wed May 6 19:47:31 2015 New Revision: 282565 URL: https://svnweb.freebsd.org/changeset/base/282565 Log: Handle EDQUOT backend storage errors same as ENOSPC. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed May 6 18:16:27 2015 (r282564) +++ head/sys/cam/ctl/ctl_backend_block.c Wed May 6 19:47:31 2015 (r282565) @@ -521,7 +521,7 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); - } else if (error == ENOSPC) { + } else if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ @@ -738,7 +738,7 @@ ctl_be_block_dispatch_file(struct ctl_be ctl_scsi_path_string(io, path_str, sizeof(path_str)); printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - if (error == ENOSPC) { + if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else ctl_set_medium_error(&io->scsiio); @@ -895,7 +895,7 @@ ctl_be_block_dispatch_zvol(struct ctl_be * return the I/O to the user. */ if (error != 0) { - if (error == ENOSPC) { + if (error == ENOSPC || error == EDQUOT) { ctl_set_space_alloc_fail(&io->scsiio); } else ctl_set_medium_error(&io->scsiio); From owner-svn-src-all@FreeBSD.ORG Wed May 6 21:03:20 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD30BB5B; Wed, 6 May 2015 21:03: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 BC4331D8D; Wed, 6 May 2015 21:03: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 t46L3K7V035410; Wed, 6 May 2015 21:03:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46L3KdM035409; Wed, 6 May 2015 21:03:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201505062103.t46L3KdM035409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 May 2015 21:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282567 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 21:03:20 -0000 Author: mjg Date: Wed May 6 21:03:19 2015 New Revision: 282567 URL: https://svnweb.freebsd.org/changeset/base/282567 Log: Fix up panics when fork fails due to hitting proc limit The function clearning credentials on failure asserts the process is a zombie, which is not true when fork fails. Changing creds to NULL is unnecessary, but is still being done for consistency with other code. Pointy hat: mjg Reported by: pho Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed May 6 19:58:12 2015 (r282566) +++ head/sys/kern/kern_fork.c Wed May 6 21:03:19 2015 (r282567) @@ -943,7 +943,8 @@ fail: #endif racct_proc_exit(newproc); fail1: - crfree(proc_set_cred(newproc, NULL)); + crfree(newproc->p_ucred); + newproc->p_ucred = NULL; fail2: if (vm2 != NULL) vmspace_free(vm2); From owner-svn-src-all@FreeBSD.ORG Wed May 6 21:06:33 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4E1EF4A; Wed, 6 May 2015 21:06:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29E41DDE; Wed, 6 May 2015 21:06: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 t46L6X5J036163; Wed, 6 May 2015 21:06:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46L6XcG036162; Wed, 6 May 2015 21:06:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505062106.t46L6XcG036162@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 21:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282568 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 21:06:33 -0000 Author: mav Date: Wed May 6 21:06:32 2015 New Revision: 282568 URL: https://svnweb.freebsd.org/changeset/base/282568 Log: MFC r281825: Rewrite physio() to not allocate pbufs for unmapped I/O. pbufs is a limited resource, and their allocator is not SMP-scalable. So instead of always allocating pbuf to immediately convert it to bio, allocate bio just here. If buffer needs kernel mapping, then pbuf is still allocated, but used only as a source of KVA and storage for a list of held pages. On 40-core system doing many 512-byte reads from user level to array of raw SSDs this change removes huge lock congestion inside pbuf allocator. It improves peak performance from ~300K to ~1.2M IOPS. On my previous 24-core system this problem also existed, but was less serious. Modified: stable/10/sys/kern/kern_physio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_physio.c ============================================================================== --- stable/10/sys/kern/kern_physio.c Wed May 6 21:03:19 2015 (r282567) +++ stable/10/sys/kern/kern_physio.c Wed May 6 21:06:32 2015 (r282568) @@ -25,27 +25,26 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include +#include #include +#include int physio(struct cdev *dev, struct uio *uio, int ioflag) { - struct buf *bp; - struct cdevsw *csw; + struct buf *pbuf; + struct bio *bp; + struct vm_page **pages; caddr_t sa; - u_int iolen; - int error, i, mapped; - - /* Keep the process UPAGES from being swapped. XXX: why ? */ - PHOLD(curproc); - - bp = getpbuf(NULL); - sa = bp->b_data; - error = 0; + u_int iolen, poff; + int error, i, npages, maxpages; + vm_prot_t prot; /* XXX: sanity check */ if(dev->si_iosize_max < PAGE_SIZE) { @@ -76,95 +75,128 @@ physio(struct cdev *dev, struct uio *uio uprintf("%s: request vectors=%d > 1; " "cannot split request\n", devtoname(dev), uio->uio_iovcnt); - - error = EFBIG; - goto doerror; + return (EFBIG); } + /* + * Keep the process UPAGES from being swapped. Processes swapped + * out while holding pbufs, used by swapper, may lead to deadlock. + */ + PHOLD(curproc); + + bp = g_alloc_bio(); + if (uio->uio_segflg != UIO_USERSPACE) { + pbuf = NULL; + pages = NULL; + } else if ((dev->si_flags & SI_UNMAPPED) && unmapped_buf_allowed) { + pbuf = NULL; + maxpages = btoc(MIN(uio->uio_resid, MAXPHYS)) + 1; + pages = malloc(sizeof(*pages) * maxpages, M_DEVBUF, M_WAITOK); + } else { + pbuf = getpbuf(NULL); + sa = pbuf->b_data; + maxpages = btoc(MAXPHYS); + pages = pbuf->b_pages; + } + prot = VM_PROT_READ; + if (uio->uio_rw == UIO_READ) + prot |= VM_PROT_WRITE; /* Less backwards than it looks */ + error = 0; for (i = 0; i < uio->uio_iovcnt; i++) { while (uio->uio_iov[i].iov_len) { - bp->b_flags = 0; + bzero(bp, sizeof(*bp)); if (uio->uio_rw == UIO_READ) { - bp->b_iocmd = BIO_READ; + bp->bio_cmd = BIO_READ; curthread->td_ru.ru_inblock++; } else { - bp->b_iocmd = BIO_WRITE; + bp->bio_cmd = BIO_WRITE; curthread->td_ru.ru_oublock++; } - bp->b_iodone = bdone; - bp->b_data = uio->uio_iov[i].iov_base; - bp->b_bcount = uio->uio_iov[i].iov_len; - bp->b_offset = uio->uio_offset; - bp->b_iooffset = uio->uio_offset; - bp->b_saveaddr = sa; - - /* Don't exceed drivers iosize limit */ - if (bp->b_bcount > dev->si_iosize_max) - bp->b_bcount = dev->si_iosize_max; - - /* - * Make sure the pbuf can map the request - * XXX: The pbuf has kvasize = MAXPHYS so a request - * XXX: larger than MAXPHYS - PAGE_SIZE must be - * XXX: page aligned or it will be fragmented. + bp->bio_offset = uio->uio_offset; + bp->bio_data = uio->uio_iov[i].iov_base; + bp->bio_length = uio->uio_iov[i].iov_len; + if (bp->bio_length > dev->si_iosize_max) + bp->bio_length = dev->si_iosize_max; + if (bp->bio_length > MAXPHYS) + bp->bio_length = MAXPHYS; + + /* + * Make sure the pbuf can map the request. + * The pbuf has kvasize = MAXPHYS, so a request + * larger than MAXPHYS - PAGE_SIZE must be + * page aligned or it will be fragmented. */ - iolen = ((vm_offset_t) bp->b_data) & PAGE_MASK; - if ((bp->b_bcount + iolen) > bp->b_kvasize) { - /* - * This device does not want I/O to be split. - */ + poff = (vm_offset_t)bp->bio_data & PAGE_MASK; + if (pbuf && bp->bio_length + poff > pbuf->b_kvasize) { if (dev->si_flags & SI_NOSPLIT) { uprintf("%s: request ptr %p is not " "on a page boundary; cannot split " "request\n", devtoname(dev), - bp->b_data); + bp->bio_data); error = EFBIG; goto doerror; } - bp->b_bcount = bp->b_kvasize; - if (iolen != 0) - bp->b_bcount -= PAGE_SIZE; + bp->bio_length = pbuf->b_kvasize; + if (poff != 0) + bp->bio_length -= PAGE_SIZE; } - bp->b_bufsize = bp->b_bcount; - bp->b_blkno = btodb(bp->b_offset); + bp->bio_bcount = bp->bio_length; + bp->bio_dev = dev; - csw = dev->si_devsw; - if (uio->uio_segflg == UIO_USERSPACE) { - if (dev->si_flags & SI_UNMAPPED) - mapped = 0; - else - mapped = 1; - if (vmapbuf(bp, mapped) < 0) { + if (pages) { + if ((npages = vm_fault_quick_hold_pages( + &curproc->p_vmspace->vm_map, + (vm_offset_t)bp->bio_data, bp->bio_length, + prot, pages, maxpages)) < 0) { error = EFAULT; goto doerror; } + if (pbuf) { + pmap_qenter((vm_offset_t)sa, + pages, npages); + bp->bio_data = sa + poff; + } else { + bp->bio_ma = pages; + bp->bio_ma_n = npages; + bp->bio_ma_offset = poff; + bp->bio_data = unmapped_buf; + bp->bio_flags |= BIO_UNMAPPED; + } } - dev_strategy_csw(dev, csw, bp); + dev->si_devsw->d_strategy(bp); if (uio->uio_rw == UIO_READ) - bwait(bp, PRIBIO, "physrd"); + biowait(bp, "physrd"); else - bwait(bp, PRIBIO, "physwr"); + biowait(bp, "physwr"); + + if (pages) { + if (pbuf) + pmap_qremove((vm_offset_t)sa, npages); + vm_page_unhold_pages(pages, npages); + } - if (uio->uio_segflg == UIO_USERSPACE) - vunmapbuf(bp); - iolen = bp->b_bcount - bp->b_resid; - if (iolen == 0 && !(bp->b_ioflags & BIO_ERROR)) + iolen = bp->bio_length - bp->bio_resid; + if (iolen == 0 && !(bp->bio_flags & BIO_ERROR)) goto doerror; /* EOF */ uio->uio_iov[i].iov_len -= iolen; uio->uio_iov[i].iov_base = (char *)uio->uio_iov[i].iov_base + iolen; uio->uio_resid -= iolen; uio->uio_offset += iolen; - if( bp->b_ioflags & BIO_ERROR) { - error = bp->b_error; + if (bp->bio_flags & BIO_ERROR) { + error = bp->bio_error; goto doerror; } } } doerror: - relpbuf(bp, NULL); + if (pbuf) + relpbuf(pbuf, NULL); + else if (pages) + free(pages, M_DEVBUF); + g_destroy_bio(bp); PRELE(curproc); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed May 6 21:08:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D4A414B; Wed, 6 May 2015 21:08: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 5A7F51E03; Wed, 6 May 2015 21:08:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46L8HXd036551; Wed, 6 May 2015 21:08:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46L8HvM036550; Wed, 6 May 2015 21:08:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201505062108.t46L8HvM036550@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 6 May 2015 21:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282569 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 21:08:17 -0000 Author: mav Date: Wed May 6 21:08:16 2015 New Revision: 282569 URL: https://svnweb.freebsd.org/changeset/base/282569 Log: MFC r281860: Make AIO to not allocate pbufs for unmapped I/O like r281825. While there, make few more performance optimizations. On 40-core system doing many 512-byte AIO reads from array of raw SSDs this change removes lock congestions inside pbuf allocator and devfs, and bottleneck on single AIO completion taskqueue thread. It improves peak AIO performance from ~600K to ~1.3M IOPS. Modified: stable/10/sys/kern/vfs_aio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_aio.c ============================================================================== --- stable/10/sys/kern/vfs_aio.c Wed May 6 21:06:32 2015 (r282568) +++ stable/10/sys/kern/vfs_aio.c Wed May 6 21:08:16 2015 (r282569) @@ -59,10 +59,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -232,9 +234,10 @@ struct aiocblist { int jobstate; /* (b) job state */ int inputcharge; /* (*) input blockes */ int outputcharge; /* (*) output blockes */ - struct buf *bp; /* (*) private to BIO backend, - * buffer pointer - */ + struct bio *bp; /* (*) BIO backend BIO pointer */ + struct buf *pbuf; /* (*) BIO backend buffer pointer */ + struct vm_page *pages[btoc(MAXPHYS)+1]; /* BIO backend pages */ + int npages; /* BIO backend number of pages */ struct proc *userproc; /* (*) user process */ struct ucred *cred; /* (*) active credential when created */ struct file *fd_file; /* (*) pointer to file structure */ @@ -243,7 +246,6 @@ struct aiocblist { struct knlist klist; /* (a) list of knotes */ struct aiocb uaiocb; /* (*) kernel I/O control block */ ksiginfo_t ksi; /* (a) realtime signal info */ - struct task biotask; /* (*) private to BIO backend */ uint64_t seqno; /* (*) job number */ int pending; /* (a) number of pending I/O, aio_fsync only */ }; @@ -344,11 +346,10 @@ static void aio_process_mlock(struct aio static int aio_newproc(int *); int aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lio, int type, struct aiocb_ops *ops); -static void aio_physwakeup(struct buf *bp); +static void aio_physwakeup(struct bio *bp); static void aio_proc_rundown(void *arg, struct proc *p); static void aio_proc_rundown_exec(void *arg, struct proc *p, struct image_params *imgp); static int aio_qphysio(struct proc *p, struct aiocblist *iocb); -static void biohelper(void *, int); static void aio_daemon(void *param); static void aio_swake_cb(struct socket *, struct sockbuf *); static int aio_unload(void); @@ -1294,13 +1295,15 @@ aio_qphysio(struct proc *p, struct aiocb { struct aiocb *cb; struct file *fp; - struct buf *bp; + struct bio *bp; + struct buf *pbuf; struct vnode *vp; struct cdevsw *csw; struct cdev *dev; struct kaioinfo *ki; struct aioliojob *lj; - int error, ref; + int error, ref, unmap, poff; + vm_prot_t prot; cb = &aiocbe->uaiocb; fp = aiocbe->fd_file; @@ -1309,107 +1312,121 @@ aio_qphysio(struct proc *p, struct aiocb return (-1); vp = fp->f_vnode; - - /* - * If its not a disk, we don't want to return a positive error. - * It causes the aio code to not fall through to try the thread - * way when you're talking to a regular file. - */ - if (!vn_isdisk(vp, &error)) { - if (error == ENOTBLK) - return (-1); - else - return (error); - } - - if (vp->v_bufobj.bo_bsize == 0) - return (-1); - - if (cb->aio_nbytes % vp->v_bufobj.bo_bsize) + if (vp->v_type != VCHR) return (-1); - - if (cb->aio_nbytes > - MAXPHYS - (((vm_offset_t) cb->aio_buf) & PAGE_MASK)) + if (vp->v_bufobj.bo_bsize == 0) return (-1); - - ki = p->p_aioinfo; - if (ki->kaio_buffer_count >= ki->kaio_ballowed_count) + if (cb->aio_nbytes % vp->v_bufobj.bo_bsize) return (-1); ref = 0; csw = devvn_refthread(vp, &dev, &ref); if (csw == NULL) return (ENXIO); + + if ((csw->d_flags & D_DISK) == 0) { + error = -1; + goto unref; + } if (cb->aio_nbytes > dev->si_iosize_max) { error = -1; goto unref; } - /* Create and build a buffer header for a transfer. */ - bp = (struct buf *)getpbuf(NULL); - BUF_KERNPROC(bp); + ki = p->p_aioinfo; + poff = (vm_offset_t)cb->aio_buf & PAGE_MASK; + unmap = ((dev->si_flags & SI_UNMAPPED) && unmapped_buf_allowed); + if (unmap) { + if (cb->aio_nbytes > MAXPHYS) { + error = -1; + goto unref; + } + } else { + if (cb->aio_nbytes > MAXPHYS - poff) { + error = -1; + goto unref; + } + if (ki->kaio_buffer_count >= ki->kaio_ballowed_count) { + error = -1; + goto unref; + } + } + aiocbe->bp = bp = g_alloc_bio(); + if (!unmap) { + aiocbe->pbuf = pbuf = (struct buf *)getpbuf(NULL); + BUF_KERNPROC(pbuf); + } AIO_LOCK(ki); ki->kaio_count++; - ki->kaio_buffer_count++; + if (!unmap) + ki->kaio_buffer_count++; lj = aiocbe->lio; if (lj) lj->lioj_count++; - AIO_UNLOCK(ki); - - /* - * Get a copy of the kva from the physical buffer. - */ - error = 0; - - bp->b_bcount = cb->aio_nbytes; - bp->b_bufsize = cb->aio_nbytes; - bp->b_iodone = aio_physwakeup; - bp->b_saveaddr = bp->b_data; - bp->b_data = (void *)(uintptr_t)cb->aio_buf; - bp->b_offset = cb->aio_offset; - bp->b_iooffset = cb->aio_offset; - bp->b_blkno = btodb(cb->aio_offset); - bp->b_iocmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ; - - /* - * Bring buffer into kernel space. - */ - if (vmapbuf(bp, (dev->si_flags & SI_UNMAPPED) == 0) < 0) { - error = EFAULT; - goto doerror; - } - - AIO_LOCK(ki); - aiocbe->bp = bp; - bp->b_caller1 = (void *)aiocbe; TAILQ_INSERT_TAIL(&ki->kaio_bufqueue, aiocbe, plist); TAILQ_INSERT_TAIL(&ki->kaio_all, aiocbe, allist); aiocbe->jobstate = JOBST_JOBQBUF; cb->_aiocb_private.status = cb->aio_nbytes; AIO_UNLOCK(ki); - atomic_add_int(&num_queue_count, 1); - atomic_add_int(&num_buf_aio, 1); - - bp->b_error = 0; + bp->bio_length = cb->aio_nbytes; + bp->bio_bcount = cb->aio_nbytes; + bp->bio_done = aio_physwakeup; + bp->bio_data = (void *)(uintptr_t)cb->aio_buf; + bp->bio_offset = cb->aio_offset; + bp->bio_cmd = cb->aio_lio_opcode == LIO_WRITE ? BIO_WRITE : BIO_READ; + bp->bio_dev = dev; + bp->bio_caller1 = (void *)aiocbe; + + prot = VM_PROT_READ; + if (cb->aio_lio_opcode == LIO_READ) + prot |= VM_PROT_WRITE; /* Less backwards than it looks */ + if ((aiocbe->npages = vm_fault_quick_hold_pages( + &curproc->p_vmspace->vm_map, + (vm_offset_t)bp->bio_data, bp->bio_length, prot, aiocbe->pages, + sizeof(aiocbe->pages)/sizeof(aiocbe->pages[0]))) < 0) { + error = EFAULT; + goto doerror; + } + if (!unmap) { + pmap_qenter((vm_offset_t)pbuf->b_data, + aiocbe->pages, aiocbe->npages); + bp->bio_data = pbuf->b_data + poff; + } else { + bp->bio_ma = aiocbe->pages; + bp->bio_ma_n = aiocbe->npages; + bp->bio_ma_offset = poff; + bp->bio_data = unmapped_buf; + bp->bio_flags |= BIO_UNMAPPED; + } - TASK_INIT(&aiocbe->biotask, 0, biohelper, aiocbe); + atomic_add_int(&num_queue_count, 1); + if (!unmap) + atomic_add_int(&num_buf_aio, 1); /* Perform transfer. */ - dev_strategy_csw(dev, csw, bp); + csw->d_strategy(bp); dev_relthread(dev, ref); return (0); doerror: AIO_LOCK(ki); + aiocbe->jobstate = JOBST_NULL; + TAILQ_REMOVE(&ki->kaio_bufqueue, aiocbe, plist); + TAILQ_REMOVE(&ki->kaio_all, aiocbe, allist); ki->kaio_count--; - ki->kaio_buffer_count--; + if (!unmap) + ki->kaio_buffer_count--; if (lj) lj->lioj_count--; - aiocbe->bp = NULL; AIO_UNLOCK(ki); - relpbuf(bp, NULL); + if (pbuf) { + relpbuf(pbuf, NULL); + aiocbe->pbuf = NULL; + } + g_destroy_bio(bp); + aiocbe->bp = NULL; unref: dev_relthread(dev, ref); return (error); @@ -1787,8 +1804,6 @@ no_kqueue: } #endif queueit: - /* No buffer for daemon I/O. */ - aiocbe->bp = NULL; atomic_add_int(&num_queue_count, 1); AIO_LOCK(ki); @@ -2425,54 +2440,43 @@ sys_lio_listio(struct thread *td, struct return (error); } -/* - * Called from interrupt thread for physio, we should return as fast - * as possible, so we schedule a biohelper task. - */ static void -aio_physwakeup(struct buf *bp) +aio_physwakeup(struct bio *bp) { - struct aiocblist *aiocbe; - - aiocbe = (struct aiocblist *)bp->b_caller1; - taskqueue_enqueue(taskqueue_aiod_bio, &aiocbe->biotask); -} - -/* - * Task routine to perform heavy tasks, process wakeup, and signals. - */ -static void -biohelper(void *context, int pending) -{ - struct aiocblist *aiocbe = context; - struct buf *bp; + struct aiocblist *aiocbe = (struct aiocblist *)bp->bio_caller1; struct proc *userp; struct kaioinfo *ki; int nblks; + /* Release mapping into kernel space. */ + if (aiocbe->pbuf) { + pmap_qremove((vm_offset_t)aiocbe->pbuf->b_data, aiocbe->npages); + relpbuf(aiocbe->pbuf, NULL); + aiocbe->pbuf = NULL; + atomic_subtract_int(&num_buf_aio, 1); + } + vm_page_unhold_pages(aiocbe->pages, aiocbe->npages); + bp = aiocbe->bp; + aiocbe->bp = NULL; userp = aiocbe->userproc; ki = userp->p_aioinfo; AIO_LOCK(ki); - aiocbe->uaiocb._aiocb_private.status -= bp->b_resid; + aiocbe->uaiocb._aiocb_private.status -= bp->bio_resid; aiocbe->uaiocb._aiocb_private.error = 0; - if (bp->b_ioflags & BIO_ERROR) - aiocbe->uaiocb._aiocb_private.error = bp->b_error; + if (bp->bio_flags & BIO_ERROR) + aiocbe->uaiocb._aiocb_private.error = bp->bio_error; nblks = btodb(aiocbe->uaiocb.aio_nbytes); if (aiocbe->uaiocb.aio_lio_opcode == LIO_WRITE) aiocbe->outputcharge += nblks; else aiocbe->inputcharge += nblks; - aiocbe->bp = NULL; TAILQ_REMOVE(&userp->p_aioinfo->kaio_bufqueue, aiocbe, plist); ki->kaio_buffer_count--; aio_bio_done_notify(userp, aiocbe, DONE_BUF); AIO_UNLOCK(ki); - /* Release mapping into kernel space. */ - vunmapbuf(bp); - relpbuf(bp, NULL); - atomic_subtract_int(&num_buf_aio, 1); + g_destroy_bio(bp); } /* syscall - wait for the next completion of an aio request */ From owner-svn-src-all@FreeBSD.ORG Wed May 6 23:40:25 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4BA08AD; Wed, 6 May 2015 23:40: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 A36521033; Wed, 6 May 2015 23:40: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 t46NePLf014378; Wed, 6 May 2015 23:40:25 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46NePe1014377; Wed, 6 May 2015 23:40:25 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201505062340.t46NePe1014377@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Wed, 6 May 2015 23:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282571 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 23:40:25 -0000 Author: neel Date: Wed May 6 23:40:24 2015 New Revision: 282571 URL: https://svnweb.freebsd.org/changeset/base/282571 Log: Check 'td_owepreempt' and yield the vcpu thread if it is set. This is done explicitly because a vcpu thread can be in a critical section for the entire time slice alloted to it. This in turn can delay the handling of the 'td_owepreempt'. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D2430 Modified: head/sys/amd64/include/vmm.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed May 6 23:26:51 2015 (r282570) +++ head/sys/amd64/include/vmm.h Wed May 6 23:40:24 2015 (r282571) @@ -276,7 +276,13 @@ vcpu_is_running(struct vm *vm, int vcpu, static int __inline vcpu_should_yield(struct vm *vm, int vcpu) { - return (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)); + + if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) + return (1); + else if (curthread->td_owepreempt) + return (1); + else + return (0); } #endif From owner-svn-src-all@FreeBSD.ORG Wed May 6 23:52:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F3A0B12; Wed, 6 May 2015 23:52: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 8BE4511DD; Wed, 6 May 2015 23:52:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t46NqHKv020011; Wed, 6 May 2015 23:52:17 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t46NqGRq020002; Wed, 6 May 2015 23:52:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201505062352.t46NqGRq020002@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 May 2015 23:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r282572 - vendor/OpenBSD/dist/usr.bin/rcs X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 23:52:17 -0000 Author: pfg Date: Wed May 6 23:52:15 2015 New Revision: 282572 URL: https://svnweb.freebsd.org/changeset/base/282572 Log: Bring OpenRCS 20150326 to the vendor area. A BSD-licensed alternative to GNU Revision Control System. Obtained from: OpenBSD Added: vendor/OpenBSD/dist/usr.bin/rcs/ vendor/OpenBSD/dist/usr.bin/rcs/Makefile (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/buf.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/buf.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/ci.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/ci.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/co.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/co.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/date.y vendor/OpenBSD/dist/usr.bin/rcs/diff.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/diff.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/diff3.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/ident.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/ident.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/merge.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/merge.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcs.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcs.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsprog.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsprog.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcstime.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rlog.1 (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/rlog.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/worklist.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/worklist.h (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.c (contents, props changed) vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.h (contents, props changed) Added: vendor/OpenBSD/dist/usr.bin/rcs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/OpenBSD/dist/usr.bin/rcs/Makefile Wed May 6 23:52:15 2015 (r282572) @@ -0,0 +1,23 @@ +# $OpenBSD: Makefile,v 1.40 2010/10/15 08:44:12 tobias Exp $ + +PROG= rcs +MAN= ci.1 co.1 ident.1 merge.1 rcs.1 rcsclean.1 rcsdiff.1 rcsmerge.1 rlog.1 + +SRCS= ci.c co.c ident.c merge.c rcsclean.c rcsdiff.c rcsmerge.c rcsparse.c \ + rcsprog.c rlog.c rcsutil.c buf.c date.y diff.c diff3.c rcs.c rcsnum.c \ + rcstime.c worklist.c xmalloc.c + +LINKS= ${BINDIR}/rcs ${BINDIR}/ci ${BINDIR}/rcs ${BINDIR}/co \ + ${BINDIR}/rcs ${BINDIR}/ident ${BINDIR}/rcs ${BINDIR}/merge \ + ${BINDIR}/rcs ${BINDIR}/rcsclean ${BINDIR}/rcs ${BINDIR}/rcsdiff \ + ${BINDIR}/rcs ${BINDIR}/rcsmerge ${BINDIR}/rcs ${BINDIR}/rlog + +CPPFLAGS+=-I${.CURDIR} +CFLAGS+=-Wall +CFLAGS+=-Wstrict-prototypes -Wmissing-prototypes +CFLAGS+=-Wmissing-declarations +CFLAGS+=-Wshadow -Wpointer-arith -Wcast-qual +CFLAGS+=-Wsign-compare +YFLAGS= + +.include Added: vendor/OpenBSD/dist/usr.bin/rcs/buf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/OpenBSD/dist/usr.bin/rcs/buf.c Wed May 6 23:52:15 2015 (r282572) @@ -0,0 +1,331 @@ +/* $OpenBSD: buf.c,v 1.24 2015/02/05 12:59:58 millert Exp $ */ +/* + * Copyright (c) 2003 Jean-Francois Brousseau + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``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 +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "buf.h" +#include "xmalloc.h" +#include "worklist.h" + +#define BUF_INCR 128 + +struct buf { + /* buffer handle, buffer size, and data length */ + u_char *cb_buf; + size_t cb_size; + size_t cb_len; +}; + +#define SIZE_LEFT(b) (b->cb_size - b->cb_len) + +static void buf_grow(BUF *, size_t); + +/* + * Create a new buffer structure and return a pointer to it. This structure + * uses dynamically-allocated memory and must be freed with buf_free(), once + * the buffer is no longer needed. + */ +BUF * +buf_alloc(size_t len) +{ + BUF *b; + + b = xmalloc(sizeof(*b)); + /* Postpone creation of zero-sized buffers */ + if (len > 0) + b->cb_buf = xcalloc(1, len); + else + b->cb_buf = NULL; + + b->cb_size = len; + b->cb_len = 0; + + return (b); +} + +/* + * Open the file specified by and load all of its contents into a + * buffer. + * Returns the loaded buffer on success or NULL on failure. + * Sets errno on error. + */ +BUF * +buf_load(const char *path) +{ + int fd; + ssize_t ret; + size_t len; + u_char *bp; + struct stat st; + BUF *buf; + + buf = NULL; + + if ((fd = open(path, O_RDONLY, 0600)) == -1) + goto out; + + if (fstat(fd, &st) == -1) + goto out; + + if (st.st_size > SIZE_MAX) { + errno = EFBIG; + goto out; + } + buf = buf_alloc(st.st_size); + for (bp = buf->cb_buf; ; bp += (size_t)ret) { + len = SIZE_LEFT(buf); + ret = read(fd, bp, len); + if (ret == -1) { + int saved_errno; + + saved_errno = errno; + buf_free(buf); + buf = NULL; + errno = saved_errno; + goto out; + } else if (ret == 0) + break; + + buf->cb_len += (size_t)ret; + } + +out: + if (fd != -1) { + int saved_errno; + + /* We may want to preserve errno here. */ + saved_errno = errno; + (void)close(fd); + errno = saved_errno; + } + + return (buf); +} + +void +buf_free(BUF *b) +{ + if (b->cb_buf != NULL) + xfree(b->cb_buf); + xfree(b); +} + +/* + * Free the buffer 's structural information but do not free the contents + * of the buffer. Instead, they are returned and should be freed later using + * xfree(). + */ +void * +buf_release(BUF *b) +{ + void *tmp; + + tmp = b->cb_buf; + xfree(b); + return (tmp); +} + +u_char * +buf_get(BUF *b) +{ + return (b->cb_buf); +} + +/* + * Empty the contents of the buffer and reset pointers. + */ +void +buf_empty(BUF *b) +{ + memset(b->cb_buf, 0, b->cb_size); + b->cb_len = 0; +} + +/* + * Append a single character to the end of the buffer . + */ +void +buf_putc(BUF *b, int c) +{ + u_char *bp; + + if (SIZE_LEFT(b) == 0) + buf_grow(b, BUF_INCR); + bp = b->cb_buf + b->cb_len; + *bp = (u_char)c; + b->cb_len++; +} + +/* + * Append a string to the end of buffer . + */ +void +buf_puts(BUF *b, const char *str) +{ + buf_append(b, str, strlen(str)); +} + +/* + * Return u_char at buffer position . + */ +u_char +buf_getc(BUF *b, size_t pos) +{ + return (b->cb_buf[pos]); +} + +/* + * Append bytes of data pointed to by to the buffer . If the + * buffer is too small to accept all data, it will get resized to an + * appropriate size to accept all data. + * Returns the number of bytes successfully appended to the buffer. + */ +size_t +buf_append(BUF *b, const void *data, size_t len) +{ + size_t left, rlen; + u_char *bp; + + left = SIZE_LEFT(b); + rlen = len; + + if (left < len) + buf_grow(b, len - left); + bp = b->cb_buf + b->cb_len; + memcpy(bp, data, rlen); + b->cb_len += rlen; + + return (rlen); +} + +/* + * Returns the size of the buffer that is being used. + */ +size_t +buf_len(BUF *b) +{ + return (b->cb_len); +} + +/* + * Write the contents of the buffer to the specified + */ +int +buf_write_fd(BUF *b, int fd) +{ + u_char *bp; + size_t len; + ssize_t ret; + + len = b->cb_len; + bp = b->cb_buf; + + do { + ret = write(fd, bp, len); + if (ret == -1) { + if (errno == EINTR || errno == EAGAIN) + continue; + return (-1); + } + + len -= (size_t)ret; + bp += (size_t)ret; + } while (len > 0); + + return (0); +} + +/* + * Write the contents of the buffer to the file whose path is given in + * . If the file does not exist, it is created with mode . + */ +int +buf_write(BUF *b, const char *path, mode_t mode) +{ + int fd; + open: + if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) { + if (errno == EACCES && unlink(path) != -1) + goto open; + else + err(1, "%s", path); + } + + if (buf_write_fd(b, fd) == -1) { + (void)unlink(path); + errx(1, "buf_write: buf_write_fd: `%s'", path); + } + + if (fchmod(fd, mode) < 0) + warn("permissions not set on file %s", path); + + (void)close(fd); + + return (0); +} + +/* + * Write the contents of the buffer to a temporary file whose path is + * specified using